启动用户的个人网页(centos 5.2下)
1.创建test用户
*********略*********
2.创建public_html目录
# mkdir /home/test/public_html
3. 修改相关目录的访问权限
# chmod -R 755 /home/test/
4. 修改httpd.conf配置文件如下:
#**************************** 略************************************
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
# See also:
#
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#UserDir disable
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
UserDir public_html
#******************************略*************************
5. 重启httpd服务
# /etc/rc.d/init.d/httpd restart
6. 在/home/test/public_html目录下建立一个名为index.html的网页文件。
6. 测试
在浏览器上输入:
http://你的网站名称/~test/index.html
即可。
7. 那么如何去掉上面的"~"符号呢,有如下几个方法:
1. 建立连接文件
# ln -s /home/test/public_html /var/www/html/test
2.建立alias
# vi /etc/httpd/conf/httpd.conf
Alias /test/ "/home/test/public_html/"
********************
# /etc/rc.d/init.d/httpd restart
此时在浏览器下输入
http://你的网站名称/test/index.html
ok了。
阅读(652) | 评论(0) | 转发(0) |