To serve an app on your domain with Apache, complete two separate jobs: point the domain’s DNS records at the server’s public IP, then configure an Apache virtual host that handles that hostname. Use DocumentRoot for files Apache serves directly, or ProxyPass and ProxyPassReverse when the app runs on a private local port. Validate the configuration with apachectl configtest, inspect the parsed vhost map with apachectl -S, and only redirect HTTP to HTTPS after the TLS virtual host works.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What you need before changing Apache
Have these details ready before creating a virtual host:
As an Amazon Associate I earn from qualifying purchases.
- The domain name, such as
example.com, and every hostname you intend to serve, such aswww.example.com. - The server’s public IPv4 address and, if you use IPv6, its public IPv6 address.
- Administrative access to the DNS provider and the machine running Apache.
- Whether the app is a static build that can be read from disk or a running process listening on a local address and port.
- Firewall or cloud security-group access for TCP ports 80 and 443.
DNS and Apache do not configure each other. Creating a virtual host does not publish a DNS record. Conversely, a correct DNS record does not tell Apache which site to return. The domain must resolve to the server before a browser can reach the intended virtual host.
Set the DNS records first
Create an A record for example.com that points to the server’s public IPv4 address. If you want the www hostname, create an A record for www.example.com as well, or use the DNS provider’s supported alias mechanism. Add an AAAA record only when the server is reachable over IPv6 and Apache is listening on that address.
#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.
DNS changes may be cached according to the records’ TTL. Verify the result from outside the server’s network with a resolver or DNS diagnostic service. Do not treat a local hosts-file override as proof that public DNS is correct.
How Apache chooses a virtual host
Apache first narrows the candidates by destination IP address and port. For name-based virtual hosts, it then compares the HTTP Host header—or the TLS SNI hostname for HTTPS—with each vhost’s ServerName and ServerAlias. If no hostname matches, Apache uses the first name-based vhost for that IP and port as the default.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteThis ordering explains common “wrong website” symptoms. A request can reach the right server while still being served by an earlier vhost because the hostname is absent, misspelled, missing from ServerAlias, or arriving on an address and port that the file does not cover.
Run this command whenever you are unsure what Apache actually loaded:
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
apachectl -S
On Windows installations, the equivalent is commonly:
httpd.exe -S
The output shows Apache’s parsed addresses, ports, vhost order, and the configuration file associated with each entry. It is more reliable than guessing from filenames or directory listings.
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 →Choose the serving model
| Question | Static site | Running application |
|---|---|---|
| Where content comes from | Files under DocumentRoot |
A backend process reached through a proxy |
| Typical Apache directives | DocumentRoot and a Directory policy |
ProxyPreserveHost, ProxyPass, and ProxyPassReverse |
| Required components | Apache’s core HTTP and file-serving functionality | Proxy modules required by the platform and protocol |
| Process lifecycle | Deploying files; no app process for Apache to restart | Deploying and supervising a separate app process, commonly on a private port |
| Header and URL handling | Apache serves the request directly | Apache forwards requests and responses; the app must handle forwarded host and scheme information correctly |
| HTTPS termination | Apache can terminate TLS before serving files | Apache can terminate TLS and proxy decrypted requests to the backend |
Use one model per hostname unless you deliberately combine them with path-based rules. A static build placed in a document root should not also be proxied to a process on the same vhost without a clear routing design.
Configure Apache for a static site
The following is a name-based HTTP vhost. Replace the domain and filesystem path with your values.
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)
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example
<Directory /var/www/example>
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/example-error.log
CustomLog ${APACHE_LOG_DIR}/example-access.log combined
</VirtualHost>
What each directive does
<VirtualHost *:80>makes this definition eligible for HTTP requests received on port 80 on the addresses represented by the wildcard.ServerNameis the primary hostname. It should match the domain users type.ServerAliasadds additional hostnames, such aswww.example.com. Add every alias you intend to serve; an alias not listed here can fall through to another vhost.DocumentRootidentifies the directory containing the built site files.- The
Directoryblock controls access to that filesystem path.Require all grantedpermits Apache to serve it, whileAllowOverride Nonemeans per-directory override files are not used for this path. ErrorLogandCustomLogkeep this site’s failures and requests separate from other virtual hosts, which makes diagnosis substantially easier.
Create the root and deploy the build
- Create
/var/www/example(or your chosen path) with the permissions required by the Apache service account. - Copy the app’s production build into that directory. Ensure the document root contains the expected entry file and assets rather than an extra nested build directory.
- Save the vhost in the location used by your operating system’s Apache package.
- Enable the site using that distribution’s mechanism. The exact command and enabled-sites layout vary by operating system and package.
- Check the complete Apache configuration:
apachectl configtest
Continue only when the result reports a successful syntax check. A successful check means Apache can parse the configuration; it does not prove that DNS, permissions, firewall rules, or the application itself are correct.
- Reload Apache using the service manager provided by your operating system. Reloading applies the configuration without unnecessarily terminating existing connections; the exact command is platform-specific.
- Request both the primary hostname and every alias, then inspect the site-specific access and error logs.
Configure Apache as a reverse proxy for a running app
For an app listening privately on 127.0.0.1:3000, use a proxy vhost instead of DocumentRoot:
Recommended Free Tools
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
ErrorLog ${APACHE_LOG_DIR}/example-error.log
CustomLog ${APACHE_LOG_DIR}/example-access.log combined
</VirtualHost>
Understand the proxy directives
ProxyPreserveHost Onforwards the original host name so the backend can distinguishexample.comfrom other hostnames and generate correct absolute URLs.ProxyPass / http://127.0.0.1:3000/sends requests received at the public root path to the local app.ProxyPassReverse / http://127.0.0.1:3000/rewrites relevant response headers so redirects generated by the backend point back through the public Apache URL.
Enable the proxy modules required by your Apache package and the backend protocol before reloading. A typical HTTP backend needs the platform’s HTTP proxy support; do not assume a module is loaded merely because Apache itself starts. Check the package documentation or loaded-module list for your operating system.
Keep the backend private unless it is intentionally public
Binding the app to 127.0.0.1 keeps direct access on the server and makes Apache the public entry point. If the app must listen on another interface or host, restrict that listener with the host firewall and cloud security-group rules. Exposing both Apache and the backend creates a second public route that may bypass TLS, authentication, logging, or request limits.
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
The backend must also trust forwarded host and scheme headers according to its framework. Otherwise it may create HTTP links while users connected over HTTPS, reject a legitimate host, or apply incorrect callback and cookie settings. Configure this trust deliberately; accepting arbitrary forwarded headers from an untrusted public client can create a security problem.
Deploy and restart the app separately
Apache only forwards traffic; it does not start, supervise, or update the application process. Use the process manager appropriate to the app and operating system, and verify that the process is listening on the exact address and port in ProxyPass. If the process stops, Apache will normally return a gateway error even though its own configuration remains valid.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Add HTTPS after HTTP works
HTTPS requires a separate TLS virtual host on port 443 and a certificate/key configuration supplied by your chosen certificate workflow. A minimal structure is:
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
SSLEngine on
# Certificate and private-key directives go here.
# Add either the static-site directives or the reverse-proxy
# directives appropriate for this hostname.
</VirtualHost>
The certificate must cover every hostname users will access. If www.example.com is listed as an alias but omitted from the certificate, browsers will report a name mismatch even though Apache selected the expected vhost.
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.
Complete certificate issuance and confirm renewal before forcing HTTP to HTTPS. Once the 443 vhost serves the application correctly, add an explicit port-80 redirect for the same hostnames. A redirect configured before TLS works can turn a recoverable setup problem into a loop or a site that is unreachable over both schemes.
Redirect only the intended hostnames
Keep the redirect in the port-80 vhost that owns the domain. Do not place a broad redirect in an unrelated default vhost unless every hostname arriving there should be redirected. This matters on servers hosting multiple domains: an unmatched request may otherwise be sent to the wrong site or redirected to a certificate that does not cover it.
Support multiple domains and aliases
Each domain needs DNS records pointing to the server, and each hostname needs coverage in ServerName or ServerAlias. You can place several aliases in one vhost when they intentionally serve identical content, or create separate vhosts when the domains need different roots, applications, logs, or policies.
| Design | DNS requirement | Apache requirement | Operational consequence |
|---|---|---|---|
One domain with www |
Records for both names, unless one is deliberately redirected by DNS | One ServerName and a ServerAlias; certificate names for HTTPS |
Both names reach the same content or proxy |
| Several domains sharing one app | Every domain resolves to the server | List each hostname or create matching vhosts; preserve the host if the app needs it | One deployment can answer several public names |
| Several independent sites | Each domain resolves to the server | Separate vhosts, roots or proxy targets, and logs | Vhost order and hostname spelling become critical |
For HTTPS, certificate coverage must follow the same hostname design. A DNS record alone does not make a name valid for TLS, and a certificate alone does not direct traffic to Apache.
Verify the complete request path
Test in layers so you know which system failed.
- DNS: Query the public resolver result for the bare domain and each alias. Confirm the returned address is the server you configured, including both
AandAAAAresults when IPv6 is enabled. - Apache’s parsed map: Run
apachectl -S(orhttpd.exe -Son Windows) and confirm the expected file owns the hostname and port. - Syntax: Run
apachectl configtestbefore every reload. - HTTP response: Request headers for each hostname:
curl -I http://example.com
curl -I http://www.example.com
- HTTPS response: After the certificate and 443 vhost are ready, test the HTTPS names and inspect the certificate name and redirect behavior.
- Logs: Correlate the request time with the vhost’s access and error logs. A request in another vhost’s log is evidence that matching, DNS, or the test hostname is wrong.
- Network policy: Check host firewalls and cloud security groups for ports 80 and 443. A correct vhost cannot answer a connection blocked before it reaches Apache.
Troubleshoot the most common failures
The domain shows another site
- Check that public DNS points to the intended server rather than an old address.
- Confirm the request hostname exactly matches
ServerNameorServerAlias. - Use
apachectl -Sto check whether another vhost appears first for the same address and port. - Test the bare domain and
wwwseparately; configuring one does not automatically configure the other. - For HTTPS, verify that the request reaches the 443 vhost and that its SNI name is covered.
Apache returns a 404 for a static site
- Confirm
DocumentRootpoints to the directory containing the deployed entry file. - Check that the
Directorypath exactly matches the document root and permits access. - Inspect the vhost-specific error log for path or permission details.
The proxy returns a gateway error
- Verify that the app process is running and listening on the address and port in
ProxyPass. - Check whether the app is bound only to a different interface, such as an IPv6 loopback address, while Apache is targeting IPv4 loopback.
- Confirm the required proxy modules are loaded and the configuration passes
apachectl configtest. - Read both Apache’s error log and the application log; the failure may be an app crash rather than a routing error.
HTTPS loops, fails, or shows the wrong certificate
- Make sure the 443 vhost has
SSLEngine onand the certificate and key settings supplied by your certificate workflow. - Check that every requested hostname is present in the certificate and in the vhost’s name list.
- Remove or delay the HTTP-to-HTTPS redirect until a direct HTTPS request succeeds.
- Confirm port 443 is allowed through every firewall and cloud security group.
Operational checklist
- DNS
A/AAAArecords resolve publicly to the intended server. - Every public hostname appears in
ServerNameorServerAlias. - The static document root contains the built files, or the proxy target is listening privately on the configured port.
- Site-specific access and error logs are writable and being updated.
apachectl configtestsucceeds before reload.apachectl -Sshows the expected vhost order and ports.- Ports 80 and 443 are allowed by host and cloud network controls.
- The TLS vhost works before an HTTP redirect is enabled.
- The backend framework is configured for the forwarded host and scheme when Apache proxies requests.
- Application supervision and Apache reloads are treated as separate operational tasks.
Bottom line
Point DNS at the server, then make Apache’s vhost explicitly own each hostname. Serve compiled files with DocumentRoot; proxy a running app with ProxyPreserveHost On, ProxyPass, and ProxyPassReverse. Use apachectl configtest and apachectl -S before troubleshooting browsers, add a working 443 vhost and certificate before redirecting HTTP, and keep the backend private unless there is a deliberate reason to expose it.
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.




