安装完成apache之后,需要安装apache的服务:
①:touch /etc/systemd/system/httpd.service
②:vim httpd.service:
[Unit]
Description=Apache HTTP Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/apache2.4/bin/apachectl start
ExecReload=/usr/local/apache2.4/bin/apachectl graceful
ExecStop=/usr/local/apache2.4/bin/apachectl stop
PIDFile=/usr/local/apache2.4/logs/httpd.pid
PrivateTmp=true
Restart=on-filure
[Install]
WantedBy=multi-user.target
③:systemctl daemon-reload
④:systemctl enable httpd
⑤:systemctl start httpd
~~~
修改apache的mpm模式,把event改成worker模式:
重新编译二进制包:
①:./configure --prefix=/usr/local/apache2.4/ --with-mpm=worker
②:make && make install
③:查看mpm模块:
httpd -V |grep -i mpm
④:httpd -l
出现worker.c
⑤:httpd -t
⑥:httpd -k graceful
孔雀
鼓励的话语:逆境不吐心中苦,顺境不忘来时路!