Link to home
Start Free TrialLog in
Avatar of SheppardDigital
SheppardDigital

asked on

Apache virtualhost not working

Hi,

I recently setup a server in our office running centos 6, apache, php, mysql and I've installed webmin.

Up to now it's just been running a site from the standard document root of apache, but last night I tried to setup up a virtual host, first in webmin. The domain name I was using points to the server, but I just get the servers default page. I've tried editing the httpd.conf file manually but even then I can't get the apache to server the folder I want it to server.

Just incase I've set apache as the group and owner of the folder.

I've attached a snipped of my httpd.conf file.

If I uncomment the line;
NameVirtualHost 192.168.24.132:80
I get the following error when I restart apache
[warn] NameVirtualHost 192.168.24.132:80 has no VirtualHosts

Does anyone know why apache wouldn't be serving the site for that specific domain?


#NameVirtualHost 192.168.24.132:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier 
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

<VirtualHost mydomain.com>
	DocumentRoot "/var/www/hosts/mydomain.com"
	ServerName mydomain.com
	<Directory "/var/www/hosts/mydomain.com">
	allow from all
	Options +Indexes
	</Directory>
</VirtualHost>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of SheppardDigital
SheppardDigital

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SheppardDigital
SheppardDigital

ASKER

Managed to resolve this issue myself