Introduction
One of the biggest advantages of VPS hosting is the ability to host multiple websites on a single server.
This allows businesses, developers, agencies, and website owners to manage several projects efficiently while keeping full control over server resources.
In this tutorial, you will learn how to configure multiple websites on your Linux VPS server.
Benefits of Hosting Multiple Websites on VPS
- Better resource management
- Cost-effective hosting solution
- Centralized server administration
- Improved website performance
- Greater flexibility and scalability
Step 1: Create Website Directories
Create separate directories for each website.
mkdir -p /var/www/site1.com/public_html mkdir -p /var/www/site2.com/public_html
Step 2: Set Permissions
Assign correct ownership and permissions:
chown -R www-data:www-data /var/www/site1.com chown -R www-data:www-data /var/www/site2.com![]()
Step 3: Create Test Pages
Create sample index files for testing.
nano /var/www/site1.com/public_html/index.html
Add simple HTML content to confirm the website loads correctly.
Step 4: Configure Apache Virtual Hosts
Create Apache configuration file:
nano /etc/apache2/sites-available/site1.com.conf
Add virtual host configuration:
ServerName site1.com
DocumentRoot /var/www/site1.com/public_html
Step 5: Enable Website Configuration
Enable the virtual host:
a2ensite site1.com.conf systemctl reload apache2![]()
Step 6: Point Domain to VPS Server
Update your domain DNS records to point toward your VPS IP address.
DNS propagation may take several hours globally.
How to Add SSL Certificates
Install Certbot:
apt install certbot python3-certbot-apache -y
Generate SSL certificate:
certbot --apache
Common Issues and Troubleshooting
1. Website Not Loading
Verify Apache configuration and DNS settings.
2. Permission Denied Errors
Check folder ownership and file permissions.
3. SSL Certificate Problems
Ensure the domain resolves correctly before requesting SSL certificates.
Why VPS Hosting Is Better for Multiple Websites
Unlike shared hosting, VPS hosting provides dedicated resources, better isolation, improved speed, and greater control for hosting multiple websites efficiently.
Need Assistance?
HostPeppy technical support can help configure virtual hosts, SSL certificates, DNS records, and multi-site VPS hosting environments.