apache 虛擬路徑設置

apache 虛擬路徑設置

apache 2.4php

# 注意開放 443
<VirtualHost *:443>
	# 啓用ssl
    SSLEngine on
    # 證書
    SSLCertificateFile /D/HttpsCert/xxx.com/www.xxx.com/public.crt
    # 證書key
    SSLCertificateKeyFile /D/HttpsCert/xxx.com/www.xxx.com/key.key
    # 文件夾訪問權限
    <Directory "/D/Web">
        # 目錄權限
        Options Indexes FollowSymLinks
        AllowOverride All
        # 網站默認文檔
        DirectoryIndex index.php index.html
    </Directory>
    # 管理員
    ServerAdmin xx@qq.com
    # 網站文件路徑
    DocumentRoot /D/Web/xxx.com
    # 網站域名
    ServerName www.xxx.com
    
    # 網站報錯文件
    ErrorLog "logs/www.xxx.shop-error.log"
    # 網站用戶登陸
    CustomLog "logs/www.xxx.shop-access.log" common
</VirtualHost>

# 注意開發 80
<VirtualHost *:80>
    ServerName www.xxx.com
    # 強制http轉到https
    Redirect permanent / https://www.xxx.com/
</VirtualHost>
相關文章
相關標籤/搜索