CentOS 7下LAMP源码安装(3)安装 httpd 及配置

在安装过程中如果遇到什么错误,要根据实际错误代码进行更正.


1. 安装 apr  apr-util

./configure --prefix=/usr/local/apr
make && make install

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

2. 安装libmcrypt

./configure --prefix=/usr/local/libmcrypt
make && make install

3. pcre
./configure --prefix=/usr/local/pcre
make && make install

4. zlib
./configure --prefix=/usr/local/zlib
make && make install

3. 安装httpd
./configure "--prefix=/usr/local/apache24" \
"--enable-so" \
"--with-apr=/usr/local/apr" \
"--with-apr-util=/usr/local/apr-util/" \
"--with-pcre=/usr/local/pcre" \
"--with-zlib=/usr/local/zlib/" \
"--enable-rewrite" \
"--enable-cgi" \
"--enable-modules=most" \
"--enable-mpms-shared=all" \
"--with-mpm=event" \


httpd 安装完毕配置
1、添加至自启动
复制 /usr/local/apache2/bin/apachectl  至 /etc/init.d/httpd
chkconfig --add httpd
chkconfig httpd on


2、修改httpd httpd.conf
第二行添加
# chkconfig: 345 85 15
# description: Apache Web Server(Testing Only)

3、配置httpd.conf
ServerName 127.0.0.1
Listen 9988 #端口跟防火墙开放端口
这里防火墙开放端口也要设置


初步设置完毕。

你可能感兴趣的:(服务器运维)