Httpd: Failed to reliably determine the fully qualified domain name of the server

I know that this issue has been considered a lot, but the solutions here do not solve them.

Let's start with some background information:

OS X 10.8.4 Apache 2.2.22

Problem: I get this error in the console, and Apache cannot find my localhost, but it starts fine. 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 fully qualified domain name, using Specter.local for ServerName 

Thus, usually this indicates that my server_name is not configured correctly. Well this is: / and I tried with various options like Specter.local, localhost, etc.

Here's a copy of my /private/etc/httpd.conf, and this is the same for / private / etc / apache 2 / 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 installed 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 / apache 2 / users / ta.conf the following

 # # Use name-based virtual hosting. # NameVirtualHost *:80 # DEV: THEMILL SITE <VirtualHost *:80> ServerAdmin test@dummy.com 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 test@dummy.com 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 to configure. It used to work, but after update 10.7 it never worked, and now I'm trying to solve this problem, and it makes my head.

Let me know if you need more information.

+8
apache web macos server-configuration
source share
3 answers

Ignore ALL installation tips for ServerNames. IMHO this is a red herring. Apache tries to use standard system components to determine the fully qualified domain name and finds nothing suitable. Sure, you can undermine this process by adding a directive globally to Apache, but this seems to be a symptom. Of course, you must have ServerName directives in your virtual blocks.

Instead, edit the hosts file and make sure you have the fully qualified domain name. I have seen various syntax suggestions for a particular 127 * line, but I think it doesn’t matter in which order it happens as long as there is a fully qualified domain name:

 127.0.0.1 localhost.localdomain localhost foo.example.com 

It worked for me and seemed to me much more important than everyone else "worked for me!". upvotes on posts recommending you edit httpd.conf and the like. Hope this helps and I don't go down. If you do not agree, please indicate the reasons with examples. Thanks.

http://wiki.apache.org/httpd/CouldNotDetermineServerName

After Apache can determine the system FQDN, it will then read your specific ServerName directives for your NameBasedHosts.

+8
source

I recently had the same problem on a Mac, and although I edited my host file as Spanky suggests (and I think it is also necessary), I also needed to edit my httpd.conf.

in the event that anyone has this in the future, the following may work

in the file / etc / apache 2 / httpd.conf add this line after the line ServerAdmin your@email.com

 ServerName your-favorite-server-name 

Source: https://blog.cloudtroopers.com/upgrade-osx-1010-yosemite-and-keep-apache-functional

+1
source

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

 ServerName localhost 

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

To find the correct location for your httpd.conf Apache configuration file, run:

 apachectl -t -D DUMP_INCLUDES 

then double check if ServerName uninhibited and set to localhost .

+1
source

All Articles