Apache httpd.conf help answer a question please

I would be ashamed to admit how much time I have wasted on this “simple” issue. :x

I was able to install a SSL cert and get it working with no browser warnings, but I can’t even use tutorials to figure this basic problem out:

<VirtualHost 101.9.xx.50:80>
DocumentRoot "/var/www/html/domain.com"
ServerName www.domain.com
ServerAlias domain.com *.domain.com
<Directory "/var/www/html/domain.com">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

Result: http://www.domain.com/ does not work at all:
“Server not found”


<VirtualHost domain2.com:80>
DocumentRoot "/var/www/html/domain2.com"
ServerName domain2.com
ServerAlias www.domain2.com *.domain2.com
<Directory "/var/www/html/domain2.com">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

http://www.domain2.com/ does not work at all:
“Server not found”

<VirtualHost *:80>
DocumentRoot "/var/www/html/domain3.com"
ServerName domain3.com:80
ServerAlias www.domain3.com *.domain3.com
</VirtualHost>

http://www.domain3.com/ does not work at all:
“Server not found”

<VirtualHost domain4.com:80>
DocumentRoot "/var/www/html/domain4.com"
ServerName domain4.com:80
ServerAlias www.domain4.com *.domain4.com
</VirtualHost>

http://www.domain4.com/ does not work at all:
“Server not found”

I could post 15 more variations and none of them work… :nono:
This cannot possibly be so hard, what am I doing wrong?
Thank you.

^^^
EDIT:
No longer getting any errors when restarting Apache and www.domain.com still doesn’t work.

g181,

What you failed to say is whether this is on your own test server or online. If the former, you should NOT be using a valid domain name as your computer SHOULD interpret any request for that as wanting the ONLINE (hosted) version as you’ve NOT changed your hosts file (at least that’s not evident by your post). If not (localhost), then have a look at your DNS as that needs to have both the www’d version and non-www version to work with both.

Regards,

DK

Online with a newer VPS / My older VPS has Direct Admin; This time I’m learning to do things without a crutch.
(Now no longer wondering why the Apache “virtual host” tutorials were not fixing the issue)

Exactly :slight_smile:
You were 100% correct, thank you so much dk.

g181,

Whew! I’d have to go look at my DNS settings if you hadn’t resolved that on your own!

Regards,

DK