1.使用光盘:
先挂载、再使用:
mkdir /mnt/guangpan //新建挂载点
monut -t iso9660 /dev/cdrom /mnt/guangpan/ 挂载
2.安装网络服务(Apache):
cd /mnt/guangpan //进入光盘
cd Server
ls | grep httpd //查找网络服务包
rpm -ivh httpd-2.2.3-11.e15_1.3.i386.rpm //安装网络服务
service httpd start //开启服务
3.用户认证:
命令:
useradd xpf
(查看用户目录:/home)
cd /usr/local
mkdir myfiles //
htpasswd -c /etc/httpd/myfilespwd xpf //生成用户xpf访问密码
vim /etc/httpd/conf/httpd.conf//编辑Apache配置文件
:set number //设置行号
:/Alias //在配置文件中查找带有Alias字样的内容
{
8yy——从当前光标处复制8行
p——粘贴
}
添加目录myfiles记录:
Alias /myfiles/ "/usr/local/myfiles/"
<Directory "/usr/local/myfiles">
AuthType Basic
AuthName "This is my first file, Login:"
AuthUserFile "/etc/httpd/myfilespwd"
Require user xpf
</Directory>
重启网络服务
service httpd restart
访问:
http://10.99.99.21/myfils/