October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Host Multiple WordPress Domains with Apache on a VPS

A practical guide to hosting several WordPress domains on one VPS with Apache, covering DNS, virtual hosts, separate installations versus Multisite, HTTPS certificates, validation and backups.
Length12 min Posted Quest giverVGSources Team

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.

Host multiple WordPress domains on one VPS by pointing every domain’s DNS records to the VPS address, then configuring one Apache name-based virtual host per domain. Each virtual host gets its own ServerName, aliases, document root, logs and (for independent sites) database. Apache selects the site from the request’s Host header, so separate IP addresses are normally unnecessary.

Decide the WordPress layout before writing configuration. Separate installations give each site its own files, database and update boundary. WordPress Multisite keeps several sites in one codebase and centralizes administration, but creates a larger shared failure and upgrade boundary. The procedure below covers both choices, then shows HTTPS issuance, validation and recovery checks.

As an Amazon Associate I earn from qualifying purchases.

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

How Apache serves several domains from one VPS

Apache’s name-based virtual hosting lets multiple hostnames share one listening IP address. DNS maps each hostname to the VPS; Apache then compares the hostname in each HTTP request with the ServerName and ServerAlias in its virtual-host definitions. Apache describes this approach as simpler because you configure DNS to map each hostname to the correct IP and configure Apache to recognize those hostnames.

DNS and Apache perform different jobs. Creating a virtual-host file does not create DNS records. A domain that still points elsewhere can never reach the intended virtual host, even when Apache’s syntax is perfect.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • 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.

The request path

  1. A visitor requests https://example.com or https://www.example.com.
  2. The domain’s A or AAAA record returns the VPS address.
  3. The connection reaches Apache on port 80 or 443.
  4. Apache reads the request hostname and chooses the matching virtual host.
  5. The selected virtual host sends the request to its DocumentRoot, where WordPress handles it.

Use an explicit default virtual host as well. If no hostname matches, or a client omits the Host header, Apache uses the first matching virtual host for that listener. A deliberate default prevents an unknown hostname from accidentally displaying one of your production sites.

Choose separate installations or WordPress Multisite

Both layouts are supported by WordPress. Multiple instances can use separate databases, one database with unique table prefixes, or a Multisite network with a shared database model. The right choice depends on how independently the sites must be operated.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Decision area Separate installations Multisite
Codebase Each domain has its own WordPress files and wp-config.php. Several sites are managed within one WordPress installation and share its codebase.
Administration Each site has its own administrators, dashboard and update schedule. Network administration centralizes users, themes, plugins and site management.
Database Normally one database and database user per site; a shared database is possible with unique table prefixes. One network database model is shared across the sites.
Isolation Clearer boundaries for credentials, plugins, updates, backups and failures. An incompatible plugin, code update or database problem can affect the network.
Domain mapping Each domain points to its own document root and installation. Domains can map to sites served from one directory, but DNS and server mapping remain necessary.
Backup and restore Restore one site without touching the others. Restoring the shared installation or database may involve the whole network.

Use separate installations when boundaries matter

Choose separate directories and databases when clients, teams or security policies must remain independent; when sites need different plugin versions; or when an outage or update on one domain must not change the others. Give every installation its own database credentials and its own wp-config.php. This is the easier model to reason about when each site is treated as a separate application.

Use Multisite when central management is the point

Use Multisite when the sites should share one WordPress codebase, themes, plugins and network administration. WordPress defines Multisite as a feature that creates several WordPress instances managed within one installation. A domain-based network can serve different domains from one directory, but each domain still needs correct DNS and Apache handling.

On Apache, Multisite requires mod_rewrite, working .htaccess support and suitable AllowOverride or Directory settings. If you cannot accept a shared update and failure boundary, do not choose Multisite merely to reduce the number of directories.

Prerequisites and supported software

VPS and DNS control

  • A VPS with a stable public IPv4 address, IPv6 address, or both.
  • Administrative access sufficient to install Apache, PHP, database software and certificates.
  • DNS control for every domain and any aliases, such as the www hostname.
  • Enough storage, memory and database capacity for all sites, media libraries, backups and logs.

WordPress software baseline

WordPress currently recommends PHP 8.3 or newer, MySQL 8.0 or newer or MariaDB 10.11 or newer, HTTPS, and Apache or Nginx with rewrite support. Older PHP and database releases may still run some WordPress versions, but they are end of life and can leave the server exposed to known security problems. Install PHP with the extensions required by WordPress, then install Apache and MySQL or MariaDB before creating sites.

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

Filesystem plan

Give every independent domain a predictable, separate path. For example:

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • 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
/var/www/example.com/public
/var/www/second-example.net/public
/var/www/example.com/private-or-backups

Only the intended public directory should be an Apache document root. Keep database credentials, backup archives and other private material outside those roots. Ensure Apache can read the WordPress files and that WordPress can write the directories that legitimately require media or update access, especially wp-content. Avoid making the entire VPS or every site directory writable by the web server.

Plan domains, aliases and directories before editing Apache

Write a small inventory for each site:

  • Canonical hostname, such as example.com.
  • Aliases that should serve the same site, such as www.example.com.
  • Public document root.
  • Database name, database user and password.
  • Separate access and error-log paths.
  • The HTTPS names that must appear on the certificate.

This prevents a common mistake: configuring www in Apache but forgetting to include it in DNS or in the certificate, or configuring two domains with the same document root unintentionally.

Point every domain at the VPS

  1. Create an A record for each hostname that should use the VPS’s IPv4 address.
  2. Create an AAAA record when the VPS is configured for IPv6 and Apache is reachable over IPv6.
  3. Repeat the records for aliases such as www; do not assume an alias follows the apex domain automatically.
  4. Wait for the records to become visible from the networks your visitors use.

Check both the apex and alias names before requesting certificates. If an old record still points to another server, HTTP tests and certificate validation can reach the wrong machine.

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

Build independent WordPress installations

1. Create one public directory per domain

Download or upload WordPress into each planned document root. Do not place two independent sites in the same directory. Each directory must contain the files for only the site that Apache will serve there.

2. Create a database and user for each site

Create a database and a least-privilege database user for every independent installation. Record the database name, username, password and database host for that site. A shared database is possible, but every installation must use a unique table prefix; separate databases make ownership, backup and restoration clearer.

3. Supply wp-config.php

WordPress’s installer needs database information in wp-config.php. Put the credentials for the matching site in the file under that site’s document root. Never copy a working configuration without changing its database values and security keys for the new domain.

4. Set ownership and permissions deliberately

Apache must be able to read the installation, while WordPress needs write access only where updates, uploads or cache files require it. Keep wp-config.php, database dumps and certificate-related files protected from direct web access. The exact owner and permission commands vary by VPS distribution and deployment policy; verify them by testing an upload and an update rather than granting broad write access.

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.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • 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)

5. Run the browser installer

After the virtual host is active, open the domain in a browser and complete the WordPress installer. Set the site title, administrator account and intended URL. Repeat the process for every independent domain, checking that the browser is displaying the expected hostname before entering credentials.

Configure one Apache virtual host per domain

Create a separate port-80 virtual-host block for each domain. This repeatable pattern gives the site a canonical name, an alias, an isolated document root and its own logs:

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example.com/public

    <Directory /var/www/example.com/public>
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
    CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined
</VirtualHost>

Duplicate the block for every other domain, changing ServerName, aliases, DocumentRoot and both log paths. The AllowOverride All setting permits WordPress’s .htaccess rewrite rules when the server’s directory policy allows it. If your policy disables overrides, implement equivalent rewrite and access rules in the virtual-host or directory configuration instead.

Enable rewrite support and the sites

Enable Apache’s rewrite module, enable each site’s configuration using the method provided by your operating system, check the complete configuration, and reload Apache. On systems using the common Debian-style helpers, the sequence is typically:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
a2enmod rewrite
a2ensite example.com.conf
a2ensite second-example.net.conf
apachectl configtest
systemctl reload apache2

The helper names and service name can differ on other distributions. The important order is the same: enable the module and virtual hosts, run a syntax check, then reload only after the check succeeds.

Keep a deliberate default virtual host

Place a minimal default site first for unexpected hostnames, or otherwise make the intended default explicit. Do not rely on the first production site in a directory listing being the default. This makes malformed requests and forgotten DNS records easier to identify without exposing a customer’s site.

Install the Multisite alternative

If you selected Multisite, install WordPress once in the network’s document root and enable the network from the WordPress dashboard. Choose subdomains or subdirectories according to the network’s URL design, then configure the required rewrite rules and .htaccess directives that WordPress supplies.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • 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

For domain-based sites, map each domain to the appropriate network site and keep the Apache document root pointed at the single Multisite installation. Every mapped domain still needs DNS records and a matching Apache ServerName or ServerAlias. Confirm that the network’s cookie, login and site URLs use the intended HTTPS hostnames after TLS is enabled.

Because all sites share code and network-level settings, test plugin, theme and core updates against the complete network. Back up the shared database and files before changes; a per-site restore is not equivalent to restoring an independent installation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Add HTTPS for every hostname

1. Make HTTP work first

After DNS resolves to the VPS, request each domain over HTTP and verify that Apache serves the correct WordPress site. Fix wrong-vhost, DNS and document-root errors before certificate issuance. Certificate validation cannot succeed reliably while the hostname reaches the wrong server.

2. Request certificates with Certbot’s Apache integration

Use Certbot’s Apache integration to obtain certificates for every configured hostname. If both the apex and www names should work, include both names in the certificate request. Repeat for each independent site or include all names that the Multisite network actually serves.

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

3. Verify the HTTPS virtual host

Confirm that the generated or manually configured port-443 virtual host uses the same site-specific document root and aliases as the HTTP definition. Open both HTTPS names and check the WordPress title, links and media URLs. In WordPress, set WordPress Address and Site Address to the intended HTTPS hostname for that site.

4. Redirect HTTP only after HTTPS works

Once the certificate-backed HTTPS virtual host responds correctly, redirect HTTP requests to the matching HTTPS URL. Do not add a blanket redirect before the certificate and HTTPS host are functional; otherwise an error that was easy to inspect over HTTP can become a confusing TLS or redirect failure.

5. Test renewal

Certbot’s renewal action checks installed certificates for impending expiry and attempts renewal with the original plugin options. Run a renewal simulation or inspect each renewal configuration well before the first expiry, then verify that Apache reloads successfully after a renewed certificate is installed.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • 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.

Verify every site systematically

  1. Check A and AAAA answers for every apex and alias name and confirm that they point to the VPS.
  2. Run apachectl -S. Confirm that every ServerName and alias appears under the intended listener and virtual host.
  3. Request each domain separately over HTTP and HTTPS. Verify the expected WordPress title, login URL and asset URLs rather than checking only the status code.
  4. Inspect the site-specific Apache access and error logs. The request should appear in the expected log, and the error log should identify the intended document root or related permission problem.
  5. For separate installations, inspect every wp-config.php and confirm that it references the intended database. If a database is shared, confirm that each installation has a unique table prefix.
  6. Run a Certbot renewal simulation or inspect renewal metadata before certificates approach expiry.
  7. Create and test backups of databases, wp-content, each wp-config.php, Apache virtual-host files and certificate-renewal metadata.

Troubleshoot the failures that occur most often

The wrong WordPress site appears

  • Check the browser’s exact hostname, including whether it used www.
  • Use apachectl -S to find duplicate, misspelled or unexpectedly ordered virtual hosts.
  • Confirm the request is reaching the VPS’s current DNS address.
  • Check that the selected block’s DocumentRoot contains the expected WordPress files.
  • Review the access log associated with each virtual host to see which configuration handled the request.

Apache fails to reload

  • Run apachectl configtest and correct the first syntax error it reports.
  • Check for an unclosed VirtualHost or Directory element, a misspelled directive or a duplicate conflicting definition.
  • Reload only after the configuration test passes; a failed reload can leave the previous configuration active.

Permalinks return 404 errors

WordPress pretty URLs depend on rewrite support. Confirm that mod_rewrite is enabled, that the relevant directory permits the required .htaccess directives, and that the virtual host points to the directory containing the correct WordPress installation. A missing or unreadable .htaccess file can produce the same symptom.

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

Uploads or updates fail

Inspect the site’s error log and filesystem ownership. Apache must be able to write the specific upload or update directory under your security policy. Correct ownership or narrowly scoped permissions rather than making the whole document root writable.

HTTPS shows a certificate-name warning

The requested hostname is not covered by the certificate, or DNS is sending that hostname to another server. Include every intended alias in the certificate request, verify the port-443 aliases, and retest both apex and www names.

WordPress redirects to the wrong host or scheme

Check WordPress Address and Site Address for the affected installation or network. Make sure they use the intended HTTPS hostname and that no copied configuration still contains another domain. Then test in a private browser session to avoid cached redirects.

Backups, updates and operational boundaries

Back up the database and files together so a restore returns WordPress to a consistent state. For independent sites, include each site’s database, wp-content, wp-config.php and Apache configuration. Also preserve certificate-renewal metadata so future renewals do not have to be reconstructed from memory.

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

Test restoration on a separate path or VPS instead of assuming that a successful backup job is usable. Before Apache, PHP, database or WordPress upgrades, capture the current configuration and verify that every domain still resolves to the VPS. Update independent installations separately when isolation is important; stage Multisite updates against the full network because one shared codebase can affect every site.

Practical deployment sequence

  1. Choose separate installations or Multisite based on isolation and shared-management needs.
  2. Install Apache, PHP and MySQL or MariaDB versions that meet WordPress’s current recommendations.
  3. Create the directory and database plan for every domain.
  4. Publish A and AAAA records for each apex and alias hostname.
  5. Install WordPress files and complete each independent installer, or create the Multisite network.
  6. Create and enable one Apache virtual host per domain, with explicit aliases, document roots and logs.
  7. Enable rewrite support, run apachectl configtest, reload Apache and inspect apachectl -S.
  8. Verify every domain over HTTP, then issue certificates with Certbot’s Apache integration.
  9. Confirm HTTPS URLs, add the HTTP-to-HTTPS redirect, and test renewal.
  10. Back up databases, files, Apache configuration and renewal metadata before normal updates.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.