Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have been trying to configure virtual servers to my websites without any luck. I'm running on Debian 2.6.32 on a VPS. I have configured the virtual servers with many configurations and have left it relatively simple for testing (I only enabled epicbackroads.com). Here are my three virtual hosts:

<VirtualHost *:80>
DocumentRoot "/srv/www/epicbackroads.com/public_html"
ServerName epicbackroads.com
<Directory "/srv/www/epicbackroads.com/public_html">
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin admin@domain2.com
    ServerName johnpwarren.com
DocumentRoot /srv/www/domain2.com/public_html
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /srv/www/domain2.com/public_html/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

and here is my /etc/hosts file:

fe00::0     ip6-localnet
ff00::0     ip6-mcastprefix
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters

127.0.0.1 localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
208.84.135.70 serv1.epicbackroads.com  serv1
208.84.135.70 epicbackroads.com epicbackroads
208.84.135.70 johnpwarren.com   johnpwarren
208.84.135.70 voip.johnpwarren.com voip.johnpwarren
::1     localhost ip6-localhost ip6-loopback

and /etc/resolv.conf:

search epicbackroads.com
nameserver 8.8.8.8
nameserver 8.8.4.4

as well as a curl check:

# curl -I epicbackroads.com
HTTP/1.1 200 OK
Date: Mon, 27 May 2013 09:16:40 GMT
Server: Apache/2.2.16 (Debian)
Last-Modified: Mon, 27 May 2013 05:05:00 GMT
ETag: "32237e0-4f-4ddac173588f2"
Accept-Ranges: bytes
Content-Length: 79
Vary: Accept-Encoding
Content-Type: text/html
X-Pad: avoid browser bug
</VirtualHost>

However, browser continues to throw an error "Server cannot be found". What else should I be looking into?

UPDATE: Also, I ran telnet and received this:

telnet 208.84.135.70 80
Trying 208.84.135.70...
Connected to 208.84.135.70.
Escape character is '^]'.
Connection closed by foreign host.
share|improve this question

1 Answer 1

up vote 0 down vote accepted

The Apache configuration you posted is incomplete or invalid altogether.

The 2nd Virtual Host has a syntax error (missing '<')

VirtualHost *:80>

and it does never close. Missing:

</VirtualHost>

Also you are missing ServerName on each Virtual Host. https://httpd.apache.org/docs/current/mod/core.html#servername

Apache will not know which Virtual Host to serve and will default to the first in the configuration.

Apart from that, the issue with epicbackroads.com seems to be your DNS configuration. epicbackroads.com does not resolve to any IP address.

You server can resolve the domain because you have manually configured it on the /etc/hosts file but your PC cannot resolve this domain so it won't load anything.

share|improve this answer
    
I apologize for my poor pasting, I have fixed it above. I have pointed the nameservers to my new host and have updated the A records to point to the IP I was given. Is there something that I'm missing? –  John Warren May 27 '13 at 10:11
    
The domain does not return any IP back. And if I try to resolve www.epicbackroads.com it returns 'server error'. Are the DNS zones hosted on your server? –  Cha0s May 27 '13 at 10:27
1  
No, the zones are not hosted directly on my vps. I am using the nameservers of the host as well as their dns configuration found in the customer management area. I changed the A record of the domains to the IP of the server. –  John Warren May 27 '13 at 10:30
    
It looks ok now. I can properly resolve the domain and a page with a 'EpicBackRoads'message loads now. –  Cha0s May 27 '13 at 10:31
    
Ok, so it wasn't my fault then. Unless my webhost fixed it for me. Yep just confirmed that I didn't input the A record correctly. I put in the server name and thought I had to put the full one, but was just prepending it to the root of the domain. –  John Warren May 27 '13 at 10:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.