I have 2 websites on a Ubuntu 14.04 Server with Apache. The websites lie in /var/www.
I have bought a couple of domains from Godaddy. I have linked the domain and the machine's IP.
Lets say I have abc.com and xyz.com. When a user tries to access abc.com, I need to show him the website under /var/www/abc/index.html
and similarly for xyz.com.
I researched and found that under /etc/apache2/
there is some settings file I need to change in order to do it but I am not sure what to do. Could anybody give me a hint on how I can achieve this?
A detailed answer can be lot helpful for understanding.
So after a lot of research, I have found the answer to my question. I will share the steps I did to solve it.
The contents of abc.com.conf should be something similar to below code and don't touch anything else.
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName abc.com
ServerAlias www.abc.com
DocumentRoot /var/www/abc/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Similarly do so for the next website also.
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