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.

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

If a domain shows Apache’s default page, the wrong site, or a different directory, changing DocumentRoot may not be the right first move. Apache can serve the expected files only after DNS sends the request to the correct server, the request reaches the intended IP and port, the Host name matches the right virtual host, and that virtual host maps to the correct directory. Work through those layers in order: DNS, listener, hostname matching, parsed configuration, then filesystem content.

A virtual-host file does not create DNS records. As the Apache Software Foundation explains, “Creating virtual host configurations on your Apache server does not magically cause DNS entries to be created for those host names.” A hosts-file entry changes name resolution only on the machine where it is entered.

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

What “pointing to an Apache directory” actually involves

When someone says a domain should point to an Apache directory, they are combining several separate operations:

  1. DNS resolution: The apex name, such as example.com, and aliases such as www.example.com must resolve to the server’s public IPv4 or IPv6 address.
  2. IP and port selection: The browser must reach the address and listener that host the intended virtual host. HTTP normally uses port 80 and HTTPS normally uses port 443.
  3. Virtual-host matching: Apache compares the destination address and port, then the HTTP Host value with ServerName and ServerAlias.
  4. Filesystem mapping: The selected block’s absolute DocumentRoot determines where Apache looks for the requested URL path. A request for /about.html is mapped beneath that root, and a request for / is handled through DirectoryIndex.

A failure in an earlier layer can make a perfectly written virtual-host file appear broken. For example, correcting a port-80 DocumentRoot cannot fix a browser that is using HTTPS and selecting a different port-443 virtual host.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Diagnose the problem in the right order

1. Check DNS before editing Apache

Resolve the apex domain and every alias users actually enter. Compare each returned address with the server’s public IP address. Check both record families when applicable:

  • An A record supplies an IPv4 address.
  • An AAAA record supplies an IPv6 address. An incorrect or stale IPv6 record can send some visitors to a different machine even when the IPv4 record is correct.
  • A CNAME alias points one hostname at another name; follow the chain and confirm the final address is the intended server.

Use the resolver tools available on your system, for example dig example.com A, dig example.com AAAA, or nslookup example.com. Repeat the check for www.example.com and any subdomain that has its own virtual host. If an answer is wrong, change the record at the DNS provider and wait for its TTL and resolver caches to expire. Apache cannot correct a DNS answer it never receives.

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

For local-only testing, add the name and server address to the client machine’s hosts file. This is useful when DNS is not ready, but it affects only that machine; it does not publish the domain for other visitors.

2. Confirm the request reaches the intended listener

Determine whether the failing request is HTTP or HTTPS. Apache chooses a virtual host from the blocks attached to the request’s destination IP and port. A working <VirtualHost *:80> block does not select a site for a request arriving on port 443.

Check that Apache is listening on the expected ports and that any firewall or upstream network device forwards them to this server. Test each scheme explicitly in a browser or with a command such as curl -I http://example.com/ and curl -I https://example.com/. Compare the responses rather than assuming that success on one scheme proves the other is configured.

3. Match the hostname exactly

Inside each name-based virtual host, define the primary spelling in ServerName and every accepted alternate spelling in ServerAlias. Apache’s documentation states that each block needs, at minimum, a ServerName and a DocumentRoot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example
    ErrorLog ${APACHE_LOG_DIR}/example-error.log
    CustomLog ${APACHE_LOG_DIR}/example-access.log combined
</VirtualHost>

Names are not interchangeable. A block for example.com does not automatically match www.example.com, and a typo, missing dot, or unexpected alternate spelling can send the request elsewhere. If you want one spelling to be canonical, configure the alias deliberately and redirect it from the selected virtual host rather than relying on an accidental fallback.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

4. Validate the file and inspect Apache’s parsed map

After every virtual-host change, test the configuration before reloading:

sudo apachectl -t
sudo apachectl -S

apachectl -t reports syntax errors. Do not reload until it returns a successful syntax result. apachectl -S dumps how Apache parsed the virtual-host configuration, including the address and port, the order of blocks, and the file and line associated with each host. Apache’s troubleshooting guidance specifically recommends this command after configuration changes. On Windows, use the equivalent executable command, httpd.exe -S.

Read the output rather than merely checking that the command runs. Confirm that:

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.
  • The intended configuration file appears in the parsed map.
  • The block is attached to the expected address and port, such as *:80 or *:443.
  • The exact ServerName and aliases are present.
  • No earlier block is claiming the same address and port in a way that explains the response.

Once the test passes, reload Apache using the service method appropriate for your operating system. A reload applies the corrected configuration without requiring a full machine restart.

5. Understand why the default Apache page appears

If the incoming Host value does not match any ServerName or ServerAlias on the selected address and port, Apache serves the first name-based virtual host for that combination. That first block is the default for unmatched names. On many installations it is the distribution’s default site, so the default Apache page is a useful symptom rather than proof that the files in your own directory are missing.

Common causes include:

  • The site configuration was created but never enabled or included.
  • The requested alias, often www, is absent.
  • DNS points to another server or address family.
  • The request is using HTTPS while only an HTTP block exists.
  • The desired block is attached to a different IP or port.
  • A hostname typo causes Apache to fall back to the first block.

6. Separate virtual-host selection from filesystem mapping

Once you have proved that the correct block answers, verify its path. Apache appends the URL path to the absolute DocumentRoot. If the root is /var/www/example, a request for /images/logo.svg is looked up beneath that directory. A request for / invokes the configured DirectoryIndex, commonly an index HTML or PHP file.

  • Confirm that the directory exists at the exact path shown in the parsed configuration.
  • Confirm that the expected index file is in that directory and that its spelling and case match the URL and filesystem.
  • Confirm that Apache’s service account can traverse the parent directories and read the files.
  • Check application routing rules if a real file works but framework routes return errors.

A 404 after the correct virtual host has been selected usually indicates a missing path or application route. A 403 usually indicates access or permission rules. A completely different branded site points back to DNS, port, hostname matching, or virtual-host order rather than to DocumentRoot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

7. Use logs and a deliberately nonexistent URL

Watch the selected virtual host’s access and error logs while making a request. The example configuration above writes to separate files, which makes it easier to tell which block handled the request. Look for the requested host, status code, mapped path, permission errors, and rewrite or application messages.

Apache’s troubleshooting guidance recommends requesting a URL that is guaranteed not to exist. Use a unique path such as /vhost-check-9f3c2b, then inspect which access log records the request and which error log records the result. This avoids confusing a cached homepage with the site that actually answered. Remove any temporary marker files or diagnostic headers after testing.

Build a correct HTTP and HTTPS configuration

For HTTP, keep the hostname aliases and directory in one intentional block:

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example
    ErrorLog ${APACHE_LOG_DIR}/example-error.log
    CustomLog ${APACHE_LOG_DIR}/example-access.log combined
</VirtualHost>

For HTTPS, create or verify a corresponding *:443 block. It must contain the certificate directives required by your Apache installation and should repeat the same hostnames. Decide explicitly whether it serves the same DocumentRoot or redirects to another URL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example
    # certificate directives required by your installation
</VirtualHost>

Do not assume that an HTTP redirect automatically makes HTTPS select the right site. Apache must first choose a port-443 virtual host in order to issue that redirect. If the 443 block is missing or has different aliases, HTTPS may show the default page or another site before any redirect rule can run.

Use the symptom to choose the fix

Observed result Most likely layer Checks to perform
DNS lookup returns another server address DNS Correct the A, AAAA, or CNAME record and wait for its TTL.
Domain shows Apache’s default page Hostname match, vhost order, DNS, or missing scheme-specific block Run apachectl -S; verify aliases, enabled files, destination port, and returned IP.
Domain shows a different complete site Wrong virtual host selected Compare the request’s host and port with ServerName/ServerAlias; inspect the first block for that address and port.
Correct site branding but a 404 Filesystem path or application routing Check the selected block’s absolute DocumentRoot, URL path, index files, and rewrite rules.
Correct site but a 403 Access or filesystem permissions Verify directory traversal, file readability, and Apache access directives.
HTTP works but HTTPS does not Port 443 configuration, certificate setup, or DNS for the HTTPS destination Inspect the *:443 block and test HTTPS independently.
Root URL loads the wrong file or directory listing behavior DirectoryIndex or index-file placement Confirm the configured index filename exists beneath the selected DocumentRoot.

Common cases and targeted repairs

The apex works, but www shows the default site

Add www.example.com to ServerAlias in the relevant HTTP and HTTPS blocks, then validate with apachectl -t, inspect with apachectl -S, reload, and test both names. Also verify that DNS for www resolves to the same intended server.

HTTP works, but HTTPS shows another directory

Inspect the 443 map, not just the port-80 file. Ensure the TLS block contains the requested hostname, points to the intended root or redirect, and is attached to the address Apache receives. A separate 443 block is required because virtual-host selection includes the port.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

The file was edited, but Apache still behaves unchanged

The file may not be loaded, may have a syntax error that prevented a reload, or may not be the file Apache is reading. Run the configuration test and apachectl -S; the parsed output identifies the active file and line. Only after a successful test should you reload and retest.

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

The server IP shows one site while the domain shows another

An IP-only request has no matching domain name, so Apache uses the default virtual host for that address and port. That response is not a reliable test of a named site. Test with the real hostname in the request and verify DNS. For controlled diagnostics, use a local hosts-file entry or an HTTP client that sends the intended Host value while connecting to the server address.

Only some visitors see the wrong site

Check whether different resolvers receive different A or AAAA answers, whether an old DNS TTL is still cached, and whether IPv6 reaches a server whose Apache configuration differs from the IPv4 server. Compare responses from multiple networks and test each returned address directly with the intended hostname.

Controlled tests that avoid misleading browser results

Browsers can retain redirects, cached pages, or an old DNS answer, so make the layers explicit during troubleshooting. First resolve the name from the same network as the affected visitor. Then request both schemes and record the status code, redirect target, and response headers. A unique nonexistent path is especially useful because a 404 in the expected access log proves that Apache received the request in that virtual host, even when the homepage is cached or generated by an application.

For a server that has several addresses, test each returned address while preserving the intended hostname in the request. A hosts-file override is appropriate for a single client while a DNS change is pending; remember to remove it afterward so later tests use normal resolution. An IP-only browser test is not equivalent: without the domain name in the request, Apache has no matching ServerName and may intentionally return the first virtual host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What not to change first

Do not move files, rename the directory, or replace the default site merely because the default page appears. Those actions change the filesystem while leaving DNS, the Host match, or the port-443 selection untouched. Likewise, do not add a second copy of the same hostname to several blocks as a quick fix; apachectl -S will show the order, and the earlier block can continue to win. Establish which address, port, and hostname Apache actually selected, then correct one layer at a time.

Keep the apex and www decision consistent. If both names should show the same content, include both as aliases in both scheme-specific blocks. If one should redirect, make that behavior intentional and test the redirect from HTTP and HTTPS separately. This prevents a successful apex test from hiding a broken alias or a mismatched TLS block.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Final verification checklist

  1. Resolve the apex and every required alias; confirm the returned addresses are intentional.
  2. Test HTTP and HTTPS separately and note the destination port.
  3. Confirm the requested hostname appears in ServerName or ServerAlias on that port.
  4. Run sudo apachectl -t and correct every syntax error.
  5. Run sudo apachectl -S and verify the parsed file, address, port, aliases, and order.
  6. Reload Apache only after the configuration test succeeds.
  7. Confirm the selected block’s absolute DocumentRoot, index file, and read permissions.
  8. Watch the relevant access and error logs during a request.
  9. Request a unique nonexistent path to prove which virtual host answered.
  10. Remove temporary diagnostic files or headers and retest the canonical URLs.

The reliable fix is the one that identifies the failing layer instead of changing directories at random. DNS determines which server receives the request; IP and port determine the group of virtual hosts Apache considers; the Host value selects a block; and only then does DocumentRoot determine which files are served.

Frequently Asked Questions

Why does my domain show Apache’s default page?

Usually the hostname did not match a ServerName or ServerAlias on the selected address and port, so Apache served the first virtual host. Check DNS, aliases, enabled configuration, HTTPS coverage, and apachectl -S output.

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

Why does the IP address show a different site than the domain?

An IP-only request does not include the named host Apache needs for virtual-host matching. Apache therefore serves the default block for that IP and port. Test with the real hostname and verify that DNS points to the same address.

Do I need a separate virtual host for HTTPS?

Yes. Apache selects virtual hosts by destination IP and port, so a working *:80 block does not configure port 443. Create or verify a *:443 block with the certificate settings, hostname aliases, and intended root or redirect.

Does adding a virtual host create the DNS record?

No. DNS records must be created at the DNS provider. A hosts-file entry is only a local override for the machine where it is added.

What does a 404 mean after the right site appears?

It generally means virtual-host selection succeeded and the requested URL path, index file, or application route is missing beneath the selected DocumentRoot. Check the absolute path and routing rules before changing DNS.

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

Why do only some visitors see the wrong site?

Different visitors may receive different cached A or AAAA answers, or IPv6 may reach a server whose Apache configuration differs from IPv4. Compare DNS answers and responses from multiple networks, then test each returned address with the intended hostname.

The Bottom Line

Fix the layer that is failing: DNS must reach the intended server, the request must use the right IP and port, the hostname must match the correct virtual host, and only then can Apache’s absolute DocumentRoot serve the expected files. Use apachectl -t, apachectl -S, separate HTTP/HTTPS tests, and per-vhost logs before changing directories.

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.