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.

Sorry that is a horrible thread subject, but I cannot think of a better more descriptive subject.

We are running a Fedora 11 server that is currently hosting some CRM on it. I want to use a VirtualHost directive to add another site to the server.

So I created this conf:

/etc/httpd/conf.d/mysite.ourdomain.com.conf

And here is the content:

<VirtualHost *:80> 
ServerName mysite.ourdomain.com 
DocumentRoot /www/mysite 
ServerAdmin webmaster@ourdomain.com 
ErrorLog /var/log/mysite.ourdomain.com-error.log 
CustomLog /var/log/mysite.ourdomain.com-access.log common 
</VirtualHost>

I restarted apache, getting the following warning:

[warn] NameVirtualHost *:80 has no VirtualHosts

From what I read, this warning is not related and I can ignore it and my site should still be up and running, correct? (I'll troubleshoot this error later if so)

Well I have our DNS server setup to point mysite.ourdomain.com to goto this server. I can ping it and it points to the correct LAN IP, etc.. Now when I try to access it in the browswer I get nothing. It just says Connecting... and never gets there. If I try mysite.ourdomain.com or the IP address, neither one doesn't get there.

It's a very simple and basic apache setup so I'm not sure what I'm doing wrong...

Like I said, the other thing that is running on this server is a crm and it's .conf looks something like this:

Listen x.x.x.x:443 
<VirtualHost x.x.x.x:443> 
ServerAdmin it@ourdomain.com 
ServerName crm.ourdomain.com 
ErrorLog /var/log/httpd/ourdomain/crm-error.log 
CustomLog /var/log/httpd/ourdomain/crm-access.log common 
DocumentRoot /www/ourdomain/crm 
<IfModule mod_dir.c> 
DirectoryIndex /index.php 
</IfModule> 
</VirtualHost> 

There is also some LDAP authentication stuff in that config but I left it out cause I assumed it wasn't necessary to post.

Anyone have any clue where I should start or what settings I can post from httpd.conf that would help?

share|improve this question
add comment

2 Answers

This <VirtualHost *:80> should be <VirtualHost mysite.example.com:80>

share|improve this answer
    
That didn't make a difference. Any other ideas? –  Jakobud Apr 1 '10 at 16:10
    
@Jakobud, Try what Joe said in his answer, there should be an include statement somewhere in the httpd.conf file. –  Chris S Apr 1 '10 at 17:17
    
Yup, the include is already there. It's obviously working because the CRM that is also running on this server is declared in a .conf and it's getting picked up just fine. –  Jakobud Apr 1 '10 at 19:13
add comment

It really sounds like that file is not getting included. Is the line in /etc/httpd/conf/httpd.conf that says Include conf.d/*.conf commented-out?

Try moving your directives into the main configuration file (/etc/httpd/conf/httpd.conf) and see if it works.

Make sure that your: NameVirtualHost *:80 matches the directive exactly. I've seen cases where a copy-and-paste from an example website got screwed up due to character encoding of the white space.

share|improve this answer
    
I see Include /etc/httpd/conf.d/*.conf in httpd.conf and it is not commented out. And what do you mean regarding the NameVirtualHost? In httpd.conf near the bottom I see NameVirtualHost *:80. Is that supposed to say NameVirtualHost mysite.mydomain.com:80 ? –  Jakobud Apr 1 '10 at 17:40
    
If your directive starts with <VirtualHost mysite.ourdomain.com:80>, you need to have NameVirtualHost mysite.ourdomain.com:80. Did you try moving those directives into the main apache configuration file, to see if it started working? –  Joe Apr 1 '10 at 18:33
    
Ya I moved it in there w/o any luck. In httpd.conf I changed NameVirtualHost *:80 to NameVirtualHost mysite.ourdomain.com:80 and then the directive at the bottom of httpd.conf is <VirtualHost mysite.ourdomain.com:80> –  Jakobud Apr 1 '10 at 19:12
    
You didn't mention whether this host is already serving websites on port 80. Do you have a Listen <ip address of mysite.ourdomain.com> somewhere in your apache configuration file, like you do for the SSL site? Check your /etc/hosts file, as well, to ensure that the hostname mysite.ourdomain.com doesn't resolve to 127.0.0.1. I always put the FQDN of the server ad it's IP address on a separate line in /etc/hosts. Also check to ensure that your iptables firewall is allowing access to port 80. /sbin/iptables --list –  Joe Apr 1 '10 at 21:45
1  
aha! That usually means that some other web server is listening on port 80. Try this to see what program is listening on that port. netstat -plan | grep LISTEN | grep 80. The last column will list the PID and the name of the offending daemon/program like so 8265/httpd –  Joe Apr 1 '10 at 23:13
show 3 more comments

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.