Cent OS 上的 apache 在 https 開啟預設頁面

Cent OS 上的 apache 在 https 開啟預設頁面

我是 Apache 和 SSL 及其配置的新手。我已獲得 VeriSign 證書來保護我的網站。我有公共、私人和 ca_intermediate 憑證檔案。我的配置ssl.conf如下:

 VirtualHost _default_:443>
 DocumentRoot /var/www/mydomain.com/web/
 ServerName mydomain.com:443
 ServerAlias www.mydomain.com 
 # Use separate log files for the SSL virtual host; note that LogLevel
# is not inherited from httpd.conf.
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

問題是,當我www.mydoamin.com使用 HTTP 存取時,它工作正常,但是當我使用 HTTPS 存取時,它只會打開預設的 Apache 頁面,但帶有綠色的 HTTPS 掛鎖,這意味著我的憑證安裝正確。我怎樣才能擺脫這種情況。

編輯 輸出apachectl -S

-bash-3.2# apachectl -S
[Mon Aug 27 10:20:19 2012] [warn] NameVirtualHost 82.56.29.189:80 has no VirtualHosts
[Mon Aug 27 10:20:19 2012] [warn] NameVirtualHost 82.56.29.189:443 has no VirtualHosts
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:8081         localhost.localdomain (/etc/httpd/conf/sites-enabled/000-apps.vhost:10)
*:8080                 is a NameVirtualHost
         default server localhost.localdomain (/etc/httpd/conf/sites-enabled/000-ispconfig.vhost:10)
         port 8080 namevhost localhost.localdomain (/etc/httpd/conf/sites-enabled/000-ispconfig.vhost:10)
*:443                  is a NameVirtualHost
         default server mydomain.com (/etc/httpd/conf.d/ssl.conf:81)
         port 443 namevhost mydomain.com (/etc/httpd/conf.d/ssl.conf:81)
*:80                   is a NameVirtualHost
         default server app.mydomain.com (/etc/httpd/conf/sites-enabled/100-app.mydomain.com.vhost:7)
         port 80 namevhost app.mydomain.com (/etc/httpd/conf/sites-enabled/100-app.mydomain.com.vhost:7)
         port 80 namevhost mydomain.com (/etc/httpd/conf/sites-enabled/100-mydomain.com.vhost:7)
Syntax OK

答案1

新增目錄標籤 ,我的網路檔案所在的位置。解決了問題。現在工作正常。

相關內容