------------安装Apache--------
首先将下载好的RPM包和需要的apr-1.6.2.tar.gz 、apr-util-1.6.0.tar.gz上传到liunx虚拟的/目录下
tar xf apr-1.6.2.tar.gz -C /opt/
tar xf apr-util-1.6.0.tar.gz -C /opt/
tar xf httpd-2.4.29.tar.bz2 -C /opt/
cd /opt/
mv apr-1.6.2/ httpd-2.4.29/srclib/apr
mv apr-util-1.6.0/ httpd-2.4.29/srclib/apr-util
yum -y install \ // 安装需要的软件包
gcc \
gcc-c++ \
make \
pcre-devel \
expat-devel \
perl
cd httpd-2.4.29
./configure \
--prefix=/usr/local/httpd \ //安装目录
--enable-so \ //动态加载模块支持
--enable-rewrite \ // 网页地址重写功能
--enable-charset-lite \ //启动字符集支持
--enable-cgi //启动cgi脚本程序支持
make && make insatll
编译安装成功没什么错误,继续
cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
vi /etc/init.d/httpd
插入
# chkconfig: 35 85 21 //35级别自动运行 第85个启动 第21个关闭
# description: Apache is a World Wide Web server
chkconfig --add httpd
vi /usr/local/httpd/conf/httpd.conf
修改ServerName
ln -s /usr/local/httpd/conf/httpd.conf /etc/
ln -s /usr/local/httpd/bin/* /usr/local/bin/
service httpd start //启动http
netstat -anpt | grep 80
Apachectl -t //检查语法是否有错
这样Apache手工编译就完成了