在linux中 系统默认安装路径,在linux系统下apache的默认安装路径在哪

如果采用RPM包安装,安装路径应在 /etc/httpd目录下。

apache配置文件:/etc/httpd/conf/httpd.conf 可以修改相关的访问路径及配置

Apache模块路径:/usr/sbin/apachectl 启动模块

web目录:/var/www/html 项目的存储路径

如果采用源代码安装,一般默认安装在/usr/local/apache2目录下。

启动apache报错信息,很大程度需要检查是不是端口被占用了,因为默认apache启动的是80端口。像nginx默认页是开启80端口。

报错信息如下:

[root@localhost ~]# service httpd restart

Redirecting to /bin/systemctl restart httpd.service

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

[root@localhost ~]# service httpd status

Redirecting to /bin/systemctl status httpd.service

● httpd.service - The Apache HTTP Server

Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)

Active: failed (Result: exit-code) since 三 2018-12-05 14:42:42 CST; 11s ago

Docs: man:httpd(8)

man:apachectl(8)

Process: 3640 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)

Process: 3639 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)

Main PID: 3639 (code=exited, status=1/FAILURE)

12月 05 14:42:42 localhost.localdomain httpd[3639]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

12月 05 14:42:42 localhost.localdomain httpd[3639]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

12月 05 14:42:42 localhost.localdomain httpd[3639]: no listening sockets available, shutting down

12月 05 14:42:42 localhost.localdomain httpd[3639]: AH00015: Unable to open logs

12月 05 14:42:42 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE

12月 05 14:42:42 localhost.localdomain kill[3640]: kill: cannot find process ""

12月 05 14:42:42 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1

12月 05 14:42:42 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.

12月 05 14:42:42 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.

12月 05 14:42:42 localhost.localdomain systemd[1]: httpd.service failed.

[root@localhost ~]#

可以看到Address already in use错误,修改apache的端口。

编辑/etc/httpd/conf/httpd.conf

c9d4edca3a6915920e49a2a1952f84c5.png

再次重启即可。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值