Free tools Windows power users keep installed
One-click scans. No signup required.
Yes, two domains can use one VPS and one public IP. Point each domain’s DNS A record to the VPS’s IPv4 address (and add AAAA records only when IPv6 is configured end to end). Then create a separate NGINX server block or Apache name-based virtual host for each hostname, give each site its own document root or application upstream, issue certificates covering every HTTPS name, and test both domains.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
DNS only gets a request to the machine. The web server reads the requested hostname and selects the matching site. Without separate virtual-host configuration, both names may fall through to the same default site.
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 sharing a VPS actually means
A browser sends a request containing a hostname such as domain-a.example. DNS resolves that name to an IP address, the connection reaches the VPS on port 80 or 443, and NGINX or Apache chooses a configuration based on the hostname in the request. This is name-based hosting: many domains share an address while their files, application processes, logs, and certificates remain separate.
The domains do not need separate VPS instances merely because they are different names. They do need separate web-server rules if they should show different sites. Creating a virtual host does not create DNS records; DNS and web-server configuration are two independent jobs.
#1 Best Overall
Prerequisites and decisions
Gather these details before changing production DNS:
- The VPS public IPv4 address.
- The VPS public IPv6 address, only if the server, operating system, provider network, and firewall are all configured for IPv6.
- Administrative access to both domains’ DNS zones.
sudoor root access on the VPS.- The web server you will use: NGINX, Apache, or an existing reverse-proxy setup.
- A directory for each static site, or a listening address and port for each application.
- Firewall rules allowing TCP ports 80 and 443. Keep SSH access available while making changes.
- The complete list of names that must work, normally each apex name and its
wwwalias.
Decide whether the apex and www name should show the same site. Usually they are listed as aliases in one virtual host and one of them is redirected to the preferred canonical name. If the two names are intended to be different sites, put them in separate server blocks or virtual hosts instead.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Step 1: Point both domains at the VPS
Create the apex records
At the DNS provider for each domain, create an A record for the apex (often displayed as @) containing the VPS’s public IPv4 address. If IPv6 is genuinely enabled and reachable, create an AAAA record containing the VPS’s IPv6 address. Do not publish an AAAA record for a server that cannot accept IPv6 traffic: clients that prefer IPv6 can then fail before trying IPv4.
| Name | Record | Value | When to use it |
|---|---|---|---|
@ for domain A |
A | VPS IPv4 address | Always for IPv4 hosting |
@ for domain B |
A | VPS IPv4 address | Always for IPv4 hosting |
@ for either domain |
AAAA | VPS IPv6 address | Only with working IPv6 routing and firewall rules |
Add the www names
For each domain, add www as either an A/AAAA pair pointing directly to the VPS or a CNAME pointing to that domain’s apex, according to the DNS provider’s rules. A CNAME cannot coexist with other record types at the same name. Whatever choice you make, include the resulting hostname in the web-server configuration and in the certificate request.
Check that DNS is answering
Use your provider’s DNS diagnostic view or a command such as dig +short domain-a.example A and dig +short domain-b.example A. Repeat with AAAA when IPv6 is enabled. The answers should be the intended VPS addresses. Existing resolver caches honor the zone’s published TTL, so some networks may continue returning the old address until that value expires.
Rank #2
- Linux
- Linux DNS
Step 2: Give each site separate storage or an application upstream
Static sites
Create independent document roots so a deployment for one domain cannot overwrite the other:
sudo mkdir -p /var/www/domain-a
sudo mkdir -p /var/www/domain-b
sudo chown -R www-data:www-data /var/www/domain-a /var/www/domain-b
The web-server account differs by distribution; use the account configured for your installation rather than blindly copying www-data. Place a distinct test file such as index.html in each directory with an unmistakable title. Those markers make routing errors obvious during testing.
Applications behind a reverse proxy
Each application can listen on a different local port, for example 127.0.0.1:3001 for domain A and 127.0.0.1:3002 for domain B. The web server remains the public listener on ports 80 and 443 and forwards requests to the correct local upstream. Bind application ports to loopback unless they must be reached directly; exposing development ports publicly creates an unnecessary attack surface.
Configure two sites with NGINX
HTTP server blocks for static content
NGINX uses the server_name directive to decide which server block handles a request. Create one block per site, listing the apex and its alias together when they serve the same content:
server {
listen 80;
listen [::]:80;
server_name domain-a.example www.domain-a.example;
root /var/www/domain-a;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
server {
listen 80;
listen [::]:80;
server_name domain-b.example www.domain-b.example;
root /var/www/domain-b;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
Remove the listen [::]:80; lines if this VPS has no working IPv6 listener. On Debian- and Ubuntu-style layouts, save each file under /etc/nginx/sites-available/ and enable it with symlinks in /etc/nginx/sites-enabled/. On other distributions, place the files in the include directory specified by the main NGINX configuration.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsRank #3
Proxy blocks for two applications
Replace the root and try_files section with a proxy location when a site is an application:
location / {
proxy_pass http://127.0.0.1:3001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
Use the second application’s port in domain B’s block. Ensure both processes are running and listening on the addresses named in proxy_pass; otherwise NGINX can match the right hostname but return a 502 error.
Validate and reload NGINX
- Run
sudo nginx -t. Do not reload if the test reports a syntax or include error. - Enable the site files if your distribution requires it, and remove or adjust the distribution’s default site so it cannot capture an unmatched request.
- Reload with
sudo systemctl reload nginx. A reload applies valid configuration without dropping established connections.
If several blocks listen on the same address and port, an unmatched hostname goes to the default server for that listener. Make the intended fallback explicit only after the named blocks are correct; a default block should not be mistaken for a domain-specific configuration.
Configure two sites with Apache
Name-based HTTP virtual hosts
Apache’s name-based virtual hosting uses one VirtualHost container per site. Each container should have its own ServerName, optional ServerAlias, document root, and logs:
Recommended Free Tools
<VirtualHost *:80>
ServerName domain-a.example
ServerAlias www.domain-a.example
DocumentRoot /var/www/domain-a
<Directory /var/www/domain-a>
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/domain-a-error.log
CustomLog ${APACHE_LOG_DIR}/domain-a-access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName domain-b.example
ServerAlias www.domain-b.example
DocumentRoot /var/www/domain-b
<Directory /var/www/domain-b>
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/domain-b-error.log
CustomLog ${APACHE_LOG_DIR}/domain-b-access.log combined
</VirtualHost>
If an application is behind Apache, use a proxy module and a distinct backend port for each site instead of a second DocumentRoot. Keep the same hostname separation: Apache still chooses the virtual host from ServerName and ServerAlias.
Enable and test Apache
- Save each virtual host in the configuration directory used by your distribution.
- On Debian- and Ubuntu-style systems, enable the files with
sudo a2ensite domain-a.confandsudo a2ensite domain-b.conf. Enable only the modules your configuration requires. - Run
sudo apachectl configtest. Continue only when it reports a successful syntax check. - Reload with
sudo systemctl reload apache2or the service name used by your operating system.
Apache’s first matching or default virtual host can answer when no configured name matches. Check the enabled-site order and the default host if a typo or an unrecognized hostname displays the wrong content.
Secure both domains with HTTPS
Request certificates for every name
HTTPS certificates must cover every hostname that will answer securely. If users will visit both apex and www, request a certificate containing both names for domain A and another containing both names for domain B, or use a certificate strategy that explicitly covers all four names. A certificate for one domain does not validate the other merely because they share an IP address.
Use a trusted certificate authority and an ACME-capable client appropriate to your operating system. The HTTP challenge normally requires port 80 to reach the correct site, so keep the DNS records and HTTP listener working while issuing certificates. Store private keys with restrictive permissions and renew certificates before they expire.
NGINX HTTPS blocks and HTTP redirect
After certificates exist, add a 443 block for each site. SNI lets NGINX select the certificate and content using the requested hostname on one IP:
server {
listen 80;
listen [::]:80;
server_name domain-a.example www.domain-a.example;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name domain-a.example www.domain-a.example;
ssl_certificate /etc/ssl/domain-a/fullchain.pem;
ssl_certificate_key /etc/ssl/domain-a/privkey.pem;
root /var/www/domain-a;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
Create equivalent HTTP and HTTPS blocks for domain B, changing the names, certificate paths, and root or upstream. If your certificate client writes the 443 configuration automatically, inspect the generated blocks and confirm that each certificate is attached to the matching server_name.
Best Value
- Standard size: 6 pink server note pads, Each Book Comes with 50 bound order slips - that's 300 ticket sheets total! Check Pads Size 6.75 x 3.5 inch.
- Convenient Work: These guest check books for servers have a tear-free dotted line that is easy to rip off. You can give as a customer copy or keep for record keeping. We've provided extra rows on the back for additional note taking.Perfect For Restaurants, Lounges, Hotels, Cafes, And Waiters To Use.
- Record Important Information: These server note pads can record important information.Each ticket has a unique serial number printed at the top, dates, order details, number of guests, order amount, table numbers etc. They are lightweight, small and can fit most aprons. They can be used on-demand and can help decrease errors in orders, while improving work efficiency.
- High Quality: Sturdy, Not Drop Powder, It's Thick, You Can Write On The Back And Front Easily.Their whole page printing has clear handwriting and a reasonable layout. On the customer retention part of each guest check, "THANK YOU" on the back to make customers feel appreciated.
- Contact Us: We're confident that the quality of the server note pads will go beyond your expectation. If you experience an issue, feel free to contact us, we'll appreciate it to learn from your experience, and we'll make it better
Apache HTTPS virtual hosts
Apache needs a separate SSL virtual host for each certificate-covered name. The essential pattern is:
<VirtualHost *:443>
ServerName domain-a.example
ServerAlias www.domain-a.example
DocumentRoot /var/www/domain-a
SSLEngine on
SSLCertificateFile /etc/ssl/domain-a/fullchain.pem
SSLCertificateKeyFile /etc/ssl/domain-a/privkey.pem
<Directory /var/www/domain-a>
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
Repeat it for domain B with its own certificate and document root. Enable the SSL module and the HTTPS sites where your distribution requires those steps, run apachectl configtest, and reload Apache.
Redirect HTTP only after HTTPS works
Once both 443 sites answer with valid certificates, make each port-80 site return a permanent redirect to the same host and URI over HTTPS. Test the secure URL first; otherwise a redirect can turn a working HTTP site into an inaccessible one for users whose certificate or 443 configuration is incomplete.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Test each hostname independently
Run the checks for both domains, not just one:
curl -I http://domain-a.example
curl -I https://domain-a.example
curl -I http://domain-b.example
curl -I https://domain-b.example
For HTTP, expect the intended status or an intentional redirect. For HTTPS, verify the certificate subject/SANs, the final hostname, and the returned content. Open both apex and www names in a browser if both are published. If DNS has not propagated everywhere, test from a network that resolves the new address or use a temporary hosts-file entry on an administrator workstation; remove that override after testing.
Troubleshoot the wrong site, certificate, or response
The domain resolves to the wrong server
- Check A and AAAA answers separately. An obsolete AAAA record can send IPv6 clients to an old machine even when the A record is correct.
- Confirm that both names are in the intended
server_name,ServerName, orServerAliasdirective, including spelling and punctuation. - Check that the configuration file is enabled and that the service was successfully reloaded after the change.
- Inspect the default NGINX server or Apache virtual host when the requested hostname matches no block.
- If a reverse proxy, CDN, or managed load balancer sits in front of the VPS, verify its origin target and forwarded-host behavior; it may hide an origin configuration error.
HTTPS presents the wrong certificate
- Confirm that the 443 block or SSL virtual host contains the requested hostname.
- Check that the certificate’s names include the exact apex or
wwwname being visited. - Verify that the certificate and private-key paths belong to the same certificate pair and are readable by the web-server process.
- Check SNI behavior by testing the hostname, not merely the IP address. A request made only to the IP can legitimately receive the default certificate.
- Reload after correcting the configuration and test again from a client that is not displaying a cached certificate warning.
One site returns a 502 or connection error
For a proxied application, check that the process is running, listening on the configured local address and port, and accepting the request path. Review the NGINX or Apache error log for connection-refused, timeout, and permission messages. For static content, verify that the document root exists, contains the expected index file, and is traversable by the web-server account.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →IPv6 users cannot connect
Remove the AAAA record until IPv6 routing, the operating-system listener, and the firewall are all correct. Alternatively, complete that configuration and ensure the web server listens on both IPv4 and IPv6. Publishing an address that only works from the VPS itself does not provide usable IPv6 service.
NGINX server blocks versus Apache virtual hosts
| Decision point | NGINX | Apache |
|---|---|---|
| Hostname selector | server_name in each server block |
ServerName and optional ServerAlias in each VirtualHost |
| Static files | root plus location rules such as try_files |
DocumentRoot plus a matching Directory policy |
| Application routing | Usually proxy_pass to a distinct local upstream |
Proxy modules and a distinct backend target |
| HTTPS | Separate 443 blocks with certificate and key directives; SNI selects the name | Separate SSL virtual hosts with certificate directives; SNI selects the name |
| Configuration check | nginx -t |
apachectl configtest |
| Typical failure to inspect first | Unmatched hostname falling into the default server | Wrong enabled-vhost order or default virtual host |
Choose the server already supported by your team and application stack. The shared-IP design is the same; the syntax, module model, log locations, and reload command differ.
Quick Recap
Operational checklist
- Both apex A records resolve to the VPS IPv4 address.
- AAAA records exist only when the VPS and firewall correctly support IPv6.
- Each published
wwwname resolves through an A/AAAA record or an intentional CNAME. - Domain A and domain B have separate roots or separate application upstreams.
- Every hostname appears in the matching NGINX or Apache configuration.
- Port 80 and port 443 are allowed through the VPS firewall.
- Configuration tests pass before every reload.
- Certificates cover every apex and alias name and are attached to the matching HTTPS host.
- HTTP redirects to HTTPS only after both secure hosts work.
curl -Itests return the intended response for both domains.
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.




