网站配置文件
<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot "/www/wwwroot/www.easy-core.com"
ServerName cbd081ce.www.easy-core.com
ServerAlias www.easy-core.com easy-core.com
errorDocument 404 /404.html
ErrorLog "/www/wwwlogs/www.easy-core.com-error_log"
CustomLog "/www/wwwlogs/www.easy-core.com-access_log" combined
#HTTP_TO_HTTPS_START
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]
</IfModule>
#HTTP_TO_HTTPS_END
#SECURITY-START 防盗链配置
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !www.easy-core.com [NC]
RewriteCond %{HTTP_REFERER} !easy-core.com [NC]
RewriteRule .(jpg|jpeg|gif|png|js|css|swf|pdf|doc|docx|xls|xlsx|xlsm|rar|zip|7z) /404.html [R=404,NC,L]
#SECURITY-END
#DENY FILES
<Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
Order allow,deny
Deny from all
</Files>
#PHP
<FilesMatch \.php$>
SetHandler "proxy:unix:/tmp/php-cgi-71.sock|fcgi://localhost"
</FilesMatch>
#PATH
<Directory "/www/wwwroot/www.easy-core.com">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex default.html default.htm default.php index.html index.htm index.php
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmasterexample.com
DocumentRoot "/www/wwwroot/www.easy-core.com/"
ServerName SSL.www.easy-core.com
ServerAlias www.easy-core.com easy-core.com
errorDocument 404 /404.html
ErrorLog "/www/wwwlogs/www.easy-core.com-error_log"
CustomLog "/www/wwwlogs/www.easy-core.com-access_log" combined
#SSL
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/www.easy-core.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.easy-core.com/privkey.pem
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLProtocol All -SSLv2 -SSLv3
SSLHonorCipherOrder On
#HTTP_TO_HTTPS_END
#SECURITY-START 防盗链配置
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [NC]
RewriteCond %{HTTP_REFERER} !www.easy-core.com [NC]
RewriteCond %{HTTP_REFERER} !easy-core.com [NC]
RewriteRule .(jpg|jpeg|gif|png|js|css|swf|pdf|doc|docx|xls|xlsx|xlsm|rar|zip|7z) /404.html [R=404,NC,L]
#SECURITY-END
#PHP
<FilesMatch \.php$>
SetHandler "proxy:unix:/tmp/php-cgi-71.sock|fcgi://localhost"
</FilesMatch>
#DENY FILES
<Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
Order allow,deny
Deny from all
</Files>
#PATH
<Directory "/www/wwwroot/www.easy-core.com/">
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex default.html default.htm default.php index.html index.htm index.php
</Directory>
</VirtualHost> |