我按照以下說明操作:virtual host,https。apache 2.4虛擬主機給我帶來「Index of /」
因爲我用一個DynDNS的爲我的LOCA託管webside,我最終000-default.conf
看起來是這樣的:
<VirtualHost *:443>
ServerName www.mydomain.dyndns.xx
ServerAdmin [email protected]
DocumentRoot /var/www/html/mydomain.dyndns.xx/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/ca.crt
SSLCertificateKeyFile /etc/apache2/ssl/ca.key
ErrorLog ${APACHE_LOG_DIR}/www.virtualhost1.com_error.log
CustomLog ${APACHE_LOG_DIR}/www.virtualhost1.com_access.log combined
</VirtualHost>
我additionaly在/etc/apache2/apache.conf
配置的follwoing:
<Directory /var/www/html/mydomain.dyndns.xx>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
,並在/etx/host
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.1.1 raspberrypi
192.168.x.x www.mydomain.dyndns.xx
當我嘗試打開它的頁面URL描述了端口80上的「Indes of /」,當我敲擊這些文件時,我得到http:// mydomain.dyndns.xx/mydomain.dyndns.xx.index.php
如果我打電話給https://,那麼我的瀏覽器上會收到ERR_CONNECTION_REFUSED。
謝謝你的幫助!