Apache組態檔:httpd.conf檔案
# 指定Apache的安裝路徑,此選項引數值在安裝Apache時系統會自動把Apache的路徑寫入, ServerRoot "/www/server/apache"
# Listen主要偵聽web服務埠狀態,默認為:80,即偵聽所有的地址的80埠,注意這里也可以寫成IP地址的偵聽形式,不寫即默認的地址:0.0.0.0 Listen 106.15.88.162:80 Listen 80
# 指定Apache運行用戶配置 User www Group www
# 指定Apache服務管理員通知郵箱地址,選擇默認值即可,如果有真實的郵箱地址也可以設定此值 ServerAdmin [email protected]
# 指定Apache默認的服務器名以及埠,默認引數值設定為:ServerName localhost:80即可 ServerName 0.0.0.0:80
# 設定Apache的日志級別,訪問日志路徑,錯誤日志路徑, # 參考:https://blog.51cto.com/longlei/2095594與https://blog.csdn.net/u013699800/article/details/37593491 LogLevel warn ErrorLog "/www/wwwlogs/error_log" <IfModule log_config_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common <IfModule logio_module> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio </IfModule> CustomLog "/www/wwwlogs/access_log" common # 普通檔案記錄,common格式就是標準格式, CustomLog "/www/wwwlogs/access_log" combined # 復合日志記錄 </IfModule>
Apache組態檔:httpd-ssl.conf檔案(配置ssl)
<VirtualHost *:443> ServerAdmin webmasterexample.com DocumentRoot "/www/wwwroot/liudong.top/" ServerName SSL.liudong.top ServerAlias liudong.top errorDocument 404 /404.html ErrorLog "/www/wwwlogs/liudong.top-error_log" CustomLog "/www/wwwlogs/liudong.top-access_log" combined #SSL SSLEngine On SSLCertificateFile /etc/letsencrypt/live/liudong.top/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/liudong.top/privkey.pem SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH SSLProtocol All -SSLv2 -SSLv3 SSLHonorCipherOrder On </VirtualHost>
https://www.cnblogs.com/liaokong/p/9158962.html
重定向問題
#301-START
#方法1
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^adspush.com [NC]
RewriteRule ^(.*) http://www1.adspush.com$1 [L,R=301]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.adspush.com [NC]
RewriteRule ^(.*) http://www1.adspush.com$1 [L,R=301]
</IfModule>
#方法2:其中www1.adspush.com為最終希望出現的域名,其中OR的含義為"或",可以通過OR繼續添加更多的域名,
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^adspush.com [NC]
RewriteCond %{HTTP_HOST} ^www.adspush.com [NC,OR]
RewriteRule ^(.*)$ http://www1.adspush.com/$1 [L,R=301]
</IfModule>
#301-END
https://www.cnblogs.com/cqmy/p/6208656.html
https://www.cnblogs.com/hh1137054072/p/7612652.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/63525.html
標籤:其他
上一篇:Web服務器—Nginx
