学学习网 手机版

学学习网

学习路径: 学习首页 > Internet > 操作系统 >

第十九章 Linux的Apache服务器(6)

设置字体:
----------------------------------

         # rpm  -ivh  vsftpd-1.1.3-8.i386.rpm    (3# CD)
         # cp /etc/vsftpd/vsftpd.conf /backup/
         # vi /etc/vsftpd/vsftpd.conf 
修改如下:
           anonymous_enable =NO
           local_enable =YES
           guest_enable =NO
           write_enable =YES
           chroot_local_user =YES
           userlist_enable =YES
           userlist_deny =NO
           listen =YES
         # vi /etc/vsftpd.user_list( 将该文件中的用户名全部屏蔽,在文件尾部添加)
           user1
           user2
   (4)配置Apache
         # rpm –ivh httpd-2.0.1-10.i386.rpm (2# CD)
         # rpm  -ivh http-devel-2.0.1-10.i386.rpm
         # cp /etc/httpd/conf/httpd.conf /backup/
         # vi /etc/httpd/conf/httpd.conf
 修改如下:
            UserDir public_html
<Directory /home/*/public_html>
 AllowOverride  FileInfo  AuthConfig  Limit
 Options MultiViews Indexes  SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
   Order allow,deny
Allow from all
  </Limit>
 <LimitExcept GET POST OPTIONS>
   Order deny,allow
   Deny from all
 </LimitExcept>
</Directory>
DirectoryIndex  index.html  index.html.var
         # mkdir /home/user1/public_html
         # mkdir /home/user2/public_html
         # vi /home/user1/public_html/.htaccess
           AuthType Basic
           AuthName “Enter username,please”
           AuthUserFile /backup/password
           Require user user1
         # vi /home/user2/public_html/.htaccess
           AuthType Basic
           AuthName “Enter username,please”
           AuthUserFile /backup/password
           Require user user2
         # vi /home/user1/public_html/index.html
         # vi /home/user2/public_html/index.html
  # htpasswd –c /backup/password user1
    # htpasswd –c /backup/password user2
 (5)解决权限的问题
  # chmod 711 /home/user1
    # chmod 711 /home/user2
    # chown user1 /home/user1/public_html
    # chown user2 /home/user2/public_html
    # chmod 755 /backup/password
(6)启动服务
    # service vsftpd start
    # apachectl configtest
    # service httpd start
 (7)测试服务
    在客户机的浏览器上输入 http://www.xuexuexi.com 即可打开user1的个人主
         页,当然了,要输入用户名和密码的;user1用户可以自行上传主页文件;
----------------------------------
课程列表
重点难点
赞助链接