简体   繁体   中英

Why Apache ignore my VirtualHost declaration?

Apache (from XAMPP) dont work like expected. When I type https://myVirtualHost , I would join "C:/xampp/htdocs/myApplication/public/" But apache show me "C:/xampp/htdocs/index.php"

Here my VirtualHost declaration :

<VirtualHost *:433>
    ServerName myVirtualHost
    DocumentRoot "C:/xampp/htdocs/myApplication/public"
    ErrorLog "logs/myApplication-error.log"
    CustomLog "logs/myApplication-access.log" common
    SSLEngine on
    SSLCertificateFile "C:/xampp/apache/conf/ssl.crt/server.crt"
    SSLCertificateKeyFile "C:/xampp/apache/conf/ssl.key/server.key"
</VirtualHost>

And my "C:\\Windows\\System32\\drivers\\etc\\hosts" declaration :

127.0.0.1 myVirtualHost

Any idea ? Thanks

EDIT : I precise : Include conf/extra/httpd-vhosts.conf is active in "httpd.conf" and work well for all "*80 virtual hosts. Only *443 doesn't work.

Please try to check the file: httpd.conf

Uncomment:

 Include etc/extra/httpd-vhosts.conf

If you uncommented it and set your setting on the httpd-vhosts.conf, please restart.

Here's I know on my practice:

https://github.com/oliguo/Server-Deployment/blob/master/XAMPP.md#ssl-setup-with-xamppauthorized-with-godaddy

NameVirtualHost *:443

<VirtualHost *:443>
    DocumentRoot "/opt/lampp/htdocs/youdomain_A"
    ServerName youdomain_A
    SSLProtocol all -SSLv2 -SSLv3
    SSLCertificateFile "/opt/lampp/etc/ssl.crt/youdomain_A/youdomain_A.crt" ->from godady
    SSLCertificateKeyFile "/opt/lampp/etc/ssl.key/youdomain_A.key"
    SSLCertificateChainFile "/opt/lampp/etc/ssl.crt/youdomain_A/gd_bundle-g2-g1.crt" ->from godaddy
    <Directory "/opt/lampp/htdocs/youdomain_A/">
        Options Includes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog "/opt/lampp/htdocs/youdomain_A/domain_ssl_error_log"
    ErrorDocument 404 https://youdomain_A 
</VirtualHost>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM