部署Apache服务

来源:互联网 发布:租人网软件下载 编辑:程序博客网 时间:2024/05/10 11:00

[root@localhost ~] # yum install wget

[root@localhost ~] # yum install gcc

下载:

[root@localhost ~] # wget http://apache.communilink.net//httpd/httpd-2.2.27.tar.gz

解包:

[root@localhost ~]#  tar zxvf httpd-2.2.27.tar.gz

切换目录:

[root@localhost ~] # cd httpd-2.2.27

配置apache路径:

[root@localhost httpd-2.2.27]# ./configure -prefix=/usr/local/apache -enable-so -enable-rewrite -with-mpm=worker

编译apache:

[root@localhost  httpd-2.2.27] # make

安装apache:

[root@localhost  httpd-2.2.27] # make install

进入apache下conf目录

[root@localhost  httpd-2.2.27] # cd /usr/local/apache/conf

备份apache配置文件

[root@localhost conf]# cp -a httpd.conf httpd.conf-

修改httpd.conf文件内容

[root@localhost conf]# vi httpd.conf

找到#ServerName www.example.com:80

去掉注释并修改为 ServerName localhost.localdomain

如果上面出现的提示是Starting httpd:httpd:Could not reliably determine the server's fully qualified domain name,using 127.0.0.1 for ServerName

则把#ServerName www.example.com:80改为ServerName 127.0.0.1

重启

[root@localhost conf]# service httpd restart


0 0
原创粉丝点击