How to Addon Domain in Linux Server(CentOS)?
Step1. Login to the server with SSH access and then install Apache service.
[root@zcom-mm ~] # yum install httpd -y
![](https://support.gmoace.com/wp-content/uploads/2024/02/p1.png)
Step2. Start httpd service.
[root@zcom-mm ~] #systemctl enable httpd
[root@zcom-mm ~] #systemctl start httpd
[root@zcom-mm ~] #systemctl status httpd
![](https://support.gmoace.com/wp-content/uploads/2024/02/p2-1024x129.png)
Step3. Find DocumentRoot Directory
[root@zcom-mm ~] # grep -i 'DocumentRoot' /etc/httpd/conf/httpd.conf
![](https://support.gmoace.com/wp-content/uploads/2024/02/p3-1024x82.png)
Step4. Add Domain under DocumentRoot Directory (“/var/www/html”).
[root@zcom-mm ~] # cd /var/www/html/
[root@zcom-mm ~] # mkdir myanmarlab.online
[root@zcom-mm ~] # ls
![](https://support.gmoace.com/wp-content/uploads/2024/02/p4-1024x87.png)
Step5. Add the testing “web file” in Domain folder.
[root@zcom-mm ~] # vim index.html
![](https://support.gmoace.com/wp-content/uploads/2024/02/p5-1024x44.png)
Add the following sample code.
<html> <h1> Hello, this is myanmarlab.online Domain</h1> </html>
![](https://support.gmoace.com/wp-content/uploads/2024/02/p6-1024x79.png)
And “ Save and Quit”.
View “web file”.
![](https://support.gmoace.com/wp-content/uploads/2024/02/p7-1024x72.png)
Step6. To edit “myanmarlab.online.conf” in “/etc/httpd/conf.d”
[root@zcom-mm ~] # cd /etc/httpd/conf.d
[root@zcom-mm ~] # vim myanmarlab.online.conf
![](https://support.gmoace.com/wp-content/uploads/2024/02/p8-1024x91.png)
Please paste the following code in “myanmarlab.online.conf”.
<VirtualHost *:80> DocumentRoot "/var/www/html/myanmarlab.online" ServerName www.example.com ServerAlias example.com <Directory "/var/www/html/myanmarlab.online"> Options FollowSymLinks AllowOverride All Options -Indexes </Directory> </VirtualHost>
![](https://support.gmoace.com/wp-content/uploads/2024/02/p9-1024x190.png)
“Save” and “Quit”
View “myanmarlab.online.conf” file
[root@zcom-mm ~] # ls
![](https://support.gmoace.com/wp-content/uploads/2024/02/p10-1024x75.png)
Step7. Restart “httpd”
[root@zcom-mm ~] #systemctl restart httpd
![](https://support.gmoace.com/wp-content/uploads/2024/02/p11-1024x51.png)
Step8. Open port number (80) in firewall
[root@zcom-mm ~] #firewall-cmd --zone=public --add-port=80/tcp –permanent
[root@zcom-mm ~] #firewall-cmd –reload
![](https://support.gmoace.com/wp-content/uploads/2024/02/p12-1024x89.png)
Thank you!!!