欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

优化执行路径

程序员文章站 2022-04-21 17:51:10
...

优化执行路径

ln -s /usr/local/httpd/conf/httpd.conf /etc/
ln -s /usr/local/httpd/bin/* /usr/local/bin/
httpd -v      ###查当前HTTP版本

建立[service].service 配置文件添加系统给服务

在/lib/systemd/system/目录下,建立一个以.service 结尾的单元(unit)配置文件,
用于控制由 systemd 管理或监控的 httpd 服务

[[email protected] ~]# cd /lib/systemd/system/
[[email protected] system]# vim httpd.service
[Unit]
Description=The Apache HTTP Server
After=network.target
[Service]
Type=forking
PIDFile=/usr/local/httpd/logs/httpd.pid
ExecStart= /usr/local/bin/apachectl $OPTIONS
ExecrReload= /bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target


[[email protected] system]# systemctl start httpd			###检查HTTP单元是否启动
[[email protected] system]# systemctl enable httpd			###开机自启http
[[email protected] httpd-2.4.29]# systemctl restart httpd 		###重启http