2009年9月21日月曜日

サーバー設定(2)

[1] Apacheインスト&設定

# yum -y install httpd
# yum -y install php php-devel php-mysql php-mbstring php-gd php-pear
#cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.org
# vi /etc/httpd/conf/httpd.conf

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

AllowOverride All ← .htaccessの許可

Options Indexes FollowSymLinks

Options -Indexes FollowSymLinks ←Apacheでファイル一覧を表示させない 。-をつけるだけ

AddDefaultCharset UTF-8

#AddDefaultCharset UTF-8 ← コメントアウト

#NameVirtualHost *:80

NameVirtualHost *:80 (← バーチャルドメイン設定 行頭にある # を削除)


ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/html/example.com


# mkdir /var/www/html/example.com
# chown ftpuser /var/www/html/example.com(← ftpユーザーのアクセスを可能に)

service httpd reload

# chkconfig httpd on ← httpd自動起動設定
# chkconfig --list httpd ← 確認


[2] Vsftpdインスト&設定

*winSCPでSFTPするときはVsftpd不要

# yum -y install vsftpd
# vi /etc/vsftpd/vsftpd.conf 

anonymous_enable=NO ← 匿名ユーザのログイン禁止
ascii_upload_enable=YES ← 行頭にある # を削除
ascii_download_enable=YES ← 行頭にある # を削除
ls_recurse_enable=YES ← 行頭にある # を削除 (ディレクトリごと削除)
use_localtime=YES ← 追加 (タイムスタンプを日本時間に)
force_dot_files=YES ← 追加 (.htaccessを表示)


# service vsftpd start
# chkconfig vsftpd on ← vsftpd自動起動設定
# chkconfig --list vsftpd ← 設定確認

0 件のコメント:

コメントを投稿