Apache Installation Request

I have 2 websites on an Ubuntu 14.04 server with Apache. The websites are in /var/www. I bought a couple of domains from Godaddy. I linked the domain and the IP address of the device.

Say I have abc.com and xyz.com . When a user tries to access abc.com , I need to show him the site under /var/www/abc/index.html and similarly for xyz.com .

I researched and found that /etc/apache2/ has some settings file that I need to change to do this, but I'm not sure what to do. Can someone give me a hint on how I can achieve this?

A detailed answer may be helpful in understanding.

+5
source share
1 answer

So, after many studies, I found the answer to my question. I will talk about the steps that I took to solve it.

  • cd / etc / apache2 / sites-available
  • sudo cp 0 * abc.com.conf
  • sudo nano abc.com.conf
  • sudo a2ensite abc.com.conf
  • sudo service apache2 restart

The content of abc.com.conf should look like the code below and not touch anything.

 <VirtualHost *:80> ServerAdmin admin@abc.com 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> 

Do the same for the following website.

+2
source

Source: https://habr.com/ru/post/1239006/


All Articles