i'm working on a server that i inherited from someone, and i'm not a big expert on dns issues. the server hosts more than one domains, and they are all under a folder called /vhosts/. i can't seem to understand how domains are pointing to their respective folder there. i checked httpd.config and there is no directive like this:
<VirtualHost *>
ServerName www.domain.tld
DocumentRoot /www/domain
</VirtualHost>
i also checked the domain admin and they are all pointing to the server ip. so what am i missing?
DocumentRoot
is the directive which tells the folder name for a specific hosted domain. For each domain which is hosted on the server, there will be one <VirtualHost>
node in the httpd.conf
file. So for example, example1.com and example2.com are hosted on this server and their requests are served from /vhosts/www/example1 and /vhosts/www/example2 respectively.
<VirtualHost *>
DocumentRoot /vhosts/www/example1
ServerName www.example1.com
# Other directives here
</VirtualHost>
<VirtualHost *>
DocumentRoot /vhosts/www/example2
ServerName www.example2.org
# Other directives here
</VirtualHost>
Sometimes these settings are defined in other config files. Other config files are included in httpd.conf during startup. If you are unable to find the file that has it then I would suggest that you run
grep -ri "VirtualHost" /
.
The system could be configured for mass virtual hosting:
Alternately, the configurations for the virtual hosts could be declared in included files brought in through an Include statement. Check the httpd.config
for Include statements to other vhosts ...
if all else fails, go to the root of the configuration directory and run the following:
sudo grep -Ri www.domain.tld .
Should give you a hint where to look ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With