勿忘初心做自己 发表于 昨天 17:41

源码编译安装httpd 2.4,提供体系服务管理脚本并测试

1.安装httpd

   
[*] wget https://downloads.apache.org/httpd/httpd-2.4.62.tar.gzbmcv
[*] tar -zxvf httpd-2.4.62.tar.gz
[*] cd httpd-2.4.62
2.安装依赖包 

   
[*] sudo yum install -y gcc make apr-devel apr-util-devel pcre-devel
[*] sudo yum groupinstall "Development Tools"
3.设置和编译

   ./configure --prefix=/usr/local/apache2 --enable-so --with-mpm=event
make
sudo make install 
4.设置情况变量

   echo 'export PATH=/usr/local/apache2/bin:$PATH' >> /etc/profile.d/httpd2.sh
source /etc/profile.d/httpd2.sh 


设置体系服务 

   
Description=The Apache HTTP Server
After=network.target
 

Type=forking
ExecStart=/usr/local/apache2/bin/apachectl start
ExecReload=/usr/local/apache2/bin/apachectl graceful
ExecStop=/usr/local/apache2/bin/apachectl stop
PIDFile=/usr/local/apache2/logs/httpd.pid
PrivateTmp=true
 

WantedBy=multi-user.target
 重新加载systemd

   sudo systemctl daemon-reload
启动服务

   sudo systemctl start httpd
检查服务状态

   sudo systemctl status httpd
 

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 源码编译安装httpd 2.4,提供体系服务管理脚本并测试