• 欢迎访问VPS岛网站,国外VPS,国内VPS,国外服务器,国内服务器,服务器主机,测评及优惠码,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站 QQ群

centos7 设置Apache开机自启动

Centos技术 大漠新人 44次浏览 已收录 0个评论

查看Apache是否加入到到开机自启动列表
systemctl list-unit-files | grep httpd
httpd.service disabled

Apache加入到开机自启动
systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

再次确认
systemctl list-unit-files | grep httpd
httpd.service enabled

启动Apache
systemctl start httpd
netstat -lnt | grep 80
tcp 0 0 10.211.55.15:80 0.0.0.0:* LISTEN

查看Apache状态
systemctl status httpd
● httpd.service – The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2019-12-16 15:16:35 CST; 7min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 2040 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
Tasks: 6
CGroup: /system.slice/httpd.service
├─2040 /usr/sbin/httpd -DFOREGROUND
├─2041 /usr/sbin/httpd -DFOREGROUND
├─2042 /usr/sbin/httpd -DFOREGROUND
├─2043 /usr/sbin/httpd -DFOREGROUND
├─2044 /usr/sbin/httpd -DFOREGROUND
└─2045 /usr/sbin/httpd -DFOREGROUND


VPS岛 的文章和资源来自互联网,仅作为参考资料,如果有侵犯版权的资源请尽快联系站长,我们会在24h内删除有争议的资源。丨 转载请注明centos7 设置Apache开机自启动
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址