To begin with, let's identify the two common methods of hosting multiple Wordpress installs. The first one is individual installs using Apache virtual-hosts or Nginx server blocks. This set-up allows you to install as many Wordpress websites as your server has resources for. Each vhost (virtual-host) or server block can be assigned its own domain and contain a separate working directory from other installs.
The second method is using what is known as a Wordpress Multisite Network. This allows you to host and maintain multiple Wordpress websites from a single dashboard. This is especially handy if you want to contain multiple Wordpress installations for an organization under one umbrella.
In this guide, we are going to work with individual Apache2 virtual-hosts.
Please note - This guide assumes that you already have a functional LAMP stack. If you are not already at this point, please see follow this guide until the 'Download Wordpress' section, continue with this current guide when you reach that point -> https://help.skysilk.com/support/solutions/articles/9000173246-how-to-install-wordpress-with-lamp-on-ubuntu
Once you have a LAMP stack up and running, we're going to set up our hosting environment. Navigate to your www folder.
Now we are going to be creating some folders, the number of folders is based on how many websites you're trying to host. We will be doing three in this example.
Then enter each directory and install the basic default Wordpress files whichever way you find most comfortable. The following command will download the latest Wordpress installation and unpack the files for you.
For simplicity's sake, we are going to repeat the above two more times in the other directories we created. Once it's done, we can navigate back to /var/www/ and set the proper settings for security.
(Note, we are using root in this example. If you are logged in with a user other than root, you will need to ensure that you use sudo with some of the commands)
Next, we are going to create a MySQL Database as well as a corresponding database user for each site.
Once that's finished, we will move on to setting up the Apache Virtual-Hosts files. Begin by copying the default site configuration and naming to match our first Wordpress site.
We're going to modify this file to look something like below:
Then we're going to copy it over to the second domain's configuration file:
Inside this file, we are going to modify it to look something like below:
Lastly, we will do it one last time:
Finally, we are about finished with the basic vhosts setup. As long as each domain has an A Record pointing to this server, they should be able to resolve. We're going to enable these vhosts, disable the default site, and after we will restart Apache2 followed by testing.
Now we should be able to navigate to each different URL. If all went as expected, then you should be brought to the install page for each Wordpress site.
Congratulations! You have now successfully configured Apache2 Virtual-Hosts to allow your Ubuntu VPS to host more than one website or Wordpress site.
Join our Private Discord Chat to chat with, as well as find community assistance from other Verified SkySilk Users: https://invite.gg/SkySilk
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article