Home > サーバー > Apache Archive

Apache Archive

/tmp 容量MAX..

/tmp 容量MAX..

「/tmp/magick-***」
に引き続き
「/tmp/magick-***」の容量激増で、「https(暗号通信[SSL])」が500エラー。

推測ですが、cgiやhtmlでは異常をきたしていない事を察するに、特定ページの「https」の場合に「/tmp」内に何かしらファイルを保存しようとしたものの、容量が無い事で発生した模様と考えられます。

なにわともあれ、「ImageMagick」の対策を打たないと同じ事が発生します..
対策を講じなければと改めて思えました。

メモ(備忘録): 2018/12/12

Certbot (Let's Encrypt): サブドメイン追加方法メモ

サブドメイン「www.fya.jp」追加方法

NG例:

# /usr/local/certbot/certbot-auto certonly --webroot \
> -w /home/httpd/html -m info@fya.jp -d fya.jp -d ftp.fya.jp -d mail.fya.jp \
> -w /home/www/public_html -m info@fya.jp -d www.fya.jp \
> --agree-tos
Upgrading certbot-auto 0.22.2 to 0.23.0...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
Installation succeeded.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for fya.jp
http-01 challenge for ftp.fya.jp
http-01 challenge for mail.fya.jp
http-01 challenge for www.fya.jp
Using the webroot path /home/www/public_html for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. www.fya.jp (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.fya.jp/.well-known/acme-challenge/uKhFxCNCND5XF7y1D923uECBY4Qmk-c5XioMlcaVCfU: "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p"

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: www.fya.jp
   Type:   unauthorized
   Detail: Invalid response from
   http://www.fya.jp/.well-known/acme-challenge/uKhFxCNCND5XF7y1D923uECBY4Qmk-c5XioMlcaVCfU:
   "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>404 Not Found</title>
   </head><body>
   <h1>Not Found</h1>
   <p"

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address.

OK例:

# /usr/local/certbot/certbot-auto certonly --webroot \
> -w /home/httpd/html -m info@fya.jp -d fya.jp -d ftp.fya.jp -d mail.fya.jp \
> -w /home/www/public_html -m info@fya.jp -d www.fya.jp \
> --agree-tos
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for fya.jp
http-01 challenge for ftp.fya.jp
http-01 challenge for mail.fya.jp
http-01 challenge for www.fya.jp
Using the webroot path /home/www/public_html for all unmatched domains.
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/fya.jp/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/fya.jp/privkey.pem
   Your cert will expire on 2018-07-23. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again. To non-interactively renew *all* of your certificates, run
   "certbot-auto renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

NG回避&OKにする追加方法

/etc/letsencrypt/renewal

こちらは勿論バックアップの意味でもリネームを施工
例: fya.jp.conf_OLD20180425

/etc/letsencrypt/archive

から該当ドメインをリネームなどを施工
例: fya.jp_OLD20180425

/etc/letsencrypt/live

こちらも一応施工
例: fya.jp_OLD20180425

※ココから以下はリネームなどのバックアップ後で、「サブドメイン追加」後に必要に応じて編集。
(そうしないと、追加時にエラーが出ていた。)

状況(https://サブドメインによる運用するの場合)により

/etc/httpd/conf.d/ssl.conf

も弄る(追加する[追加編集])。
最終的にApache再起動などで反映させる。

環境:
Apache 2.2系

いつも通り、実施に関しては自己責任!!

Apache 2.2 「_(アンダーバー)」対策

答えから書くと、ダウングレード(ロールバック)にて解決としました。
セキュリティ面から言えばNGですが、取り敢えず次期大幅改造?改良?されるまではコレで運用していくことにします。
もちろん下記施工に当たっては自動アップデートからの除外をお忘れなく!!

ダウングレード方法

まずはダウングレードが可能かを確認。

# yum --showduplicate list httpd*

ココに出ていれば可能の様です。
バージョンが上のものも出ているけど気にしない。

# yum --showduplicate list httpd*
インストール済みパッケージ
httpd.x86_64                                                  2.2.15-60.el6.centos.4                      @updates
httpd-devel.x86_64                                            2.2.15-60.el6.centos.4                      @updates
httpd-tools.x86_64                                            2.2.15-60.el6.centos.4                      @updates
利用可能なパッケージ
httpd.x86_64                                                  2.2.15-59.el6.centos                        base
httpd.x86_64                                                  2.2.15-60.el6.centos.4                      updates
httpd-devel.i686                                              2.2.15-59.el6.centos                        base
httpd-devel.x86_64                                            2.2.15-59.el6.centos                        base
httpd-devel.i686                                              2.2.15-60.el6.centos.4                      updates
httpd-devel.x86_64                                            2.2.15-60.el6.centos.4                      updates
httpd-manual.noarch                                           2.2.15-59.el6.centos                        base
httpd-manual.noarch                                           2.2.15-60.el6.centos.4                      updates
httpd-tools.x86_64                                            2.2.15-59.el6.centos                        base
httpd-tools.x86_64                                            2.2.15-60.el6.centos.4                      updates
httpd24.x86_64                                                1.1-5.el6                                   centos-sclo-rh
httpd24.x86_64                                                1.1-14.el6                                  centos-sclo-rh
(以下略

改めて、ダウングレードさせたいパッケージを指定して実行します。

# yum downgrade httpd httpd-devel httpd-tools mod_ssl

SSLは依存性解決エラーの為に入れました。
改めて確認すると、同時にアップデートされていましたので。

追記: 期間中は、 Logwatch からのメールも 「 was considered unsolicited bulk e-mail (UBE). 〜 Delivery of the email was stopped! 」 となり、届いていませんでした!!

参考リンク
http://hacknote.jp/archives/5946/

Postfix de 躓いた笑

Postfix というよりは SMTP かもしれませんね。
直ぐに受信は確認できましたし…
これまた直ぐに送信も…
後から思い出しても、どうして直ぐに送信できないのか…
SMTP の認証でコケていたみたいです。

かなり久方ぶりの再構築ですから、そのあたりはご愛嬌でお願いしますね。

そして改善した方法すら…今は思い出せないでいます涙
どうして改善したのでしょうね…

想い出しましたら編集しておきます涙
PAM認証かもしれません…謎

参考リンク
http://www.usupi.org/sysad/210.html
http://www.uetyi.mydns.jp/wordpress/postfix-setting/entry-465.html

関係ないですが、圧縮通信の可否確認サイトをご紹介しておきますね。
参考にしていたサイトが軒並み404なので…

参考リンク
http://www.gidnetwork.com/tools/gzip-test.php

CentOS 6.5 (x86_64) suPHP 0.7.2 test目的でソースコードから

以前に CentOS を入れた64bit機へ suPHP を導入

前提環境

Package Version
Apache 2.2
PHP 5.3

Continue reading

HTTPS SSL 証明書取得 by StartSSL

StartSSL で証明書を頂きました。
前にも取得した記憶はあるんですが、詳しいことは覚えていません・・

ちなみに取得されたい方は、検索されれば大量にヒットしますから頑張ってください。

参考リンク
https://www.startssl.com/

Windows 7 + Apache 2.2 + PHP 5.2

Apache 2.2

http://archive.apache.org/dist/httpd/binaries/win32/
から
httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.msi
をダウンロードしてインストール。

インストール途中の項目は、下記のように設定しておいた。

Network Domain: localhost
Server Name: localhost
Administrator's Email: 適当なメールアドレス
for All Users, on Port 80

インストールフォルダは、下記のように設定。

C:\Apache2.2\

ここで、私の場合 Windows 7 で80番ポートが使用されており、Apacheを起動できなかった。
以下のコマンドで確認できた。

C:\Users\hogehoge>netstat -aon | findstr 0.0.0.0:80

つぎに以下のコマンドで上記 PID と照らし合わせてサービスを終了させる。

C:\Users\hogehoge>tasklist

私の場合は、Skypeが犯人だったのでランダムポートに設定してSkypeを再起動した。

PHP 5.2をダウンロード。

http://windows.php.net/download/#php-5.2-ts-VC6-x86

ダウンロードしたzipファイルを解凍。
私は下記ディレクトリへ解凍しました。

D:\php

その後、「php.ini-dist」を「C:\WINDOWS」のへコピーし、名前を「php.ini」に変更。

MySQL 5.5をダウンロード。

http://sourceforge.jp/projects/sfnet_mysql.mirror/downloads/mysql-5.5.22-win32.msi/

設定などは下記を参照下さい。

http://awoni.net/personal-site/mysql/

参考リンク
http://ameblo.jp/shiroharakuina/entry-10406305652.html
http://www.cyberarchitect.net/blog/archives/992
http://dai-u-chu.sblo.jp/article/48392584.html
http://windows.php.net/download/
http://www.webdlab.com/guide/php/php_2.php
http://sourceforge.jp/projects/sfnet_mysql.mirror/downloads/mysql-5.5.22-win32.msi/

SQLite2 をインストール

HXPではsuPHPの為にPHP 5.2系を使用しているので、その環境での説明になります。

取り合えずは、ダウンロードしてきたファイルを解凍してSQLiteディレクトリへ移動。
そこからphpizeを打って、メイク&インストール。

# tar zxvf php-5.2.*.tar.gz
cd php-5.2.*/ext/sqlite
phpize
./configure
make
make install

次にiniファイルを作成。

# vi /etc/php.d/sqlite.ini

中身には以下を記述。

extension=sqlite.so

最後にApacheを再起動。

# /etc/init.d/httpd graceful

このようにインストールすると、SQLiteだけ独自管理になるので、次のバージョンが出たらまたインストールしないといけないみたい。

参考リンク
http://d.hatena.ne.jp/sotarok/20080607/php_5_with_sqlite

Apache 2.2 PHP & suPHP 共存

Vine 4.2 の Apache 2.2 環境にて PHP(Module版) & suPHP(CGI版) を共存させるお話。

Continue reading

AllowEncodedSlashes 「%2F」で404エラー

  • Posted by: 水瀬
  • 2010年4月16日 20:11
  • Apache

mod_rewrite で値を渡す時に「%2F」が含まれていると404エラーになった。
これは Apache がリクエストされたURLに「%2F」が含まれていたら強制的に404を返すようになっているのが問題です。

Continue reading

mod_rewrite 「/(スラッシュ)」が減る

  • Posted by: 水瀬
  • 2009年1月 5日 20:24
  • Apache

mod_rewrite で以下のように設定した時、「//(ダブルスラッシュ)」が「/(スラッシュ)」になってしまいました。

リンクURL :
http://fya.jp/sample/http://www.fya.jp/

RewriteRule :

RewriteRule ^sample/(.*)$ sample\.cgi?url=$1 [L]

結果 :
http://fya.jp/sample.cgi?url=http:/www.fya.jp/

Continue reading

Apache 2.2 PHP suPHP 環境構築

Vine 4.2 環境でsuPHPを使うお話。

Continue reading

Apache 2.2 CGI suEXEC 環境構築

Vine 4.2 環境でsuEXECを使うお話。

Continue reading

URLエンコード with mod_rewrite in Apache 1.3

  • Posted by: 水瀬
  • 2008年9月14日 20:59
  • Apache

URLエンコード を含むURLを mod_rewrite で使う場合の注意。

Continue reading

mod_rewrite MultiViews

  • Posted by: 水瀬
  • 2007年9月14日 17:46
  • Apache | FYA

mod_rewriteを利用していたら問題が発生。

問題
「http://ドメイン/sitemap/(以下sitemap/)」を参照しようとして404エラーを受ける。問題は「http://ドメイン/sitemap.拡張子(以下sitemap.拡張子)」が存在するからでした。FYAのホームページサーバー(Apache)ではデフォルトでオプション「MultiViews」が有効だからです。

Continue reading

レスポンスヘッダ Vary

  • Posted by: 水瀬
  • 2007年2月27日 02:22
  • Apache | FYA

IE6 において、レスポンスヘッダに含まれる Vary が原因で正しく処理されない問題があります。Vary が含まれていたことで、バナーが正しい形式で保存できないという問題がおきていました。

Continue reading

Apache & FYA

  • Posted by: 水瀬
  • 2006年12月13日 00:55
  • Apache | FYA

Apache 2.0 系
Apache 2.2 系

どちらかに移行したい気も少ししています。でも確か何かが対応していなかった気がするんですよね。そのあたりの不安もあり、現状の Apache 1.3系 の機能を損なわないで移行できるか問題です。

Continue reading

Index of all entries

Home > サーバー > Apache Archive

Search
Feeds

Return to page top