- 1、useradd apache ; echo "apache" | passwd --stdin apache
- 2、tar zxf httpd-2.4.10.tar.gz
- 3、cd httpd-2.4.10
- 4、./configure \
- --prefix=/usr/local/apache \
- --enable-so \
- --enable-cgi \
- --enable-rewrite
- 报错
- checking for APR... no
- configure: error: APR not found. Please read the documentation.
- 解决
- tar zxf apr-1.5.1.tar.gz
- cd apr-1.5.1
- ./configure \
- --prefix=/usr/local/apr
- make ; make install
- 5、./configure \
- --prefix=/usr/local/apache \
- --enable-so \
- --enable-cgi \
- --enable-rewrite \
- --with-apr=/usr/local/apr
- 报错
- checking for APR-util... no
- configure: error: APR-util not found. Please read the documentation
- 解决
- tar zxf apr-util-1.5.4.tar.gz
- cd apr-util-1.5.4
- ./configure \
- --prefix=/usr/local/apr-util \
- --with-apr=/usr/local/apr/
- make ; make install
- 6、./configure \
- --prefix=/usr/local/apache \
- --enable-so \
- --enable-cgi \
- --enable-rewrite \
- --with-apr=/usr/local/apr \
- --with-apr-util=/usr/local/apr-util/
- 报错
- checking for pcre-config... false
- configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
- 解决
- tar zxf pcre-8.30.tar.gz
- cd pcre-8.30
- ./configure --prefix=/usr/local/pcre
- make ; make install
- 7、./configure \
- --prefix=/usr/local/apache \
- --enable-so \
- --enable-cgi \
- --enable-rewrite \
- --with-apr=/usr/local/apr \
- --with-apr-util=/usr/local/apr-util/ \
- --with-pcre=/usr/local/pcre/
- make ; make install
- 8、/usr/local/apache/bin/apachectl start
- 警告
- AH00557: httpd: apr_sockaddr_info_get() failed for study.localhost.localdomain
- 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
- 解决
- vim /usr/local/apache/conf/httpd.conf
- ServerName 127.0.0.1:80 # 190 行的位置加入此行
- /usr/local/apache/bin/apachectl restart
- 9、netstat -lnpt | grep :80
- tcp 0 0 :::80 :::* LISTEN 39094/httpd
- ## apache 成功启动
- 10、vim /etc/sysconfig/iptables # 防火墙开放 80 端口
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
- service iptables restart
- 11、客户端访问 http://ip
- 最新活动: 2014-12-10 18:04
- 浏览: 1430
- 关注: 0 人
编辑回复