Create An Alias Web Site – PART 2

Create An Alias Web Site on Apache Web Server

Today, We will discuss how to create an alias web Site on Apache Web Server. Previously article we have seen how to configure a simple web server on RHEL/CENTOS7, refer below link.

Setting up Simple Web Server on RHEL7/Centos7

Steps to configure a Alias web site

1) Create a directory on Document root.

Navigate to the document root i.e “/var/www/html/” and create a directory.

[root@server1 ~]# cd /var/www/html/
[root@server1 html]# mkdir itt
[root@server1 html]# cd itt
[root@server1 itt]# vim index.html

create an Index.html

<html> 
 <body> 
 <h1>Welcome to ITTroubleshooter</h1> 
###### Alias Web Site #### 
</body> 
 </html>

~
~
:wq

Go to ““/etc/httpd/conf.d”” directory, We already created the  “ittroubleshooter.conf” file
Previously and add some lines on bottom, as shown below;
#vim /etc/httpd/conf.d/ittroubleshooter.conf

<VirtualHost 192.168.1.10:80>
ServerAdmin     root@ittroubleshooter.in
DocumentRoot    /var/www/html
ServerName      server1.ittroubleshooter.in
alias    /itt      /var/www/html/itt
Errorlog        logs/server1.ittroubleshooter.in-error_log
CustomLog       logs/server1.ittroubleshooter.in-access_log common
</VirtualHost>
                                                                               
~                                                                               
~               
:wq

2) Restart the httpd Service.

[root@server1 ~]# systemctl restart httpd
[root@server1 ~]#

3) Open the firefox web browser and type the following url.

httpd_alias_ittroubleshooter-in

To open the website from command line use the following command.

#elinks  www.ittroubleshooter.in/itt

Hope this post will help Linux/Unix beginners. Please share you feedback and Comments.!!!

Read Also

Redirect the Website on Apache Web server

Port based hosting on Apache Web server

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz