0

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?

Jake Wilson
  • 8,814
  • 29
  • 97
  • 125

2 Answers2

0

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

Chris S
  • 77,945
  • 11
  • 124
  • 216
  • That didn't make a difference. Any other ideas? – Jake Wilson Apr 01 '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 01 '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. – Jake Wilson Apr 01 '10 at 19:13
0

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.

Joe
  • 1,775
  • 15
  • 23
  • 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 ? – Jake Wilson Apr 01 '10 at 17:40
  • If your directive starts with ``, 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 01 '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 `` – Jake Wilson Apr 01 '10 at 19:12
  • You didn't mention whether this host is already serving websites on port 80. Do you have a `Listen ` 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 01 '10 at 21:45
  • I know I'm rambling, but I'm trying everything I can think of that I would try if it were my server. – Joe Apr 01 '10 at 21:45
  • `/etc/hosts` is system default. No issues there. `iptables` doesn't show anything about blocking port 80. I added `Listen – Jake Wilson Apr 01 '10 at 21:51
  • 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 01 '10 at 23:13
  • The only process is shows that is using port 80 is the very httpd process that I'm starting and stopping. My next try is to just disable or move all the .conf's out of /etc/httpd/conf.d/ and add them back in one at a time to see which one is screwing this up. – Jake Wilson Apr 04 '10 at 02:45