「Apache HTTP Server 2.0.65」が7月9日に公開れるも、これが最後
7/9に公開された「Apache HTTP Server 2.0.65」。今回のVersionで開発は打ち切りとなるらしい。今回のVersionでは、セキュリティなどの修正があるが、2.2や2.4での問題が一部含まれていないという。
2.0は今後セキュリティ面で脆弱となるため、2.2または2.4への移行を早めに行ったほうがいいだろう。
# htpasswd -c /home/user/pwd/.htpasswd user1
# New password: # Re-type new password: # Adding password for user user1
# htpasswd /home/user/pwd/.htpasswd user2
# htpasswd /home/user/pwd/.htpasswd user1
AuthUserFile /home/user/pwd/.htpasswd AuthGroupFile /dev/null AuthName "Secure site" AuthType Basic require valid-user
| AuthUserFile | パスワードファイルの場所 |
| AuthGroupFile | グループファイルの指定、必要ないので "/dev/null" |
| AuthName | 認証時のメッセージ |
| AuthType | 認証方法、Basic認証を指定 |
| require | valid-userは全てのユーザ、"user [username]"で任意のユーザ |
Order Deny,Allow Deny from all Allow from 192.168.1 Allow from 127.0.0.1 AuthUserFile /home/user/pwd/.htpasswd AuthGroupFile /dev/null AuthName "Secure site" AuthType Basic require valid-user
Order Deny,Allow Deny from all Allow from 192.168.1 Allow from 127.0.0.1 AuthUserFile /home/user/pwd/.htpasswd AuthGroupFile /dev/null AuthName "Secure site" AuthType Basic require valid-user Satisfy Any
SetEnvIf X-UP-SUBNO ^05001234567890_ag\.ezweb\.ne\.jp$ mobilephone SetEnvIf X-UP-SUBNO ^05012345678901_ae\.ezweb\.ne\.jp$ mobilephone Order Deny,Allow Deny from all Allow from env=mobilephone Allow from 192.168.1 Allow from 127.0.0.1 AuthUserFile /home/user/pwd/.htpasswd AuthGroupFile /dev/null AuthName "Secure site" AuthType Basic require user user1 Satisfy Any
# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
old_passwords=1
default-character-set=utf8
skip-character-set-client-handshake
character-set-server = utf8
collation-server = utf8_general_ci
init-connect = SET NAMES utf8
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqldump]
default-character-set=utf8
# /etc/rc.d/init.d/mysqld restart
mysqld を停止中: [ OK ]
mysqld を起動中: [ OK ]
# vi /etc/php.ini
//デフォルトの文字コード
;default_charset = "iso-8859-1"
default_charset = "UTF-8"
//タイムゾーン
;date.timezone =
date.timezone = "Asia/Tokyo"
//利用言語の設定
;mbstring.language = Japanese
mbstring.language = Japanese
//マルチバイト文字列関数のデフォルト文字コード
;mbstring.internal_encoding = EUC-JP
mbstring.internal_encoding = UTF-8
//HTTP入出力の文字コード変換。passにして、自動変換offとする。
;mbstring.http_input = auto
mbstring.http_input = pass
;mbstring.http_output = SJIS
mbstring.http_output = pass
;mbstring.encoding_translation = Off
mbstring.encoding_translation = Off
//文字コード自動判別に優先する文字コード
:mbstring.detect_order = auto
mbstring.detect_order = auto
//変換に失敗した場合に表示する文字
;mbstring.substitute_character = none;
mbstring.substitute_character = none;
//オーバーロードされる関数の指定(今回はオーバーロードしない)
;mbstring.func_overload = 0
mbstring.func_overload = 0
//文字コードの自動判別を厳密に行うかの設定
:mbstring.strict_detection = Off
mbstring.strict_detection = Off
//MIMEタイプの指定(空白)
;mbstring.http_output_conv_mimetype=
mbstring.http_output_conv_mimetype=
# /etc/rc.d/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]
# vi /etc/httpd/conf/httpd.conf
#AddDefaultCharset UTF-8 <-コメントアウト(文字化け対策)
//これより以下の部分は、Aliasでのエラー回避のため
最終行へ移動( ~ を表示しない場合)
<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#UserDir disabled <-コメントアウト
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disabled" line above, and uncomment
# the following line instead:
#
UserDir public_html <-コメント解除
//ユーザは~(チルダ)なしでアクセスできるよう設定を追加
AliasMatch ^/([^/]+)/(.*) /home/$1/public_html/$2
</IfModule>
//下記を追加
<Directory /home/*/public_html>
AllowOverride All <- .htaccess許可
Options IncludesNoExec ExecCGI FollowSymLinks <- CGI許可
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
# /etc/rc.d/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]
# mkdir /home/user/public_html
# chmod 755 /home/ <- パーミッション確認
# chmod 755 /home/user/ <- パーミッション変更
# chmod 755 /home/user/public_html/ <- パーミッション変更
$ vi /home/seiji/public_html/index.html

# getenforce
Enforcing <-SELinux有効
Permissive <-SELinux無効
# setenforce 0
# vi /etc/sysconfig/selinux
#SELINUX=enforcing
SELINUX=disabled
# yum list install httpd php mysql-server
httpd.i686 2.2.15-15.el6.centos.1
mysql-server.i686 5.1.61-1.el6_2.1
php.i686 5.3.3-3.el6_2.6
# yum install httpd php mysql-server
# yum list install mod_auth_mysql php-mysql php-mbstring
php-gd perl-Net-SSLeay expect
# yum install mod_auth_mysql php-mysql php-mbstring
php-gd perl-Net-SSLeay expect
# vi /etc/hosts
# vi /etc/httpd/conf/httpd.conf(下記項目の値を変更)
# vi /etc/my.cnf(下記を追加)
# /etc/rc.d/init.d/mysqld start
mysql -u root
mysql> show variables like 'char%';
mysql> select host,user,password from mysql.user;
# /etc/rc.d/init.d/httpd start
# chkconfig httpd on
# chkconfig --list httpd
# chkconfig mysqld on
# chkconfig --list mysqld
# vi /var/www/html/index.html
$ vi /var/www/html/info.php

