下载 httpd-2.4.12.tar.gz
939 mkdir soft
941 cd soft/
943 cp /tmp/httpd-2.4.12.tar.gz /soft/
945 tar -zxvf httpd-2.4.12.tar.gz
947 cd httpd-2.4.12
下载apr-1.5.1.tar.gz
957 tar -zvxf apr-1.5.1.tar.gz
958 cd apr-1.5.1
959 ./configure --prefix=/usr/local/apr
960 make && make install
下载apr-util-1.5.4.tar.gz
961 cd ..
962 tar -zxvf apr-util-1.5.4.tar.gz
963 cd apr-util-1.5.4
964 ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
965 make
966 make install
下载pcre-8.32.tar.gz
967 cd ..
968 ls
969 tar -zvxf pcre-8.32.tar.gz
970 cd pcre-8.32
971 ls
972 ./configure --prefix=/usr/local/pcre
973 make
974 make install
967 cd ..
968 ls
969 tar -zvxf pcre-8.32.tar.gz
970 cd pcre-8.32
971 ls
972 ./configure --prefix=/usr/local/pcre
973 make
974 make install
975 cd ..
985 cd httpd-2.4.12
988 ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre
989 make
990 make install
991 cd /usr/local/apache/
992 ls
993 cd conf/
994 ls
995 cp -a httpd.conf httpd.conf.bak
996 ls
997 chkconfig --list httpd
998 service httpd status
999 cd ..
1000 ls
1001 ./bin/apachectl -k start
1002 netstat -an | grep 80
1004 ps aux|grep httpd
1005 cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache
1006 vim /etc/rc.d/init.d/apache
行首加入如下配置:
#!/bin/sh
#chkconfig: 2345 85 15 2345表示2345四个启动级别里面加载这个服务,85表示启动(开机时)顺序号,15表示关闭(关机时)顺序号
1007 chkconfig --add apache
1008 chkconfig apache on
1009 netstat -an |grep :80
1010 service apache stop
1011 service apache start
遇到问题说明:
rpm -qa |grep httpd
rpm -e --nodeps httpd-tools-2.2.15-29.el6.centos.x86_64
rpm -qa |grep httpd
rpm -e --nodeps httpd-2.2.15-29.el6.centos.x86_64
ls
rpm -qa |grep httpd
yum remove apache
rpm -e --nodeps httpd-tools-2.2.15-29.el6.centos.x86_64
rpm -qa |grep httpd
rpm -e --nodeps httpd-2.2.15-29.el6.centos.x86_64
ls
rpm -qa |grep httpd
yum remove apache
报错: no acceptable C compiler found in $PATH
yum install gcc
linux下安装安装pcre-8.32 ./configure --prefix=/usr/local/pcre 出现以下错误 configure: error: You need a C++ compiler for C++ support
正解
yum install -y gcc gcc-c++
AH00557: httpd: apr_sockaddr_info_get() failed for lihonglei
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
修改
./conf/httpd.conf文件
erverName www.example.com:80
行注释去掉