Virtual machine running multiple wordperss installations
This is how we would setup virtual machine running multiple wordperss installations. In some cases we want to create dedicated vm for running strictly wordpress. This is not a secure deployment and better suited for development environment. For production installation would have to be hardened and some sort of HIDS should be in place.
1. Start virtual machine from template as specified in other tutorials.
2. Change name of your vm to hostname of your choice
#hostnamectl set-hostname myhost.domain
3. Run update to get all the latest updates
#yum update -y
WordPress depends on LAMP stack – php, apache, mysql, linux so lets install LAMP stack on our vm.
4. Install LAMP
yum install httpd systemctl enable httpd.service systemctl start httpd yum install mariadb-server mariadb systemctl start mariadb mysql_secure_installation systemctl enable mariadb.service yum install php php-mysql
5. Set up virtual hosts so we can run several name based websites on same server with separate wordpress installs.
vi /etc/httpd/conf/httpd.conf NameVirtualHost *:80
Now create file /etc/httpd/conf.d/sites.conf with your virtual sites information
DocumentRoot "/var/www/html/site1" ServerName site1.com ServerAlias www.site1.com ErrorLog /var/log/httpd/site1/error.log CustomLog /var/log/httpd/site1/access.log combined DocumentRoot "/var/www/html/site2" ServerName site2.com ServerAlias www.site2.com ErrorLog /var/log/httpd/site2/error.log CustomLog /var/log/httpd/site2/access.log combined
6. Install phpmyadmin
yum install epel-release yum install phpmyadmin
edit /etc/httpd/conf.d/phpMyAdmin.conf
Change lines that says require ip 127.0.0.1 to your ip address or addresses like this x.x.x.x y.y.y.y
#systemctl restart httpd
You can access it by going to http://hostname/phpmyadmin
7. Download wordpress 4.6.1 (currently the latest version)
yum install wget cd /root wget https://wordpress.org/wordpress-4.6.1.zip
8. At this point all you need to do is unzip wordpress and create database. Follow your normal wordpress installation procedure