【问题标题】:Apache version conflict (cont)Apache 版本冲突(续)
【发布时间】:2017-05-16 09:37:36
【问题描述】:

关于Apache versions conflict的帖子。我按照https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions的步骤再次尝试安装apache

如果我想从我的本地 Site 文件夹测试 localhost,我仍然会遇到一些问题。

apache 日志结果

关于错误

无法可靠地确定服务器的完全限定域名, 使用 127.0.0.1。设置“服务器名称”...

我尝试了在文件 /etc/apache2/apache2.conf https://askubuntu.com/questions/454497/apache2-could-not-reliably-determine-the-servers-fully-qualified-domain-name 中添加 ServerName localhost 的选项,但我不知道是不是这样正确的文件,因为我正在使用 apache 2.4 (/usr/local/etc/apache2/2.4/httpd.conf)

另外,如果我运行命令 sudo apachectl -k restart 我得到了这个

(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down

在我的文件中/etc/apache2/httpd.conf

我有这个:

# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80

# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User amhg
Group staff

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost

DocumentRoot /Users/amhg/Sites
<Directory /Users/amhg/Sites>

  #
    AllowOverride All

我取消了LoadModule rewrite_module libexec/mod_rewrite.so的注释

有什么建议吗? 提前谢谢!

【问题讨论】:

    标签: apache apache2 httpd.conf


    【解决方案1】:

    您可以使用命令查看所有 apache 安装版本:

    rpm -qa | grep httpd
    

    在您的日志文件中,我没有看到任何错误。

    你能发送你所有的日志文件吗?

    你能解释一下你在浏览器中看到的内容吗:

    http://localhost

    【讨论】:

    • 谢谢@elham_jahan 的回复,最后我决定改用MAMP,我觉得还是从初学者开始比较好。
    猜你喜欢
    • 2016-10-17
    • 2019-08-07
    • 2015-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-17
    相关资源
    最近更新 更多