Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

How do Set the 'ServerName' directive globally to suppress this message in OS X

Writer Andrew Henderson

I'm getting this error message when starting Apache. I'm using macOS Mojave 10.14.5.

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Stevens-MacBook-Air.local. Set the 'ServerName' directive globally to suppress this message httpd (pid 856) already running

I added the name server in the httpd.conf file but still am coming up with this error message.

# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName
#ServerName localhost:8080

What am I missing that this message still appears?

1

2 Answers

I added the name server in the httpd.conf file but still am coming up with this error message.

Sorry to say but no, you didn’t. This is effectively what you have:

# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName
#ServerName localhost:8080

Note how all of the lines above #ServerName localhost:8080 have # prepended to them. That means they are commented out. Look around that config file; there are other lines that are commented as well as commented out. To make your setting take effect, you need to uncomment it like this.

# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName
ServerName localhost:8080

Then restart Apache and you should be able to access that Apache server at as expected.

Add a line to your fully qualified hostname to the apache configuration:

LINE='ServerName
FILE='/etc/apache2/apache2.conf'
grep -qF -- "$LINE" "$FILE" || echo "$LINE" >> "$FILE"
service apache2 restart

If your server has no domain, use localhost instead

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy