I have to domains pointing towards the same IP.
What I wish to do is:
When visited by domain_name1,make document_root:/usr/local/apache/htdocs1
when visited by domain_name2,make document_root:/usr/local/apache/htdocs2
how to get this done job?
(Note: this should certainly continue ServerFault)
What you would like to attain is called name-based virtual hosting.
Illustration of this in the recommended page:
NameVirtualHost *:80 <VirtualHost *:80> ServerName www.domain.tld ServerAlias domain.tld *.domain.tld DocumentRoot /www/domain </VirtualHost> <VirtualHost *:80> ServerName www.otherdomain.tld DocumentRoot /www/otherdomain </VirtualHost>