实验步骤
1、安装httpd软件包
(1)解压缩文件
[root@centos01 ~]# tar zxvf /mnt/httpd-2.2.17.tar.gz -C /usr/src
(2)配置apache
进入目录
[root@centos01 ~]# cd /usr/src/httpd-2.2.17/
配置
[root@centos01 httpd-2.2.17]# ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-line --enable-cgi
(3)编译apache
[root@centos01 httpd-2.2.17]# make
(4)安装
[root@centos01 httpd-2.2.17]# make install
(5)检查暗战是否安装完成
[root@centos01 httpd-2.2.17]# ls -ld /usr/local/httpd
drwxr-xr-x 15 root root 175 10月 27 22:52 /usr/local/httpd
2、配置并启动httpd服务
(1)优化程序执行目录
[root@centos01 ~]# ln -s /usr/local/httpd/bin/* /usr/local/bin
(2)生成aapache服务,服务名字httpd
[root@centos01 ~]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
(3)添加执行权限
[root@centos01 ~]# chmod +x /etc/init.d/httpd
(4)修改apache服务的控制文件
[root@centos01 ~]# vim /etc/init.d/httpd
#!/bin/sh
#chkonfig:35 80 21
#Description:Apache Server
(5)添加为系统服务
[root@centos01 ~]# chkconfig --add httpd
(6)设置httpd开机自启
[root@centos01 ~]# chkconfig --level 35 httpd on
(7)配置httpd服务
[root@centos01 ~]# vim /usr/local/httpd/conf/httpd.cof
创建httpd.conf.bak
cp /usr/local/httpd/conf/httpd.conf /usr/local/httpd/conf/httpd.conf.bak
修改为www.bdqn.com
#ServerName www.www.example.com:80
ServerName 192.168.100.10:80
客户端访问
linux web服务
最新推荐文章于 2024-06-18 15:36:51 发布