說明:
當一個網站目錄特別長時,例:http://www.tarena.com/china/hebei/bbs,我們可以給它起個別名來代替這個長的名字。
步驟:
1. 搭建Apache Http網站服務平臺
yum -y install httpd* (默認站點目錄/var/www/html)
- 創建測試站點
[root@localhost ~]# mkdir -p /var/www/html/china/hebei/bbs
[root@localhost ~]#vim /var/www/html/china/hebei/bbs /index.html
<html>
<head><title>This is a Alias test Page!!!</title>
<body>
<h1>This is a bbs Bie Ming test Page!!!</h1>
</body>
</head>
</html> - 修改主配置文件
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
Alias /bbs "/var/www/html/china/hebei/bbs" //在配置文件中添加此語句 - 啓動服務測試
[root@ser1 ~]# service httpd restart
http://www.tarena.com/china/hebei/bbs
http://www.tarena.com/bbs