I denne opplæringen, we will show you how to install two WordPress instances on separate virtual servers with Ubuntu 16.04 OS and Apache, PHP and MySQL installed on them, and how to manage them from a single place using the MainWP WordPress plugin. WordPress is one of the most popular free content management systems, written in PHP that allows web developers to build websites for any purpose. The MainWP dashboard plugin will allow you to manage your WordPress websites from one central location and get nearly complete control of all your WordPress based websites from the MainWP Dashboard.
This tutorial was tested and written for an Ubuntu 16.04 VPS, but it should work on any Linux distribution.
Denne installere guiden forutsetter at Apache, MySQL and PHP are already installed and configured on your virtual servers. På tidspunktet for å skrive denne opplæringen, the latest stable version of WordPress is 4.6.1 og det krever:
- PHP 5.6 or later with the GD graphics library version 2.0.x+, MySQLi and mbstring PHP extensions enabled;
- Apache Web Server >= 2.0 compiled with mod_rewrite module and with the following directives allowed: RewriteEngine, RewriteBase, RewriteCond and RewriteRule.;
- MySQL 5.6 or later or MariaDB version 10.0 eller nyere installert på din virtual servers.
Let’s start with the installation. Download the latest version of WordPress available at https://wordpress.org/latest.tar.gz to the first server and extract it using the following commands:
cd /opt wget https://wordpress.org/latest.zip mkdir -p /var/www/html/wordpress unzip -o latest.zip -d /var/www/html/
Create a new MySQL database for WordPress to use and assign a user to it with full permissions:
mysql -u root -p mysql> CREATE DATABASE wpdb; mysql> GRANT ALL PRIVILEGES ON wpdb.* TO 'wpuser'@'localhost' IDENTIFIED BY 'yOur-passw0rd' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES; mysql> slutte
Do not forget to replace ‘yOur-passw0rd’ with a strong password.
Opprett en ny virtuell vert direktiv i Apache. For eksempel, create a new Apache configuration file named ‘wordpress.conf’ on your virtual server:
Deretter, run the following command:
ln -s /etc/apache2/sites-available/wordpress.conf /etc/apache2/sites-enabled/wordpress.conf
Eller, use the a2ensite to enable the ‘wordpress.conf’ configuration in Apache:
sudo a2ensite wordpress.conf
Edit the ‘wordpress.conf’ configuration file:
and add the following lines to it:
<virtuellverten *: 80> ServerAdmin email@example.com DocumentRoot /var/www/html/wordpress/ ServerName your-domain1.com ServerAlias www.your-domain1.com <Directory /var/www/html/wordpress/> Options FollowSymLinks AllowOverride All </Directory> ErrorLog /var/log/apache2/your-domain1.com-error_log CustomLog /var/log/apache2/your-domain1.com-access_log common </virtuellverten>
Optionally, add/modify the following lines in php.ini configuration file:
memory_limit = 256M default_charset = "UTF-8"
Set the proper file permissions for the Apache web server to write to ‘/var/www/html/wordpress/’ directory:
sudo chown -R www-data:www-data /var/www/html/wordpress/
Enable the Apache2 rewrite module if it is not already done so:
sudo a2enmod rewrite
Start Apache web server for at endringene skal tre i kraft:
service apache2 restart
Copy the wp-config-sample.php file to wp-config.php :
cd /var/www/html/wordpress/ wp-config-sample.php wp-config.php
Edit the wp-config.php file and change:
define('DB_NAME', 'database_name_here'); define('DB_USER', 'username_here'); define('DB_PASSWORD', 'password_here');
define('DB_NAME', 'wpdb'); define('DB_USER', 'wpuser'); define('DB_PASSWORD', 'yOur-passw0rd');
Repeat the same installation procedure on the second server where you intend to host the second WordPress website (do not forget to edit the Apache configuration file and replace ‘your-domain1.com’ with the actual domain name hosted on the second server).
Åpne din favoritt nettleser, navigate to http://your-domain1.com , then open a second tab and go to http://your-domain2.com , and follow the easy instructions to finish the WordPress installations on both servers.
Log in to the WordPress administration back-end of the first website, go to Plugins >> Add New >> and search for MainWP plugin, then install and activate the MainWP dashboard plugin. On the next page, click Let’s Go >> select ‘Web Host’ and click continue. If all MainWP dashboard plugin requirements are met, click continue. On the next page select the type of hosting (VPS) and the number of child websites you are
On the next page, click Let’s Go >> select ‘Web Host’ and click continue. If all MainWP dashboard plugin requirements are met, click continue. On the next page select the type of hosting (VPS) and the number of child websites you are
neste, select the type of hosting (VPS) and the number of child websites you are planning to manage (less than 50 or more than 50), then click continue.
Deretter, follow the instructions and continue with the MainWP dashboard plugin setup according to your needs.
To add a second WordPress website, click on the ‘Add New Site’ button, but make sure to go to the administration back-end of your second website and install and activate the MainWP Child plugin first. You can also turn on the ‘unique security ID’ option from the MainWP settings for extra security.
Deretter, go to the WordPress administration back-end of your first website. From the MainWP Dashboard plugin , click ‘Add New Site’ and add the URL of the second WordPress website, enter its administrator username and click on the ‘Add New Site’ button.
Det er det. You can manage the WordPress installations from a single place using the MainWP plugin now.