Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

httpd: Could not reliably determine the server's fully qualified domain name

I know this question's been looked at a lot, but the solutions here aren't solving them.

Let's start with a bit of background info:

OS X 10.8.4 Apache 2.2.22

The problem: I get this error in the console and Apache can't find my localhost, but does start ok. Weird.

[Sat Aug 17 13:40:06 2013] [info] mod_ssl/2.2.22 compiled against Server: Apache/2.2.22, Library: OpenSSL/0.9.8r
httpd: Could not reliably determine the server's fully qualified domain name, using Specter.local for ServerName

So normally this would point to my ServerName not being set right. Well it is :/ and I've tried with different variants like Specter.local, localhost, etc

Here's a copy of my /private/etc/httpd.conf & this is the same for /private/etc/apache2/httpd.conf

# 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

My host file is setup as follows:

127.0.0.1   localhost localhost.local
255.255.255.255 broadcasthost
127.0.0.1       themill.dev
127.0.0.1       phpmyadmin.dev
127.0.0.1       Specter.local

In my /private/etc/apache2/users/ta.conf is the following

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
# DEV: THEMILL SITE
<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot "/Users/ta/Sites/themill/htdocs"
  ServerName themill.dev
  ServerAlias *.themill.dev
  ErrorLog "/Users/ta/Sites/themill/log/error_log"
  CustomLog "/Users/ta/Sites/themill/log/access_log" common
</VirtualHost>

# PHPMYADMIN
<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot "/Users/ta/Sites/phpmyadmin"
  ServerName phpmyadmin.dev
  ServerAlias *.phpmyadmin.dev 
  ErrorLog "/Users/ta/Sites/phpmyadmin/log/error_log"
  CustomLog "/Users/ta/Sites/phpmyadmin/log/access_log" common
</VirtualHost>

Not sure what else should be configured really. It used to work but post the 10.7 upgrade, it's never worked and now that I'm trying to solve it it's doing my head in.

Let me know if you need more info.

like image 847
TobyAllen Avatar asked Aug 17 '13 15:08

TobyAllen


People also ask

Could not reliably determine the server's fully qualified Apache?

An Apache AH00558: Could not reliably determine the server's fully qualified domain name message is generated when Apache is not configured with a global ServerName directive. The message is mainly for informational purposes, and an AH00558 error will not prevent Apache from running correctly.

How do I set the ServerName directive globally in Windows?

The fix for this configuration error is simple: all you have to do is edit your “/etc/apache2/apache2. conf” file, adding a global ServerName directive. Note that this global directive is required to eliminate the error message even if you already have a virtual server configured with its own ServerName directive.

What FQDN means?

fully qualified domain name (FQDN)


1 Answers

The following line in your httpd.conf file is correct:

ServerName localhost

The problem is that on macOS it is the wrong file (not /private/etc/httpd.conf).

To find the right location of your httpd.conf Apache configuration file, run:

apachectl -t -D DUMP_INCLUDES

then double check whether ServerName is uncommented and set to localhost.

like image 196
kenorb Avatar answered Oct 14 '22 19:10

kenorb