以前のリビジョンの文書です
基本設定
<VirtualHost *:80> ServerName サーバー名 enjoy-lei.com DocumentRoot ディレクトリパス指定 /var/www/enjoy-lei.com/htdocs ErrorLog エラーログ出力パス指定 logs/enjoy-lei.com-error_log CustomLog エラーログ出力パス指定 logs/enjoy-lei.com-access_log common # debug LogLevel debug </VirtualHost>
SSHありの設定
<VirtualHost *:443> ServerName サーバー名 enjoy-lei.com DocumentRoot ディレクトリパス指定 /home/www/enjoy-lei.com/htdocs ErrorLog エラーログ出力パス指定 logs/enjoy-lei.com-error_log CustomLog エラーログ出力パス指定 logs/enjoy-lei.com-access_log common # SSL Engine Switch: SSLEngine on SSLVerifyClient none SSLProtocol all SSLCertificateFile /etc/httpd/conf/ssl/enjoy-lei.com.crt SSLCertificateKeyFile /etc/httpd/conf/ssl/enjoy-lei.com.key #SSLCACertificateFile /etc/httpd/conf/ssl/enjoy-lei.com.ca SSLCertificateChainFile /etc/httpd/conf/ssl/enjoy-lei.com.ca # SSL Cipher Suite: SSLCipherSuite 暗号スイート **** # SSL Engine Options: # SSLOptions +StdEnvVars +CompatEnvVars <Files ~ "\.(cgi|shtml|phtml|php3?)$"> SSLOptions +StdEnvVars </Files> # debug LogLevel debug </VirtualHost>
ディレクトごとにIPアクセス制限
<Directory "/var/www/enjoy-lei.com/htdocs/test1"> AllowOverride All Order deny,allow deny from all # Allow from IP Allow from 128.0.0.1 </Directory>
<Directory "/var/www/enjoy-lei.com/htdocs/test2"> AllowOverride All Order deny,allow deny from all # Allow from IP Allow from 128.0.0.2 </Directory>
更に指定ファイルのみアクセス制限
<Directory "/var/www/enjoy-lei.com/htdocs/test3/media"> <FilesMatch "(test1\.mp3|test2\.mp4|test3\.mp4|test4\.html)$"> Order deny,allow deny from all allow from all </FilesMatch> </Directory>