It exists in the httpd.conf file in the/etc/httpd/conf/directory,
Its defined syntax format is Alias/url "Local_path"
The idea is to map a long path with a simple path:
As shown in the figure, the path to the/icons/map is "/var/www/icons/"
Example:
[Root@cyz ~]# mkdir-pv/bbs/forum //create path
mkdir:created directory '/bbs ' mkdir:created
directory '/bbs/ Forum '
[root@cyz ~]# cd/bbs/forum/
[root@cyz forum]# vim index.html //Create a home page for it and add information to it, roughly
//lujing bieming– observation
[Root@cyz forum]# vim/etc/httpd/conf/httpd.conf//edit inside,
//plus path alias Alias/luntan "/bbs/forum"
//need to be aware that there should be a diagonal line after/luntan with
///"//bbs/forum" and that there should exist at the same time
[root@cyz forum]# service httpd restart // Restart Network Service
stopping httpd: [OK]
starting httpd: [OK]
[Root@cyz forum]#
Then open the browser input 172.16.111.1/luntan view the content,
2. Virtual Host
First, let's separate the classes for the virtual host:
Virtual Host:
IP based virtual host;
Port based virtual host;
Domain-based virtual host;
The virtual host is defined in the following format:
<virtualhost host>
</VirtualHost>