当前位置: 代码网 > 服务器>服务器>Linux > 在linux系统下apache的默认安装路径在哪

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

2025年03月30日 Linux 我要评论
如果采用rpm包安装,安装路径应在 /etc/httpd目录下。(学习教程推荐:apache)apache配置文件:/etc/httpd/conf/httpd.conf 可以修改相关的访问路径及配置a

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

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

(学习教程推荐:apache)

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

7197ed1592e8705919322e1f00ce3eb.png

再次重启即可。

以上就是在linux系统下apache的默认安装路径在哪的详细内容,更多请关注代码网其它相关文章!

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com