Redhatlinux9中的Ap
在red hat9中自带了apache2。0
1。httpd:apache2。0
2。httpd-manual:apache2。0手册
下面是安装apache2。0方法
//查看系统是否安装了apache
#rpm -qa|grep httpd
//apache进程名为httpd
//将red hat linux 9的第一个光盘放到光驱后挂装
#moint /mnt/cdrom
//进入光盘red hat /RPM目录
#cd /mnt/cdrom/RED HAT/RPMS
//安装所需的RPM包
#rpm -ivh httpd -2。 0。40-21。i386。rpm
#rpm -iv...全部
在red hat9中自带了apache2。0
1。httpd:apache2。0
2。httpd-manual:apache2。0手册
下面是安装apache2。0方法
//查看系统是否安装了apache
#rpm -qa|grep httpd
//apache进程名为httpd
//将red hat linux 9的第一个光盘放到光驱后挂装
#moint /mnt/cdrom
//进入光盘red hat /RPM目录
#cd /mnt/cdrom/RED HAT/RPMS
//安装所需的RPM包
#rpm -ivh httpd -2。
0。40-21。i386。rpm
#rpm -ivh httpd-manual-2。0。40-21。i386。rpm
//弹出光盘
#cd;eject
安装光盘后启动apache服务器
//立即启动
#service httpd start
//检测httpd是否被启动
#pstree|grep httpd
|-httpd---8*[httpd]
//表示已经启动
//可以用如下的命令查看运行的状态
#service httpd status
httpd (pid 1880 1879 1878 1877 1878 1877 1876 1875 1874 1873 1870) is running。
。。。。
//出现以上类型的提示表示, apache 正在运行
#cd /var/www/html
#mkdir private
#cd private
#touch test
//修改主配置文件
#vi /etc/httpd/conf/httpd。
conf
//将/var/www/html/private 目录访问权限设为
//允许在。httaccess文件中使用认证和授权指今
AllowOverride AuthConfig
//创建认证的口令文件
#mkdir /var/www/passwd
#cd /var/www/passwd
#htpasswd -c xuhuilong xuhuilong 注意:这个地方的第一个xuhuilong是文件名
第二个的xuhuilong是用户名 这两个名字的相同也行 不同也行
New passwd :
Re-type new password:
Adding password for user userxuhuilong
#
//将认证的口今文件的属主改为apache
#chown apache。
apache xuhuilong
#service httpd restart
这样apache服务器就重新启动了
//在/var/www/html/private目录下生成。htaccess 文件
#cd /var/www/html/private
#vi 。
htaccess
//添加下面内容
AuthType Basic
AuthName "xuhuilong"
AuthUserFile /var/www/passwd/xuhuilong
这里的xuhuilong是文件名
require vliad-user或xuhuilong都行
这里的xuhuilong是用户名xuhuilong。
收起