The Apache web server is the most popular way of serving web content on the internet. It accounts for more than half of all active websites on the internet and is extremely powerful and flexible. Apache breaks its functionality and components into individual units one of basic unit that describes an individual site or domain is called a virtual host.These designations allow the administrator to use one server to host multiple domains or sites off of a single interface or IP by using a matching mechanism. This is relevant to anyone looking to host more than one site off of a single VPS. Each domain that is configured will direct the visitor to a specific directory holding that site's information, never indicating that the same server is also responsible for other sites. This scheme is expandable without any software limit as long as your server can handle the load. In this guide, you will learn to setup Apache vitural host on Ubuntu 16.04. You will also need to have Apache installed and non-root user. You can look at card in upper right corner how can you achieve that.
I used two domains to nipone and niptwo. You can change in whatever domin you want. Let's go.
Commands:
sudo mkdir -p /var/www/nipone.xyz/public_html
sudo mkdir -p /var/www/niptwo.xyz/public_html
sudo chown -R $USER:$USER /var/www/nipone.xyz/public_html
sudo chown -R $USER:$USER /var/www/niptwo.xyz/public_html
sudo chmod -R 755 /var/www
nano /var/www/nipone.xyz/public_html/index.html
cp /var/www/nipone.xyz/public_html/index.html /var/www/niptwo.xyz/public_html/index.html
nano /var/www/niptwo.xyz/public_html/index.html
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/nipone.xyz.conf
sudo nano /etc/apache2/sites-available/nipone.xyz.conf
sudo cp /etc/apache2/sites-available/nipone.xyz.conf /etc/apache2/sites-available/niptwo.xyz.conf
sudo nano /etc/apache2/sites-available/niptwo.xyz.conf
sudo a2ensite nipone.xyz.conf
sudo a2ensite niptwo.xyz.conf
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
----------------------
Music by Joakim Karud soundcloud.com/joakimkarud
You can always Deploy an SSD cloud server in 55 seconds
with Digitalocean.
Anyone how use this link will receive $10 in hosting credit immediately after unlocking their account by adding a valid payment method.
Sign Up with this link
https://m.do.co/c/7b9082af029f