0

I've installed apache (and php etc) via chocolatey but after enabling my VirtualHosts, requests to it still shows the default site.

Here's what I did step by step:

First I uncommented the line here in httpd.conf:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

in conf/extra/httpd-vhosts.conf, I have this:

<VirtualHost *:80>
    ServerAdmin webmaster@goco8.local
    DocumentRoot "C:/sites/goco8/public"
    ServerName goco8.local
    ServerAlias www.goco8.local

    <Directory "C:/sites/goco8/public">
        AllowOverride All
        Require all granted
        Options Indexes FollowSymLinks
    </Directory>
    ErrorLog "logs/goco8.dev-error.log"
    CustomLog "logs/goco8.dev-access.log" common
</VirtualHost>

I added the following to the hosts file on my system:

127.0.0.1    goco8.local

Ran Restart-Service apache and pointed chrome to https://goco8.local

aaaand, bam! the boring default site.

apache access log says:

127.0.0.1 - - [28/Aug/2022:05:24:11 +0200] "\x16\x03\x01\x02" 400 226

Nothing interesting in the errors.log

I ran httpd -t and it says "syntax OK"

Here's the output of 'httpd.exe -S':

VirtualHost configuration:
*:80                   goco8.local (C:/Users/pette/AppData/Roaming/Apache24/conf/extra/httpd-vhosts.conf:40)
*:443                  localhost (C:/Users/pette/AppData/Roaming/Apache24/conf/extra/httpd-ahssl.conf:142)
ServerRoot: "C:/Users/pette/AppData/Roaming/Apache24"
Main DocumentRoot: "C:/Users/pette/AppData/Roaming/Apache24/htdocs"
Main ErrorLog: "C:/Users/pette/AppData/Roaming/Apache24/logs/error.log"
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="C:/Users/pette/AppData/Roaming/Apache24/logs/" mechanism=default
Mutex ssl-stapling-refresh: using_defaults
PidFile: "C:/Users/pette/AppData/Roaming/Apache24/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: SRVROOT=C:/Users/pette/AppData/Roaming/Apache24
Define: ENABLE_TLS13=Yes

Googled a lot, couldn't find anything :\

What's wrong?

Thanks in advance :)

Petter Thowsen
  • 463
  • 1
  • 6
  • 16
  • your virtualhost is listen on port 80 so your should reach it with http not https – Lety Aug 28 '22 at 11:01
  • Yeah that was it. The second answer on this question helped me: https://stackoverflow.com/questions/62057148/virtual-host-not-working-on-xampp-something-very-strange-happenning – Petter Thowsen Aug 28 '22 at 12:06
  • See answer #2 on https://stackoverflow.com/questions/62057148/virtual-host-not-working-on-xampp-something-very-strange-happenning – Petter Thowsen Aug 28 '22 at 12:06

0 Answers0