Link to home
Start Free TrialLog in
Avatar of fworld
fworld

asked on

Where are the virtual hosts setup? not where I exspected

I've been tasked with adding a new domain to a server. I've done this before, usually I go to httpd.conf and add a new virtual host. My problem is that I can't figure out where the existing virtual hosts are configured. They aren't in /etc/apache/httpd.conf like I expected. I can't figure out where else the virtual host configuration would be. Any suggestions?

Avatar of mhequipit
mhequipit
Flag of United States of America image

Are you running apache on Windows or Linux?  If linux which version?
Avatar of fworld
fworld

ASKER

it is linux, Debian 2.6.8-2-686

httpd -v isn't working to get the version of apache though...
Avatar of fworld

ASKER

I didn't make this clear but there IS a /etc/apache/httpd.conf file. The existing sites on the server aren't configured in there though.
ASKER CERTIFIED SOLUTION
Avatar of mhequipit
mhequipit
Flag of United States of America image

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
> They aren't in /etc/apache/httpd.conf like I expected.

There must be more configuration files then -- look for an 'include' statement in httpd.conf.
Debian right?

check:
 /etc/httpd/sites-enabled/*
or
 /etc/apache/sites-enabled/*
or
 /etc/apache2/sites-enabled/*
run 'apache2 -S'. You don't have to be root to do so. It will give you all configured virtual hosts and the config files they are configured in. Also tests your configuration.
I think that you are looking for configuration file of hosts.

if so, you can find the configuration file on apache2 under
/etc/apache2/sites-available
/etc/apache2/sites-enabled
in this two folder you can find rispectly the available configuration file of hosts and the Enabled configuration file of hosts.

The folder is populated with 1 file for each host that you configure in your apache.

Apache2 import any file that can be found in /etc/apache2/sites-enabled directory.

If you need to disable an host you can move the configuration file from sites-enabled folder to site-available folder, and viceversa for enable an host, making so you doesn't loose you configuration.

Make me know if the information is correct for you, and if you need other information.
Alessandro

Is this working now?