Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsTo host several domains on one Debian VPS, point every domain’s DNS record at the VPS, create one Apache virtual-host file per site in /etc/apache2/sites-available/, enable each file with a2ensite, validate with apache2ctl configtest, and reload Apache. Each host normally needs a ServerName and DocumentRoot; add ServerAlias for names such as www. Configure HTTPS separately with port 443 virtual hosts and certificates.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
This guide covers the complete workflow on a Debian VPS, including file layout, permissions, DNS testing, host ordering, TLS, logging, and fixes for the wrong-site, 403, syntax, and certificate errors that commonly appear during setup.
As an Amazon Associate I earn from qualifying purchases.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
What an Apache virtual host does
A virtual host lets one Apache installation serve different websites according to the hostname in each HTTP request. Name-based hosting is the usual choice on a VPS: several domains share one IP address and port, while Apache compares the request’s Host header with the ServerName and ServerAlias values in its configuration.
The arrangement works only when name resolution and Apache’s configuration agree. A browser first resolves example.com to an address. It then connects to that address and sends the hostname. Apache chooses the matching virtual host and serves the directory assigned to that host. If no name matches, Apache uses the first enabled virtual host for that address and port as the fallback.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
| Component | Purpose |
|---|---|
| DNS A or AAAA record | Maps a domain or subdomain to the VPS IPv4 or IPv6 address. |
ServerName |
Declares the primary hostname for a virtual host. |
ServerAlias |
Adds alternate hostnames, such as www.example.com. |
DocumentRoot |
Maps the hostname to the directory containing the site files. |
a2ensite |
Creates an enabled-site symlink for a definition in sites-available. |
apache2ctl configtest |
Checks configuration syntax before a reload. |
Plan the sites before changing Apache
Choose the hostnames
Write down every name you intend to serve. For a typical site this may be example.com and www.example.com. The first becomes ServerName; the second becomes ServerAlias. If you also need blog.example.com, decide whether it is a separate site with its own document root or merely another alias for the same content.
Choose a separate document root
Keeping each site in its own directory makes deployments, backups, permissions, and logs easier to reason about. A conventional layout is /var/www/example.com/public_html. Replace the domain and path with values appropriate to your application. Do not point two unrelated sites at the same directory by accident.
Recommended Free Tools
Check administrative access and network prerequisites
- Use an account authorized to administer the VPS and run commands through
sudo. - Know the VPS IPv4 address and, if used, its IPv6 address.
- Ensure DNS control is available for every hostname.
- Plan how application files will be deployed and which account should own them.
- Confirm that the VPS firewall and provider networking permit the HTTP and HTTPS traffic your deployment requires.
Install Apache and verify the service
On a minimal Debian server, install Apache from Debian’s repositories:
sudo apt update
sudo apt install apache2
Enable the service at boot and start it immediately:
sudo systemctl enable --now apache2
Check its current state:
sudo systemctl status apache2
A running service should show an active state. Before adding your own host, opening the VPS address in a browser or requesting it with curl may display Debian’s default page. That page is served by the stock default host, not by a site you have yet configured.
Create a document root and test content
Create the first site’s directory and a small file that proves Apache is reaching the intended path:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, 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 minutesudo mkdir -p /var/www/example.com/public_html
sudo nano /var/www/example.com/public_html/index.html
Use simple test content such as:
<!doctype html>
<html lang='en'>
<head><meta charset='utf-8'><title>Example.com test</title></head>
<body><h1>example.com is working</h1></body>
</html>
Apache must be able to traverse every parent directory and read the files. A common static-site baseline is ownership by the account that deploys the files and read/execute access for Apache. If your deployment model permits Apache to write uploads or cache files, grant write access only to the specific directories that need it rather than making the entire tree writable.
sudo chown -R $USER:$USER /var/www/example.com
sudo find /var/www/example.com -type d -exec chmod 755 {} ;
sudo find /var/www/example.com -type f -exec chmod 644 {} ;
The exact ownership policy depends on whether files are deployed by a release user, a CI account, or another service. The important checks are that the Apache process can execute (traverse) each directory, read the requested files, and access the path named by DocumentRoot.
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
Create the HTTP virtual-host file
Debian stores available site definitions in /etc/apache2/sites-available/. Create a file whose name identifies the site:
sudo nano /etc/apache2/sites-available/example.com.conf
Use this minimal but operational configuration:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html
<Directory /var/www/example.com/public_html>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined
</VirtualHost>
Understand each directive
<VirtualHost *:80>accepts HTTP traffic on port 80 for addresses assigned to the server. The asterisk means Apache does not require a separate block for each local IP.ServerName example.comis the canonical name Apache uses when matching the request hostname.ServerAlias www.example.commakes the second hostname use the same host and document root. Add additional aliases only when they are intentional.DocumentRootidentifies the directory from which files are served.- The
<Directory>section grants access to that filesystem path.AllowOverride Nonemeans Apache ignores per-directory.htaccessfiles there; change it only when the application specifically requires overrides and you understand the security and maintenance cost. ErrorLogandCustomLogkeep this site’s failures and requests separate from other hosts.${APACHE_LOG_DIR}expands to Debian’s Apache log directory.
Every opening Apache container must have a matching closing tag. A missing </VirtualHost> or malformed directive will prevent a reload, which is why syntax validation belongs before service changes.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Add more domains on the same VPS
Repeat the document-root and configuration process for each site. For example, a second host could use /var/www/other.example/public_html and a file named /etc/apache2/sites-available/other.example.conf:
<VirtualHost *:80>
ServerName other.example
ServerAlias www.other.example
DocumentRoot /var/www/other.example/public_html
<Directory /var/www/other.example/public_html>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/other.example-error.log
CustomLog ${APACHE_LOG_DIR}/other.example-access.log combined
</VirtualHost>
Do not combine unrelated domains in one block merely to reduce the number of files. Separate definitions make it clear which aliases, directory permissions, logs, and later TLS settings belong to each site.
Enable and order virtual hosts
Enable a site with a2ensite
Run the Debian helper with the filename from sites-available:
sudo a2ensite example.com.conf
sudo a2ensite other.example.conf
a2ensite does not copy the configuration. It creates a symlink in /etc/apache2/sites-enabled/, where Apache reads enabled sites. This separation lets you keep definitions available without activating them.
Free tools Windows power users keep installed
One-click scans. No signup required.
Disable the stock site when appropriate
If the default Debian page should no longer answer unmatched requests, disable its definition:
sudo a2dissite 000-default.conf
Do this only after deciding which host should handle requests that do not match a declared name. Removing the stock site without an intentional replacement can make the first remaining host receive unexpected traffic.
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
Understand fallback order
For a given address and port, Apache uses the first enabled virtual host as the fallback when no ServerName or ServerAlias matches. The filename prefix often influences symlink ordering, but you should verify the parsed result instead of relying on naming conventions. A deliberate fallback can serve a neutral page or reject unrecognized hostnames; an accidental fallback can expose the wrong site.
List the configuration Apache actually parsed:
sudo apache2ctl -S
The output shows virtual hosts, their addresses, names, aliases, and the default host for each address and port. Use it whenever a request appears to reach an unexpected site.
Validate the configuration before reloading
Always run a syntax check after editing or enabling a file:
sudo apache2ctl configtest
A successful check normally prints Syntax OK. If Apache reports an error, note the file and line number, correct that definition, and run the check again. Do not reload while the check is failing; a bad configuration can leave the service unable to start or reload.
Once the check succeeds, apply the changes with a graceful reload:
sudo systemctl reload apache2
A reload lets existing workers finish current requests while new workers use the updated configuration. If the service manager reports a failure, inspect the unit log and Apache’s error log:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →sudo journalctl -u apache2
sudo tail -n 50 /var/log/apache2/error.log
Correct the reported cause and repeat apache2ctl configtest before trying another reload.
Point DNS at the VPS and test each hostname
Create an A record for each hostname that should resolve over IPv4, pointing it to the VPS IPv4 address. Create an AAAA record when the site is intentionally reachable over IPv6 and Apache is listening on that address. The record names must match the names in ServerName or ServerAlias.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
DNS changes are controlled by the domain’s authoritative provider and may take time to appear in recursive resolvers. Check what your current resolver returns:
dig +short example.com A
dig +short example.com AAAA
getent hosts example.com
After the expected address appears, make an HTTP request that includes the hostname:
curl -I http://example.com
curl -I http://www.example.com
Check the status line and headers, then request a page body if you need to confirm its contents:
curl http://example.com/
When testing before public DNS is ready, you can resolve a hostname to a chosen address for one request with curl --resolve. Use the VPS address and the exact hostname so Apache receives the same Host value a real browser would send:
curl --resolve example.com:80:203.0.113.10 http://example.com/
Replace the documentation-only address above with your VPS address. This technique tests Apache’s host matching without changing public DNS.
Configure HTTPS virtual hosts
HTTP and HTTPS are separate listener contexts. A working port-80 block does not automatically provide TLS. For each HTTPS hostname, create a <VirtualHost *:443> block and add certificate directives supplied by your chosen certificate issuance workflow. The certificate must cover every hostname clients will use, either through the certificate’s names or subject-alternative names.
A conceptual structure is:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html
<Directory /var/www/example.com/public_html>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /path/to/full-chain.pem
SSLCertificateKeyFile /path/to/private-key.pem
ErrorLog ${APACHE_LOG_DIR}/example.com-ssl-error.log
CustomLog ${APACHE_LOG_DIR}/example.com-ssl-access.log combined
</VirtualHost>
</IfModule>
The paths in this example are placeholders for certificate files produced by your certificate workflow; do not create empty files at those paths. Enable the SSL module and any Debian-provided SSL configuration required by your workflow, then validate and reload as usual. Protect the private key with restrictive filesystem permissions.
How SNI selects an HTTPS site
For multiple HTTPS sites sharing one IP address, Server Name Indication (SNI) lets a compatible TLS client send the requested hostname during the handshake. Apache can then select the corresponding port-443 virtual host and certificate. Clients or legacy software without SNI may receive the default certificate, so test with current browsers and command-line clients.
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
Redirect HTTP only after HTTPS works
Once the certificate and port-443 host are confirmed, you can make the port-80 host redirect to HTTPS. Test the secure URL first, verify that the certificate covers both the primary and alias names, then add a redirect deliberately. Keep the port-80 block available so clients can receive the redirect and so certificate-validation workflows can reach the site when required.
Keep logs useful for several sites
Shared logs make it difficult to identify which domain generated a request. Per-host ErrorLog and CustomLog directives, as shown above, separate operational data. Use a consistent naming scheme based on the hostname and rotate or retain logs according to your server’s policy.
If you must use a shared access log, a vhost-aware LogFormat can include the hostname so entries remain attributable. Separate files are usually simpler for incident diagnosis, application debugging, and checking whether DNS traffic is reaching the intended site.
Name-based, IP-based, and port-based hosting compared
| Approach | How Apache distinguishes sites | When it fits | Trade-offs |
|---|---|---|---|
| Name-based | Hostname in the HTTP request; multiple names share an IP and port. | Most domains on a single VPS. | Requires correct DNS and host headers; unmatched names use the first host. |
| IP-based | Each virtual host is bound to a different local IP address. | Cases that require address-level separation or software that cannot use host headers. | Needs multiple addresses and corresponding network configuration. |
| Port-based | Different TCP ports identify services or sites. | Internal tools or deliberate nonstandard endpoints. | Users must specify ports; it is not a normal replacement for public HTTP/HTTPS hosting. |
For HTTPS, name-based hosting additionally depends on SNI so Apache can choose the certificate during the TLS handshake. HTTP name matching and HTTPS certificate selection should therefore be tested independently.
Troubleshoot the problems that matter most
The wrong site appears
- Confirm DNS with
dig +shortorgetent hosts. The hostname may still resolve to an old server or to an unintended IPv6 address. - Check spelling and capitalization of
ServerNameandServerAlias. A missing alias sends that name to another host. - Run
sudo apache2ctl -Sand verify that the expected host is listed on the correct address and port. - Inspect enabled-site order. The first host is the fallback for unmatched requests, so an unintended default can appear correct when the request hostname is absent or mistyped.
- Make sure the edited file is in
sites-availableand that its enabled symlink exists insites-enabled. Runa2ensiteagain if necessary, then validate and reload.
Apache returns 403 Forbidden
- Check execute permission on every parent directory between the filesystem root and
DocumentRoot. Apache cannot reach a readable file through a non-traversable directory. - Confirm that the
<Directory>path exactly matches the document root and includesRequire all grantedwhen public access is intended. - Verify the requested file exists and is readable by the Apache process.
- Look at the site-specific error log for the precise path and authorization message.
- If an application depends on
.htaccess, remember thatAllowOverride Nonedisables it. Enable only the override classes the application needs, then recheck the security implications.
apache2ctl configtest reports a syntax error
Use the file and line number in the error as the starting point. Common causes include a misspelled directive, an unclosed <VirtualHost> or <Directory> block, a certificate path that contains invalid syntax, or a module-dependent directive used before its module is enabled. Fix one error at a time and rerun the test until it reports Syntax OK.
Reload fails even though the file looks correct
Run sudo apache2ctl configtest directly and read sudo journalctl -u apache2. The journal can reveal a port conflict, an unavailable certificate file, a permission problem, or an error in another enabled site. Apache parses the complete enabled configuration, so an unrelated host can block a reload of the site you just edited.
HTTPS shows a certificate mismatch
- Verify that the browser requested the hostname you think it did, including whether it used
www. - Confirm the matching
<VirtualHost *:443>has the correctServerNameand aliases. - Check that the certificate’s covered names include the requested hostname.
- Use
apache2ctl -Sto inspect the port-443 default and parsed host order. - Confirm that the client supports SNI and that DNS is not sending it to a different server or address.
Logs do not identify the domain
Add per-host ErrorLog and CustomLog directives, or use a log format that records the virtual-host name. After reloading, make one request to each domain and verify that each request lands in the expected file.
Production checklist
- Each hostname has the intended A and, when applicable, AAAA record.
- Every site has its own document root and a clear deployment ownership policy.
- Each definition contains the correct
ServerName, aliases, andDocumentRoot. - The corresponding files are enabled with
a2ensite. sudo apache2ctl configtestreturnsSyntax OK.sudo apache2ctl -Sshows the expected names, ports, and fallback host.- Apache was gracefully reloaded only after validation.
- HTTP requests using every hostname return the intended content.
- Port-443 hosts use certificates covering all names and have been tested with SNI-capable clients.
- Logs are separated or include the hostname, and the private key is not publicly readable.
- The fallback host is intentional rather than an accidental exposure of another site.
Useful command sequence for a new site
Once you understand the individual steps, this condensed sequence is a reliable repeatable workflow. Replace the domain, paths, and addresses with your own values:
sudo apt update
sudo apt install apache2
sudo systemctl enable --now apache2
sudo mkdir -p /var/www/example.com/public_html
sudo nano /var/www/example.com/public_html/index.html
sudo nano /etc/apache2/sites-available/example.com.conf
sudo a2ensite example.com.conf
sudo apache2ctl configtest
sudo apache2ctl -S
sudo systemctl reload apache2
dig +short example.com A
curl -I http://example.com
Do not treat the sequence as a substitute for reviewing permissions, DNS, host order, and TLS. Those decisions determine which content Apache serves and whether clients can reach it securely.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
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.




