ASP站长网如何从CentOS中源码编译和安装Apache
 
1、下载最新的Apache版本
 
wget http://mirror.downloadvn.com/apache//httpd/httpd-2.4.41.tar.gz
 
2、安装软件包
 
yum install apr* gcc
 
3、编译安装
 
tar -zxvf httpd-2.4.41.tar.gz
cd httpd-2.4.41
./configure –prefix=/usr/local/apache –enable-vhost-alias –enable-rewrite –enable-info
make
make install
 
复制初始化文件并将Apache设置为启动
 
cp build/rpm/httpd.init /etc/init.d/httpd
chmod 755 /etc/init.d/httpd
chkconfig –add httpd
chkconfig –level 35 httpd on
 
创建一个符号链接
 
ln -s /usr/local/apache/ httpd
cd /usr/sbin/
ln -fs /usr/local/apache/bin/httpd
ln -fs /usr/local/apache/bin/apachectl
cd /var/log
rm -rf httpd/
/etc/init.d/httpd start
 
启动/停止httpd服务
 
service httpd restart
service httpd start
/usr/local/apache/bin/apachectl start
/usr/local/apache/bin/apachectl stop
/usr/local/apache/bin/apachectl status
/etc/init.d/httpd start
/etc/init.d/httpd stop
/etc/init.d/httpd restart
 
使用pgrep查找启动的进程
 
pgrep httpd
 
CentOS下源代码编译和安装Apache
 
Apache配置文件
 
vi /usr/local/apache/conf/httpd.conf

dawei

【声明】:九江站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。