If Apache shows its “It Works!” welcome page instead of your site’s index.html, Apache is running but the request is reaching the wrong configuration, document root, or index-file rule. Request the intended hostname and port, identify the virtual host that handles it, point that host’s DocumentRoot at the directory containing your files, and make sure DirectoryIndex selects the intended filename. Then reload Apache and use the logs and direct-file requests to confirm the result.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What the “It Works!” page actually tells you
Apache’s Windows documentation describes the post-installation response this way: “httpd should respond with a welcome page and you should see ‘It Works!’” The archived installation guidance likewise treats the welcome page as an expected initial response and recommends checking error.log when access fails.
As an Amazon Associate I earn from qualifying purchases.
That page confirms that an Apache process answered the request. It does not confirm that Apache selected the virtual host, port, or document directory you intended. The most common mistake is to edit one configuration while the browser request is being handled by another host block or another Apache instance.
- Server is responding: the request reached an HTTP service running Apache.
- Site selection is unresolved: the hostname and port may map to a different virtual host than the one you edited.
- File selection is unresolved: the active host may use a different
DocumentRootor an earlierDirectoryIndexentry. - Access may still be blocked: directory permissions or access rules can prevent Apache from serving the corrected file.
How Apache chooses what to return for /
1. The request selects a virtual host
Apache uses the request’s hostname and port to choose among virtual-host definitions. The host block that matches the request’s ServerName or an alias, together with the listening port, supplies the settings used for that request.
#1 Best Overall
Therefore, these requests can produce different pages even when they reach the same machine:
http://example.com/http://www.example.com/http://localhost/http://192.0.2.10/http://example.com:8080/https://example.com/
A request to localhost, an IP address, or another port can select a default or unrelated host instead of your site’s block. HTTP and HTTPS also commonly use separate virtual-host blocks, so correcting the port-80 configuration does not automatically correct the TLS configuration.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →2. DocumentRoot maps the URL to a directory
Apache defines DocumentRoot as the directory that forms the web-visible document tree. If the active host has DocumentRoot "/var/www/example", a request for /index.html maps to /var/www/example/index.html.
If the file is actually in /var/www/example/public/index.html, Apache will not find it until the active root is changed to /var/www/example/public or the file is moved into the configured root. A correct file in an inactive directory has no effect on the response.
3. DirectoryIndex chooses the default file
When the browser requests a directory such as /, Apache uses the DirectoryIndex setting to determine which filename to try. If the list names another file before index.html, that earlier file can be returned instead. The setting does not change the document root; it changes the default filename selected inside that root.
Rank #2
This distinction explains an important diagnostic: if /index.html displays your site but / displays the welcome page, the host and root are probably correct and the index-file rule needs attention. If both URLs display the welcome page, investigate host selection and DocumentRoot first.
Recommended Free Tools
Fix the problem in the right order
- Use the intended URL. Enter the real hostname and the port on which that site’s virtual host listens. Do not diagnose with
localhostor an IP address unless that is how the site is configured. - Identify the matching virtual host. Find the host block whose
ServerNameor alias matches the hostname and whose port matches the URL. This is the block that must be edited. - Verify the document root. Check that its
DocumentRootis the directory containing the deployed files. - Verify the index file. Place
index.htmldirectly inside that root, using the exact spelling and case expected by the filesystem. - Check the index order. Inspect
DirectoryIndexfor another filename listed ahead ofindex.html. Reorder or remove entries only when you understand what other pages rely on them. - Align access rules. Ensure the relevant
<Directory>section applies to the new root and permits Apache to serve its contents. - Reload or restart Apache. Use the normal procedure for the platform and installation, then test again.
- Read the logs if the response is unchanged or becomes an error. Check the access and error logs for the request and the reason Apache rejected or redirected it.
Verify the active virtual host before changing files
Match hostname, alias, and port
Open the Apache configuration and locate the <VirtualHost> block that corresponds to the URL you are testing. Its address and port must match the request, and its ServerName or aliases must include the hostname in the browser.
| Browser request | Configuration details that must match | Typical mismatch |
|---|---|---|
http://example.com/ |
HTTP virtual host, hostname example.com, port 80 |
Only an HTTPS block or a different hostname is configured |
http://www.example.com/ |
Port 80 host with www.example.com as name or alias |
The block covers example.com but not the www alias |
https://example.com/ |
HTTPS virtual host for the TLS port and hostname | Only the HTTP block was edited |
http://example.com:8080/ |
Virtual host listening on port 8080 for that hostname | The site is configured on port 80 while the browser uses 8080 |
If you are unsure which block receives a request, make the request with the exact hostname and port you intend to support, then correlate it with the access log. A request logged under a different host or listener is evidence that the browser is not reaching the configuration you changed.
Check DNS and the hosts file
The requested name must resolve to the machine whose Apache configuration you edited. Verify DNS, or the local hosts file when testing privately, before treating a persistent welcome page as a file-placement problem. If the name points to another machine, every local change can appear to have no effect because a different server is answering.
Set DocumentRoot to the directory that contains the site
Confirm the file’s actual location
Locate the deployed files on disk and identify the directory that should be visible at the site root. The expected relationship is direct:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11DocumentRoot "/var/www/example"
/var/www/example/index.html
With that arrangement, requesting /index.html reads the file shown in the second line. If your files are nested one level deeper, either change the root to that nested directory or move the files so that index.html is directly beneath the configured root.
Use the root from the host that actually answers
Multiple virtual hosts can have different roots. Changing a global or unrelated DocumentRoot will not fix a request handled by a more specific host block. Edit the root inside the active virtual host, then ensure the matching <Directory> permissions refer to the same path.
Make index.html the directory index
Put the file in the root with exact spelling
Place the intended file directly in the active document root and use the exact filename index.html. Case differences matter on case-sensitive filesystems: Index.html, INDEX.HTML, and index.html are not necessarily the same file.
Inspect competing index names
Look for DirectoryIndex directives in the virtual host, directory configuration, and included configuration files. Apache can try the names in the order listed. If a welcome file appears before index.html, Apache can legitimately return that file even though your intended index exists.
Remove or reorder an entry only after checking whether another part of the site depends on it. A safer targeted setting inside the relevant directory is:
Rank #4
DirectoryIndex index.html
This tells Apache which file to use when the request names the directory rather than the file itself. It does not correct a wrong hostname, port, or document root.
A minimal virtual-host configuration
The following pattern shows the relationship between host selection, filesystem mapping, access policy, and the default filename. Replace the example hostname and path with the values used by your installation.
<VirtualHost *:80>
ServerName example.com
DocumentRoot "/var/www/example"
<Directory "/var/www/example">
Require all granted
DirectoryIndex index.html
</Directory>
</VirtualHost>
ServerNameidentifies the hostname this block is intended to serve.*:80represents the listener and port for ordinary HTTP in this example.DocumentRootsupplies the filesystem base for URL paths.- The
<Directory>section applies access policy to that same directory. DirectoryIndex index.htmlmakesindex.htmlthe default file for a directory request.
Adapt the port, hostname, path, and access policy to the local installation. Do not copy Require all granted blindly into a site with stricter requirements; the important check is that the policy for the active root permits the intended content to be served.
Use direct-file requests to isolate the fault
Request the file explicitly rather than requesting only the directory:
http://example.com/index.html
Interpret the result using this decision table:
| Result | Most likely area to inspect next |
|---|---|
/index.html shows your site, but / shows “It Works!” |
DirectoryIndex order or a competing default file |
Both /index.html and / show “It Works!” |
Hostname/port selection or the active DocumentRoot |
| Both requests return an access error | <Directory> permissions and the error log |
| The browser shows a different site or redirects elsewhere | Another virtual host, proxy, HTTPS configuration, or server answering the request |
Use the same scheme, hostname, and port in every test. A successful HTTP test does not prove that the HTTPS virtual host is configured correctly.
Best Value
Reload Apache and verify the change
After editing the configuration or moving files, reload or restart Apache using the normal procedure for the operating system and installation. A configuration file can be correct on disk but inactive until Apache reads it again.
Then test in this order:
- Request the exact hostname and port handled by the edited virtual host.
- Request
/index.htmldirectly. - Request
/and confirm that the directory index now resolves to the intended file. - Repeat the test over HTTPS if the site supports it.
- Check the access and error logs for the same request if the result is unexpected.
Clear a cached browser response only after confirming the server response with a fresh request or another client. Caching can preserve an old page, but it cannot make an incorrect virtual host serve the right file.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
When the welcome page still appears
The hostname resolves somewhere else
Confirm that DNS or the hosts file maps the requested name to the machine you edited. If the address points to another server, correct the mapping or administer the server that actually receives the request.
The URL uses a different scheme or port
Check the complete browser URL, including http versus https and any explicit port. Separate virtual-host blocks often exist for HTTP and HTTPS, and a nonstandard port can select a different configuration.
A reverse proxy, container, or second Apache instance answers
A proxy or container can terminate the request before it reaches the Apache configuration you edited. A second Apache process can also listen on the port you are testing. The access log for the answering service should show whether the request arrived there; if it does not, trace the request path to the proxy, container, or other process.
The root is correct but access rules reject it
Ensure the relevant <Directory> block points to the same directory as DocumentRoot and permits Apache to read the files. Consult error.log for permission and configuration errors rather than inferring the cause from the browser’s generic error page.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →The configuration change was not loaded
Reload or restart Apache after changes, and check the error log immediately if the service refuses to reload. A syntax or path error can leave the previous configuration active or prevent the server from starting.
Quick Recap
Common mistakes to avoid
- Editing the default welcome directory: this may change the page shown by the default host but not the site’s actual virtual host.
- Testing with an IP address: the IP can select a different host from the domain name.
- Changing only
DirectoryIndex: an index rule cannot compensate for a wrongDocumentRoot. - Changing only
DocumentRoot: a competing earlier index file can still win for/. - Ignoring case: the filename must match the filesystem’s spelling rules.
- Fixing HTTP while testing HTTPS: the browser may be using a separate TLS virtual host.
- Skipping logs: access and error logs reveal which request arrived and why Apache rejected or served it.
Final verification checklist
- The browser URL uses the intended scheme, hostname, and port.
- That hostname resolves to the machine running the configuration you edited.
- The matching virtual host contains the expected
ServerNameor alias. - Its
DocumentRootcontainsindex.htmldirectly. - The filename’s spelling and case are correct.
DirectoryIndexdoes not select an unwanted file first.- The matching
<Directory>policy permits Apache to serve the root. - Apache has been reloaded or restarted after the change.
- A direct request to
/index.htmland a request to/produce the expected result. - The access and error logs show the request reaching the intended service.
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.




