LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 991|回复: 6

一次创建100个用户,并开启他们的web服务-开启个人网站的方法

[复制链接]
发表于 2005-2-28 10:32:51 | 显示全部楼层 |阅读模式
1。修改/etc/httpd/conf/httpd.conf ,使支持用户网站
    vi   /etc/httpd/conf/httpd.conf
    找到mod_userdir...段,修改如下:
    UserDir   disable --> UserDir   disable   root
    找到<Directory   /home/*/public_html>
          ..........
         </Directory>
    将注释全部去掉

2。重新启动服务器
     #service httpd restart

3.创建100个用户,用户名为stu..,组为student
   #groupadd  student;\
    >for  i  in  $(1 100);  do \
    >useradd  -g   student   stu$i ;\
    >echo  stu$i  |  passwd  --stdin stu$i  ;\
    >mkdir  /home/stu$i/public_html;\
    >touch  /home/stu$i/public_html/index.html;\
    >echo   "This  is "  stu%i   Homepage >/home/stu$i/public_html/index.html;\
     >chown  -R  stu$i.student  /home/stu$i; chmod   -R  755  /home/stu$i
    >done
4.测试用户网站
    http://IP/~stu1/
发表于 2005-2-28 18:14:28 | 显示全部楼层
[error] [client 192.168.30.22] File does not exist: /var/www/html/stu1
不行哦~不会去HOME里面找文件~~
回复 支持 反对

使用道具 举报

发表于 2005-3-1 22:08:25 | 显示全部楼层

  1. Forbidden
  2. You don't have permission to access /~adn/index.html on this server.

  3. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

复制代码

现在变成这样了~~什么事呀~~!!!!
回复 支持 反对

使用道具 举报

发表于 2005-3-2 11:35:34 | 显示全部楼层
使用url重写机制比较好,可以实现。
回复 支持 反对

使用道具 举报

发表于 2005-3-17 21:00:37 | 显示全部楼层
有人可以回答我一下吗、
回复 支持 反对

使用道具 举报

发表于 2005-3-18 12:34:32 | 显示全部楼层
Post by jd_chen
有人可以回答我一下吗、


问题出在个人用户的主目录的权限上。
个人用户的主目录其他的用普通用户是无法访问的,当然也包括http方式访问。如果你想你的 apache支持个人用户的http 访问,除了如楼主所说的那样之外,还要
所有人都能访问你的目录中的文件的权限

相信我,去试试看,会行的!
如果问题解决,请回复告知我一声
回复 支持 反对

使用道具 举报

发表于 2005-3-18 20:15:43 | 显示全部楼层
我已经CHOMD 755文件夹了~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表