PC 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 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchYou can serve several domains from one Apache server and one IP address by using name-based virtual hosting. Point every domain’s DNS records at that server, then create a separate <VirtualHost> block for each independent website. Apache examines the request hostname and selects the matching ServerName or ServerAlias.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
A single block can serve multiple names only when they are alternate names for the same site. Independent sites need separate blocks and document roots. HTTPS adds a matching *:443 configuration, certificate coverage, and TLS SNI considerations.
As an Amazon Associate I earn from qualifying purchases.
Free tools Windows power users keep installed
One-click scans. No signup required.
What “several domains on one virtual host” actually means
The usual goal is to host multiple domains on one Apache installation, server, or public IP. Apache calls each site definition a virtual host. You do not normally place unrelated websites in one block. Instead, define one name-based <VirtualHost> block per distinct site and let Apache choose among them by hostname.
For example, example.com and example.net can share an IP while serving different files. Conversely, www.example.com and example.com usually belong in one block through ServerAlias because they are alternate names for the same content.
#1 Best Overall
The Apache Software Foundation describes name-based hosting as “usually simpler.” The method scales because the IP address identifies the server, while the hostname identifies the site.
How Apache chooses the site
- The client resolves the domain name through DNS and connects to an IP address and port.
- Apache groups configured virtual hosts by that address and port, such as
*:80for HTTP or*:443for HTTPS. - For HTTP, Apache reads the request’s
Hostheader. For TLS connections, it can use the SNI hostname supplied during the TLS handshake, followed by the HTTP hostname. - Apache compares that name with each block’s
ServerNameandServerAlias. - The matching block supplies the document root and other site settings.
Configuration order matters. For a particular IP-and-port group, the first listed virtual host becomes the fallback when no ServerName or ServerAlias matches. A typo, missing alias, or request sent to an unexpected hostname can therefore display the first site in that group.
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 →DNS must be correct before Apache can be tested
Apache configuration does not create DNS records. Add an A record for each IPv4 name and an AAAA record when the server is reachable over IPv6. Use the names that visitors will actually request, including any www alias you intend to serve.
DNS preparation checklist
- List every hostname: apex names such as
example.com, subdomains, andwwwnames. - Point each name to the server’s intended IPv4 address with an
Arecord and, where applicable, to its IPv6 address with anAAAArecord. - Remove stale records that still point to an old server or service.
- Check that public DNS returns the intended address before diagnosing Apache.
- Remember that DNS propagation and resolver caching can make a change appear gradually rather than immediately.
On a Unix-like system, a query such as dig +short example.com shows the returned addresses. On Windows, nslookup example.com provides the equivalent basic check. The result should match the address on which Apache is listening.
Choose the right layout before writing configuration
Decide whether the names represent independent sites or merely alternate names. This choice determines document roots, redirects, logs, access rules, and certificates.
| Situation | Recommended layout | Reason |
|---|---|---|
| Two unrelated websites | Separate <VirtualHost> blocks and separate document roots |
Files, permissions, deployments, and failures remain isolated. |
| One site with several public names | One block with one ServerName and additional ServerAlias values |
All names intentionally serve the same content and policy. |
| One preferred canonical name | Serve the canonical name and redirect alternate names explicitly | Visitors, search engines, cookies, and links converge on one hostname. |
| HTTP and HTTPS for a site | Usually one *:80 block and one *:443 block |
Each listening port needs its own matching virtual-host definition. |
| Strict tenant or project separation | Separate roots, logs, users or permissions, and access controls | A mistake in one site is less likely to expose another site’s files. |
| Small set of closely related names | Shared content and, where appropriate, shared logging | Less configuration overhead, but incidents are harder to attribute to one name. |
Do not use a shared document root merely because domains share a server. Shared content is a deliberate application decision; it is not required for name-based hosting.
Build the HTTP virtual hosts
The minimal configuration requires an explicit ServerName and a DocumentRoot in every name-based block. Add ServerAlias only for names that should reach that same site.
Rank #2
- Used Book in Good Condition
1. Create a directory for each site
Use distinct paths and place a test file in each one so a hostname can be identified during setup:
mkdir -p /var/www/example /var/www/example-net
echo 'example.com site' > /var/www/example/index.html
echo 'example.net site' > /var/www/example-net/index.html
Those paths are examples; use directories whose ownership and permissions match your operating system and deployment process.
2. Define one block per independent domain
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example
</VirtualHost>
<VirtualHost *:80>
ServerName example.net
ServerAlias www.example.net
DocumentRoot /var/www/example-net
</VirtualHost>
The first block serves requests for example.com and www.example.com. The second serves the two example.net names. A request for an unlisted hostname on port 80 goes to the first block in this address-and-port group, so do not rely on an accidental default.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minute3. Put the configuration where your distribution loads it
Apache installations differ in how they include site files. Debian- and Ubuntu-family systems commonly keep individual files under /etc/apache2/sites-available/ and enable them with a2ensite; other systems may include files from a central configuration directory. Follow the include structure already used by your installation rather than copying a path blindly.
4. Check syntax and reload
Run a configuration test before reloading. A successful test means Apache can parse the files; it does not prove that DNS, permissions, or certificates are correct. Reload using the service mechanism provided by your operating system, then test each hostname.
Use aliases deliberately
ServerAlias is for an additional name that should enter the same virtual host. Typical examples are an apex name and its www form:
ServerName example.com
ServerAlias www.example.com shop.example.com
If an alias should not serve the same content, create another virtual host instead. If the alternate name should permanently lead to a preferred name, configure an HTTP redirect in that alias’s site rather than silently serving duplicate content. The alias declaration itself does not create a redirect; it only makes Apache map the name to the block.
Add HTTPS with matching port-443 hosts
HTTP and HTTPS are separate address-and-port groups. For every HTTPS name you intend to serve, create a corresponding <VirtualHost *:443> block and select a certificate strategy that covers the requested names.
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example
SSLEngine on
SSLCertificateFile /etc/ssl/example/fullchain.pem
SSLCertificateKeyFile /etc/ssl/example/privkey.pem
</VirtualHost>
<VirtualHost *:443>
ServerName example.net
ServerAlias www.example.net
DocumentRoot /var/www/example-net
SSLEngine on
SSLCertificateFile /etc/ssl/example-net/fullchain.pem
SSLCertificateKeyFile /etc/ssl/example-net/privkey.pem
</VirtualHost>
The certificate paths above are illustrative; use the files issued and stored by your certificate-management process. Ensure that each certificate includes the exact DNS names clients will request, either as individual names or through an appropriate wildcard. Renewal is an operational task separate from virtual-host mapping.
Why SNI matters
Before encrypted HTTP headers are available, a TLS client can send the requested hostname as Server Name Indication (SNI). Apache uses that hostname to select among matching *:443 hosts and present the corresponding certificate. A missing or incorrect SNI name, an absent port-443 block, or a certificate that does not cover the name can produce a certificate warning or the wrong site even when the port-80 configuration is correct.
Decide how HTTP should behave
Some sites serve content on both ports; others use the port-80 block only to redirect to HTTPS. Whichever policy you choose, define it for every public name so that an unlisted alias does not fall through to an unrelated default host.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Separate logging and access controls when sites are independent
Virtual hosts can share Apache’s global settings, but independent sites usually benefit from their own access and error logs. Per-site logs make it possible to identify which hostname generated a request and to troubleshoot one application without mixing its traffic with another.
Keep filesystem permissions scoped to each document root. Review directory access rules, application configuration files, uploaded content, and symbolic links so that one site cannot read another site’s private data. If several names intentionally share an application, document that relationship and apply the same authentication, headers, and caching policy consistently.
Verify the parsed configuration, not just the files you edited
Use Apache’s virtual-host dump to see what the running configuration actually contains:
Rank #4
apachectl -S
On Windows installations, the equivalent command is:
httpd.exe -S
Inspect the output for each address-and-port group, the order of the hosts, every ServerName and ServerAlias, and the host Apache identifies as the default. This catches a file that was never included, a duplicate name, a typo, or a block loaded earlier than expected.
Test the hostname and the content together
After DNS resolves to the server, request each name and check that the response identifies the intended document root. A simple HTTP test is:
curl -i http://example.com/
curl -i http://example.net/
For a temporary test before DNS has propagated, you can send an explicit Host header to the server’s address:
curl -i -H 'Host: example.com' http://203.0.113.10/
Replace the example address with the server’s actual IPv4 address. This test exercises Apache’s hostname matching while bypassing the local resolver; it does not validate the public DNS record.
Test HTTPS separately
Request each HTTPS name and inspect the certificate and returned content. When testing an address directly, preserve the hostname through SNI with a hostname-aware client option rather than connecting only by numeric address. A valid certificate for one name does not prove that every other name has a matching certificate and virtual host.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why Apache shows the wrong site
The domain resolves to another server
If DNS returns an old address, Apache on the intended machine never receives the request. Compare the public A and AAAA answers with the server’s addresses, and check both records when clients may prefer IPv6.
Best Value
- Used Book in Good Condition
The name is missing from Apache
Confirm that the requested spelling appears exactly in ServerName or ServerAlias. A hostname omitted from the block is unmatched and can land on the first host for that port.
The edited file is not loaded
Run apachectl -S or httpd.exe -S. If the block does not appear, correct the include or site-enabling step and reload Apache after a successful syntax test.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →The request uses a different port
An HTTP request reaches the *:80 group; an HTTPS request reaches *:443. Adding a correct port-80 block does not configure HTTPS. Create and verify the corresponding port-443 host.
The TLS certificate belongs to another name
For HTTPS, check the SNI name sent by the client, the order and contents of the *:443 blocks, and the certificate’s name coverage. A certificate mismatch can make a correctly routed site appear broken.
A default host is masking the mistake
Because the first host in an address-and-port group is the fallback, a missing alias may consistently display the same unrelated site. Treat that page as evidence of an unmatched hostname, not as proof that DNS is correct.
Common configuration mistakes to avoid
- Expecting Apache to create DNS: virtual-host files do not publish records.
- Putting two unrelated roots in one block: one
DocumentRootserves that block; use separate blocks for separate sites. - Using an alias as a redirect:
ServerAliasmaps names; it does not issue an HTTP redirect. - Configuring only port 80: HTTPS requires its own port-443 mapping and certificate setup.
- Ignoring configuration order: an unmatched request uses the first host in its group.
- Testing only by IP address: an IP-only request does not represent the hostname-based selection visitors use.
- Mixing certificates and names: every HTTPS hostname must be covered by the certificate presented for its selected host.
- Sharing permissions casually: a common server does not require common filesystem access.
A repeatable deployment checklist
- Write down every public hostname and decide whether it is an independent site, an alias, or a redirect target.
- Create DNS
Aand, where needed,AAAArecords that point to the Apache server. - Create and permission a document root for each independent site.
- Add one
*:80block per site with an explicitServerNameandDocumentRoot. - Add only intentional
ServerAliasvalues. - Define the HTTPS policy, then add matching
*:443blocks and certificates for every HTTPS name. - Run the configuration syntax check and reload Apache.
- Run
apachectl -S(orhttpd.exe -S) and verify names, ports, file order, and fallback hosts. - Check DNS resolution, then test each hostname over HTTP and HTTPS with a hostname-aware client.
- Review logs, permissions, redirects, and certificate renewal for each independent site.
When one IP is no longer the right constraint
Name-based virtual hosting is appropriate when several domains can reach the same Apache listener and can share the server’s operational boundaries. Separate IP addresses may still be required by a legacy application, a network policy, or a service that cannot use hostname-based selection. Those cases are exceptions to the name-based pattern, not prerequisites for ordinary multi-domain hosting.
Recommended Free Tools
Quick Recap
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.




