Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Apache AH00558 is normally a startup warning, not a failed web server. It means httpd could not identify a reliable fully qualified domain name (FQDN) for itself. Set one global, resolvable ServerName in the main Apache configuration, test the syntax, and reload the service. For a public site, use the domain that should be canonical; for a local-only machine, a correctly mapped hostname or a loopback address can be appropriate.

What AH00558 means

The message commonly appears in a form similar to AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using .... Apache has started, but during startup or restart it could not determine a name that reliably resolves to the server. It then falls back to a hostname or address it can discover.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Apache Software Foundation describes this as a startup warning. It matters because Apache sometimes has to construct a URL that refers back to the server, such as a redirect generated by a module or directory setting. A known server name gives those self-referential URLs a stable host component.

With UseCanonicalName Off, Apache can generally use the host name supplied by the client for such requests, so the warning can often be ignored temporarily while the service remains available. That is a stopgap, not a good permanent configuration: a missing global name can produce inconsistent redirects and makes the server’s intended identity unclear.

The direct fix: define one global ServerName

Add a single directive to the main Apache configuration, outside every VirtualHost block:

ServerName www.example.com

The value must be a name that the server itself can resolve to an IP address. For a public deployment, use the real FQDN that matches the site’s canonical URL. For a private or offline machine, Apache’s documentation permits an IP address such as:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ServerName 127.0.0.1

This global directive is required even when all requests are handled by virtual hosts. A ServerName placed only inside individual VirtualHost sections does not satisfy the main-server setting that eliminates AH00558.

Choose the right value before editing

Value Can the server resolve it? Matches a public canonical URL? Best use
Real FQDN, such as www.example.com Yes, through DNS or a valid local mapping Yes, when that is the site’s intended host Public websites and production services
Local hostname, such as web01.example.com Yes, if DNS or /etc/hosts maps it correctly Only if clients are meant to use that name Private networks, staging, and internal services
Loopback or another local IP, such as 127.0.0.1 Yes, by definition for the local machine No; it is not a public site name Local-only development or a host with no usable DNS

Do not select a name merely because it removes the warning. The name becomes Apache’s global identity for operations that need a self-referential URL. A production site should use the name users and other systems are expected to reach. A loopback address is a fallback for a local service, not a substitute for configuring public DNS.

Find the configuration file for your distribution

Debian and Ubuntu

Package-managed Apache installations normally use /etc/apache2/. You can put the directive directly in /etc/apache2/apache2.conf, or keep it in a separate snippet such as /etc/apache2/conf-available/servername.conf. A separate snippet is easier to identify and remove later.

If you create the snippet, enable it with the distribution’s Apache configuration helper before testing. The enabled configuration must ultimately be included by the main Apache configuration; creating a file that is never enabled will not change the running server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudoedit /etc/apache2/conf-available/servername.conf

Put only the appropriate global directive in that file, for example:

ServerName web01.example.com

Then enable the snippet with the package helper, and proceed to the syntax test. If you instead edit apache2.conf, make sure the line is outside any virtual-host section.

RHEL, Rocky, and Fedora

These systems normally use /etc/httpd/. Add the directive to /etc/httpd/conf/httpd.conf, or create a file under /etc/httpd/conf.d/ that the main configuration includes.

sudoedit /etc/httpd/conf.d/servername.conf

Use the same global syntax:

ServerName web01.example.com

Do not assume that a path from another distribution exists on your host. Apache reads the files included by the installed package, so editing an unused file has no effect.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apply the change safely

  1. Confirm the intended identity. Decide whether this machine is public, internal, or local-only. Choose a name or address that is valid for that role and can be resolved from the server.
  2. Edit the global configuration. Add exactly one main-server ServerName line outside all VirtualHost blocks. Keep virtual-host-specific names in their own sections as needed; the global line serves a different purpose.
  3. Check the file is actually included. On Debian or Ubuntu, an available snippet must be enabled. On RHEL-family systems, a file under conf.d must have the normal included configuration location and a valid Apache configuration suffix.
  4. Validate before touching the service. Run:
sudo apachectl configtest

A successful check prints Syntax OK. If it reports an error, correct that error first. A syntax test does not prove that DNS is logically correct, but it prevents a malformed edit from being loaded.

  1. Reload the appropriate service. Reloading applies the configuration without unnecessarily stopping active connections.
sudo systemctl reload apache2   # Debian/Ubuntu
sudo systemctl reload httpd     # RHEL-family
  1. Check the next startup or reload output. AH00558 should no longer be emitted when the global name is valid and resolvable. If it remains, Apache is probably reading a different configuration than the file you edited, or the selected name still cannot be resolved locally.
  2. Exercise a representative request. Test the public or internal URL that should be canonical, and check any redirect-producing path. The purpose of the global name is not merely a quiet log; it is predictable self-referential URL generation.

When the real problem is DNS or /etc/hosts

Setting ServerName to an arbitrary string can leave the warning in place. Apache’s core documentation specifically warns that a name the server cannot resolve to an IP address results in a startup warning. If the chosen name is supposed to work locally, repair name resolution rather than hiding the symptom.

Use DNS for names that should be real

For a public FQDN, create or correct the appropriate DNS record so the name resolves to the server’s reachable address. The server must also be able to resolve that name using the DNS configuration available to the operating system. A name that works from a laptop but fails from the Apache host is not sufficient.

Use /etc/hosts for a deliberate local mapping

On a machine without suitable DNS, a hosts-file entry can provide the local mapping. Apache’s example uses a loopback address with a local domain and hostname:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
127.0.0.1   localhost.localdomain localhost web01.example.com

Replace the example names with values that are actually correct for this machine. Do not copy web01.example.com into production unless that is the host’s intended name. A hosts entry is local to the machine; it does not publish a name for outside clients.

Decide whether the mapping should be loopback or a service address

Map a local-only development name to loopback when Apache is intentionally reachable only on that host. For a server that other machines must reach, use the address those clients should reach and ensure the name is consistent with routing, firewall policy, and DNS. The right mapping depends on deployment scope, not on which value silences AH00558 fastest.

Why virtual hosts do not replace the global setting

A virtual host describes how Apache answers a request for a particular address and host name. AH00558 is emitted while Apache is establishing the identity of the main server process itself. Consequently, putting ServerName in every virtual host can leave the warning unchanged even though each site appears correctly configured.

The Apache troubleshooting guidance makes this distinction explicit: even when every request is served by virtual hosts, a ServerName must still be defined in the main configuration outside the VirtualHost sections. Keep both layers when needed:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ServerName web01.example.com

<VirtualHost *:80>
    ServerName www.example.com
    ServerAlias example.com
    # site-specific directives
</VirtualHost>

The global name identifies the server for fallback and self-referential behavior. The name inside the virtual host selects the site for requests addressed to that host.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common failure modes and their remedies

The line was added inside a VirtualHost block

Move the main declaration above or below the virtual-host sections in the global configuration. Leave site-specific declarations in their respective blocks, but do not rely on them to satisfy the main-server requirement.

The selected name is not resolvable from the server

Check the DNS record or add a deliberate /etc/hosts mapping. If the machine is local-only and has no meaningful DNS name, use a loopback or local IP fallback instead of an invented public domain.

The wrong file was edited

Distribution layouts differ. Debian and Ubuntu commonly read /etc/apache2/apache2.conf plus enabled configuration snippets; RHEL-family systems commonly read /etc/httpd/conf/httpd.conf plus files under conf.d. An unenabled or unincluded file cannot affect Apache.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Validation was skipped

Always run sudo apachectl configtest before a reload. A failed reload can leave the previous configuration active, while a service restart may create avoidable downtime. Fix every reported syntax error before proceeding.

The warning disappears but redirects use the wrong host

That usually means the chosen global name does not match the deployment’s canonical URL. Revisit the comparison between the public FQDN, internal hostname, and IP fallback. For public services, set the real canonical FQDN and ensure it resolves correctly; do not use a loopback address merely because it is easy to resolve.

Multiple global ServerName lines create confusion

Keep one intentional main-server value. Multiple declarations spread across included files make it difficult to know which identity Apache will use and can cause an administrator to fix one file while another remains authoritative. Consolidate the setting in one clearly named global location.

Operational checklist

  • AH00558 is understood as a startup warning, not automatic evidence that Apache failed to run.
  • The chosen value is a real FQDN, an intentionally mapped local hostname, or a local IP appropriate to the deployment.
  • The global ServerName is outside every VirtualHost block.
  • The edited file is part of the active package configuration.
  • DNS or /etc/hosts lets the Apache host resolve the selected name.
  • sudo apachectl configtest returns Syntax OK.
  • The correct service is reloaded: apache2 on Debian/Ubuntu or httpd on RHEL-family systems.
  • A representative request and any important redirect use the intended host name.

What to do if you cannot fix it immediately

If the service is already running and clients are working, you can defer the change briefly, particularly when UseCanonicalName Off lets Apache use the client’s host name. Treat that state as temporary. Document the intended canonical name, repair its DNS or local mapping, add the global directive, run the syntax test, and reload during a controlled maintenance window.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a production site, leaving the warning unresolved makes future troubleshooting harder and can expose redirect behavior to whatever host header a client supplies. For a development machine, a loopback fallback is usually adequate until a real internal or public name is available.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.