Where to find pre-installed virtual machines for local WordPress testing under Virtualbox?

Hello friends,

If you remember our post about virtual machines running under Virtualbox then you are probably wondering if it is possible to find pre-installed solutions that you can import and start using for local WordPress tests.

The great news is that this is possible. In this post I will show you where you can find pre-installed virtual machines for local WordPress testing under Virtualbox.

If such solutions exist, should I use them instead of configuring an Ubuntu (or other) server under Virtualbox by myself?

In terms of local testing – yes. But if you are aiming to use them for other purposes, I’d advise to either start installing or configuring the server by yourself or at least to check the configuration of the pre-installed solution and improve it if necessary. For production servers, based on virtual machines, I’d advise to seek for assistance from an experienced system administrator. Let’s not forget to mention that there are far more advanced solutions than Virtualbox for this purpose (for example Open Stack).

The reason that I am giving you this advice is because the pre-installed solutions are meant to save you time and effort. This may be enough for local testing in most cases, however for other purposes these virtual machines might lack in security. Also even for local WordPress testing you may need to configure them additionally in order to make all of your plugins function correctly.

OK, where can I find these pre-installed virtual machines?

Some of the machines contain only a Linux distribution without any additional configuration. These machines are meant to remove the need to make a new installation and basic configuration. Once you download them and import them in Virtualbox you can install and configure LAMP so that you can run WordPress locally.

Such machines can be found from OSBoxes (click to visit). There you can find images for both Virtualbox and VMware. Select the distribution that you desire to use and then follow the instructions provided on the website. You will find out the username and the password that were created for the virtual machine.

Here is what you need to do in order to use the machine: Add a new virtual machine in Virtualbox. Select the appropriate distribution and then follow the wizard until you reach the section that asks you to either create a new virtual disk or to use an existing one. Simply point the VDI or VMDK file that you have downloaded from OSBoxes and complete the virtual machine configuration. Once you run it you will get a pre-installed Linux with graphical interface. For additional configurations you need to update the distribution and also install VirtualBox Guest Add-Ons. Then you need to install and configure LAMP.

Other solutions provide LAMP Stack in a pre-installed virtual machine. Once you import/add them in Virtualbox you need to follow additional steps and apply a few settings and then you will be able to configure your databases and run WordPress locally. Turnkey Linux provides such machine. You can download it from here.

Finally there are solutions that even contain WordPress within them and you can start adjusting the sample local site right away. Turnkey Linux has such a machine which can be downloaded from here.

Another option is to use a Bitnami virtual machine. You can grab one from here.

From this website you can download another pre-installed WordPress virtual machine.

So there you have it friends. Will you use pre-installed virtual machines or will you try to configure your own one? Share any thoughts on this topic in the comment section below. If you have any questions – we will be happy to assist you.

See you soon, friends!

What should you use for your local WordPress tests and development? XAMPP or Virtualbox? Find out now from this post:

Hello friends,

In this post I will present to you two of the most popular solutions for local WordPress tests and development. They are suitable for beginners and medium-skilled users.

The solutions that I am about to review in details are called XAMPP and Virtualbox.

But first things first! Why would you even consider using a solution for your local WordPress tests and development?

Because this may save you valuable time and effort as well as it may prevent some potential problems when creating a WordPress website directly on the production server with the real domain name.

Let’s imagine that you can build a simple WordPress website for a couple of days or a week at most. If you begin this process directly on your production server this means that you will have to purchase it in advance. This is also related to the purchase of a new domain name if you do not have an older one for test purposes that you can use to the production server.  So in most situations you will have to spend money and then start building your website from scratch.

If you are a complete beginner you may allow search engines to index your website when it is under development. In some cases this might cause potential problems with re-indexation later on. And if you are preventing the bots from indexing your project then you are wasting a week with a paid domain and hosting without getting any initial SEO results. And if something goes wrong you will have to start from scratch once again (in case you do not have backups) or start from a backup. But this will slow things even more.

Now imagine if you need to build an advanced website using WordPress. You can guess that you will need more time and the risks of breaking something are increased as well.

While the time and effort might still be the same when developing locally, you are saving time, effort and money for yourselves or for your clients for the SEO and digital marketing for the website. Why? Because it is better to upload and set up a complete WordPress installation that may launch immediately and start getting visits.

All of the above reasons were related to the creation of new websites. But what about your existing one when you need to try a new plugin? Doing this directly on the production server comes with a risk of breaking the theme or the functionality of the website due to incompatibilities. The latter might be PHP related, plugin related, theme related and etc.

Once again it is better to do tests locally and when the results are as expected to apply the changes on the production server.

OK, I am convinced! What is the difference between XAMPP and Virtualbox and what do I need to start developing or testing WordPress locally with them?

XAMPP for local WordPress tests and development

XAMPP is a project that provides you with a local server powerful enough to launch your WordPress website and easy enough to be the most suitable solution for beginners. All you need to do is download it from apachefriends.com and install it. You will find builds for Windows, Linux and OS X. After you are done installing you need to create a new directory under htdocs. In this directory place your WordPress installation. Lets assume that you call it localwp.

Start the XAMPP control panel and launch PHP and MySQL.

Then create a database using the built-in PHPMyadmin and edit wp-config.php with the needed information. After this you can access your local website in your browser by typing localhost/localwp (the name of the directory that you created).

Now you may begin developing a new website or testing your current one by transferring a backup copy to the local website.

In some situations you will need to adjust some settings but there are lots of tutorials online on how to achieve this. Also XAMPP makes it super easy to do this.

For more information, please view the following video:

Virtualbox can be used for Ubuntu server installation in order to develop and test WordPress locally

Virtualbox is an open source solution that will allow you to run virtual machines on your computer. Download it from here: www.virtualbox.org

In our case you might want to install Ubuntu server (or similar) and configure it locally. In this virtual server you can begin developing or testing your WordPress website.

Virtualbox can be useful for your local WordPress website creation and testing.

VirtualBox 5.0 for Windows. Within VirtualBox Ubuntu 14.04 is running. The image is embedded from the official Virtualbox’s website.

There are many guides on how to achieve this and it is not that hard. However I’d recommend this for medium and advanced users as beginners might face some problems and difficulties.

What are the advantages and disadvantages of each of these solutions?

I will make the comparison based on the following criteria:

  1. Speed and resource usage – in my opinion a virtual machine using Virtualbox and Ubuntu server is running faster and is saving more resources than XAMPP. However this might be different for you as it depends on your hardware configuration.
  2. Ease of usage – XAMPP is easier for beginners.
  3. Flexibility – XAMPP is limited to the PHP and MySQL versions that come with the current build. On the other hand the virtual server under Virtualbox will provide you with enough flexibility to choose exactly the tools that you need for your website.
  4. Possibility to add control panels – this is not a problem for the virtual server running under Virtualbox. A control panel provides more options and makes you feel like you are working on the real production server.
  5. Access from clients and other users – both solutions can do this. For XAMPP you will need to add your IP address as WordPress address in the admin panel of your website and save the permalink structure. Then instead of using localhost you can use your IP address and thus the local site can be accessed.
    Virtualbox however makes this easier and the website can be accessed by IP by default. You do not need to make changes to your WordPress admin panel. But what is more important is that Virtualbox and Ubuntu server can allow you to create multiple virtual hosts. For each of them you can have a stand-alone website that can be access by your clients and other users. All you need to do is to set the local domain names under your hosts file and by pointing your IP to each of them. Then you need to instruct your clients and users to do the same and the local websites can be accessed. For these cases I like to use .loc domain names. They are not real but for the purpose of local tests they are great. You can use whatever domain names you want. For example – .dev, .test and so on. When the website is completed and transferred to the production server the only change in the database for the domain name will be the end part. For example from .loc to .com.

So these are my criteria for comparing the two solutions. What do you think friends? Which one is the most suitable for you?

Before I end this post, I’d like to share some useful links with you:

See you soon, friends!

Final migration touches for the WordPress database with Search & Replace. Find out how to place things in order:

Hello friends,

In a previous post I have described the possible ways of migrating WordPress. For the manual ways of moving your website to another hosting and domain there might be some potential problems with the database entries. In other words – something might go wrong due to the fact that the URL structure and domain information that is stored in the database will be different than the actual situation.

In this post I will show you how to place things in order in case of such problem. You will learn how to achieve the final migration touches for the WordPress database with the plugin Search&Replace.

What does Search & Replace do?

The name gives a tremendous hint – you can search your database tables for the old domain name and replace it correctly with the new one.

But that is just one of the things that Search&Replace can provide for you.  When you download, install and activate it you can go to Tools -> Search&Replace and then you will see 5 tabs. Let’s review all of them individually:

The first tab is called Backup Database.

Create a manual backup of your WordPress database by using the plugin Search&Replace

There is a single button called “Create SQL File”. Click on it and you will get a SQL export of your WordPress database which you can keep for backup purposes. This file will be available for download via a newly created button with text “Download SQL File” which will be under a message that informs you of the successful export of the database.

The second tab is called Search & Replace.

Replace the domain name in all database tables by using the WordPress plugin Search&Replace

Here is the actual reason why you’d want to have this plugin installed and activated in the first place. In order to make the magic happen you have to enter the old domain name exactly as it was with http:// in front and www if you have used it. Below this field you have to enter the new domain in the same matter.

Then you need to select the database tables that you want to be searched and replaced with the new domain name. You may choose some of them but for migration purposes you need to use all of them. So instead of selecting them one by one you can simply click on the checkbox “Select all tables”.

Next you can make a Dry Run and this option is enabled by default. This is to ensure that the plugin works. For actual Search and Replace of the domain name you need to disable this. By doing so two radio buttons will become active. One of them allows you to make the changes and then export a SQL file. The other option is to make direct changes to the database. In case you choose the first option you will need to re-import this file in the database for your WordPress website in order to make the needed changes.

You can also use GZ compression for the database if needed.

When you make up your mind you need to click on the button “Do Search & Replace”. You will be presented with the results of the operation and in most cases it should be successful. At least I did not have any problems for now when using this method.

The next tab of the plugin is called Replace Domain URL.

Here you can replace the domain name in general and you can also change the database prefix if needed. For our purposes you might not need to use this tab at all.

The next one is called SQL Import.

In it you can import a SQL File and thus apply changes to the database. In our current situation I’d advise you to use PHPMyAdmin or other tool just to be on the safe side.

The last tab is called Credits.

Here you will be able to see information about the plugin.

How to achieve the final migration touches for the WordPress database?

First make sure that your website is accessible after the migration. You will need access to the WordPress admin panel. If this is not possible you will need to open PHPMyAdmin  or other tool that is provided by your hosting provider and make some changes in the wp_options table. Change the domain name for siteurl and home.

Then edit your wp-config.php and add the following two lines at its end:

define(‘WP_HOME’, ‘http://new domain name’);
define(‘WP_SITEURL’, ‘http://new domain name’);

Make sure that you add your new domain name in by replacing http://new domain name. Save the file and then try to access the login page of your WordPress website. You should be successful. If not – check the PHP version of the new hosting and change it to a version that you know is supported by your website.

Now you should be able to access the admin panel. Install and activate the Search&Replace plugin and then make the needed changes by using the Search & Replace tab. You are done and in most of the cases you will be successful!

Another way is to have the plugin installed and activated on the old hosting and domain name so that it will be instantly available for the new ones. You can also download the plugin ZIP file manually and extract it to wp-contents/plugins. By doing this you will be able to instantly activate it when you get access to the admin panel after the migration.

What else should you do in order to prevent potential problems?

First of all make sure that you have a backup of your database before using Search&Replace. This is extremely important! You may not encounter any problems but a backup needs to be present in case you are not so lucky. So to be on the safe side – make sure you have one!

What if Search&Replace does not replace everything 100% correctly?

Contact the plugin developers and ask for support.

That’s all folks! What do you think of this plugin? Share any thoughts and questions in the comment section below.

See you soon, friends!

UpdraftPlus – The supreme solution for WordPress backup

Hello friends,

We are back on the topic related to backup! As you know this is a very important thing related to each website or web project. And when it comes to a CMS system like WordPress where you are presented with regular updates then you should really take into consideration the best practices for creating and restoring backups.

In this post I will present another solution that can be easily marked as a supreme solution. This WordPress plugin is called UpdraftPlus.

What this plugin does?

UpdraftPlus is a solution for backup and restoration. Simple as that but in the mean time it offers a vast majority of important options that will ease your backups and increase your overall data protection in case of a failure related to your database or files.

So to summarize the main functions of UpdraftPlus – it is a supreme solution that will take care for the backups of your WordPress files and database and it will also aid you in their restoration in case of website failure and data loss.

Why I should choose UpdraftPlus instead of the many other plugins for WordPress?

This post is not a comparison between the different plugins. So in most cases you might be safe if you use any of the high-rated backup solutions that are available on WordPress.org.

However you will find that UpdraftPlus will be working extremely fast and well with your WordPress website. It is also extremely easy to use solution that will be suitable even for beginners which is another plus.

So let’s point out all of the features that you will get when you download, install and activate UpdraftPlus:

This plugin is suitable for all current PHP versions. UpdraftPlus also offers a premium version that extends the backup and restoration power by adding more backup destinations and features. UpdraftPlus can also serve as a duplicating solution for whole websites. This means that if you intend to move your WordPress from one host and/or domain to another then you can rely on this plugin to aid you in this task.

The premium version of UpdraftPlus also offers great support and you can also contract professional support for any enterprise projects that are utilizing the power of WordPress. And if you are using another backup solution then you will be glad to find out that UpdraftPlus can aid you in restoration from a backup made by it. This is very useful if you want to restore your website to an earlier version before the first backup created using UpdraftPlus. Currently you can benefit from this feature if you are a premium user and if your old backups are created from BackWPUp, BackupWordPress, Simple Backup, WordPress Backup To Dropbox.

The premium version of UpdraftPlus also provides options for encryption of the database backups in order to improve their security.

This plugin is with the highest ranking on WordPress.org. So it is safe to say that your website should be in secure hands if you are using UpdraftPlus. We are speaking for more than 700,000 active installations. I am also using this solution for several websites and I am very satisfied with its performance.

UpdraftPlus will help you ensure your investment in your website by providing you with high-quality backups that you can instantly restore in case of a problem.

More on the UpdraftPlus usage can be seen on this video:

What do you think friends? Will you give UpdraftPlus a try? Or maybe you have questions? Feel free to write them in the comment section below. Don’t forget to share this post on social media.

See you soon friends!

Optimize your WordPress with WP-Optimize

Hello friends,

Every WordPress website may go slower with time. There are several reasons why this might happen but one of the biggest ones is related to the Database.

So one way to optimize your entire WordPress website is by optimizing its Database in the first place.

Why this needs to be done?

The main reason is the speed of the website. WordPress relies strongly to its Database. Each post that you write, each page that you create or any other peace of content is stored there. Only the multimedia files and the theme files are on your server. So I hope that you understand why an unoptimized Database might drastically slow down your WordPress.

Why the Database becomes unoptimized in time?

The answer again lies in the way WordPress works. Like I have written above – every type of content and your entire website structure is stored there. Each change also is stored. Do you edit your pages or posts regularly? If so have you notices the list of revisions that are there? You are actually allowed to restore even the earliest version of each post/page. And you can imagine that this makes the utilization of the Database harder and thus WordPress is getting slower.

But not only revisions are the main problem. Each comment, each trackback for a published post, the trash for posts/pages/comments, etc. – all of these are making the Database bigger in size and slower in speed.

How to optimize the Database?

By using a professional solution that works flawlessly and in the mean time it is easy to use. Such solution is WP-Optimize.

After you install and activate this plugin you will be able to reduce the size of the Database and speed it up. This precious tool does not need PhpMyAdmin to do its work. And speaking of its work – WP-Optimize cleans up your Database tables and optimizes them.

Here are the most important optimization features of the plugin:

Since this is a powerful plugin it provides different options for its usage:

This wonderful plugin is applying native WordPress MySQL commands for optimization. It is also available for the users with role Administrator – other users won’t have access to its functionality for security reasons. When an automatic cleanup has occured you will receive an email notification.

When you are setting up your optimization options you will notice some red items. These are considered potentially dangerous. This means that if you let WP-Optimize apply them you might break up your WordPress Database and website. So use them with caution especially if you are a beginner. The other options are considered potentially safe however you should always make a complete backup before you attempt to use WP-Optimize especially if you are using it for the very first time on your WordPress website.

Here you can see how the WP-Optimize panel looks like:

And here is its famous mobile-device friendly version that allows you to optimize WordPress on the go:

So would you give WP-Optimize a try, friends? This is a vey high rated plugin (more than 200 5 stars are given by the WordPress community). Share your thoughts in the comment section below. Also me and the The CMS Place’s team will be thankful if you share this post on social media.

If you have any questions or remarks, please feel free to comment as well.

See you soon friends!

Installing WordPress on Ubuntu LAMP

In this tutorial we are going to install a wordpress website on a LAMP stack. WordPress is the most used CMS worldwide so it’s a great pick for testing our LAMP configuration. If you don’t have a LAMP stack installed you should check this article-Installing LAMP on Ubuntu

Create a database and a username in MySQL

First we need to create a database and a user corresponding to it in MySQL. In order to do that we need to log in to the root administrative account in MySQL. Type the following command:

mysql -u root -p

You’ll be asked for the password for the MySQL root user. Enter it.

Now you have access to MySQL. We are going to make the wordpress database. Use this command

CREATE DATABASE yourdatabasename;

We have to make a MySQL user for the database that we have just created and assign it a password.

CREATE USER yourusername@localhost IDENTIFIED BY 'yourpassword';

Now we have to assign the newly created user to our wordpress database. In order to do that just type:

GRANT ALL PRIVILEGES ON yourdatabasename.* TO yourusername@localhost;

We have to flush the privileges in order for MySQl to know that we have made changes

FLUSH PRIVILEGES;

We can exit mysql

exit
Download WordPress

In order to download the most recent and stable version of WordPress type the following:

wget http://wordpress.org/latest.tar.gz

This will download a compressed file containing the wordpress installation files and folders. We have to extract those files into our home directory.

tar xzvf latest.tar.gz

We have to install some additional modules in order to be able to install plugins in WordPress using our SSH login credentials.

sudo apt-get update sudo apt-get install php5-gd libssh2-php

Move WordPress files to Document root

In order for your website to be accessible you have to move your wordpress files to Apaches document root. The location of document root is /var/www/html/

It’s a good idea to create a separate directory for your wordpress installation. This way you can install multiple websites in your document root.

sudo mkdir /var/www/html/wordpress
sudo rsync -avP ~/wordpress/ /var/www/html/wordpress

Now your wordpress files are moved to your document root thus making them accessible for your visitors.

After that remove the wordpress folder and latest.tar.gz  in your home directory

rm latest.tar.gz
rm -rf wordpress

Our next task in to make changes to the wordpress config file

Configure WordPress

Navigate to /var/www/html/wordpress

We have to copy  the wp-config-sample.php to wp-config.php and to remove the wp-config-sample.php

cp wp-config-sample.php wp-config.php rm wp-config-sample.php

Let’s open the wp-config.php and change some fields.

vim wp-config.php

There are some fields which you need to change. We are changing them with the database and user in MySQL that we have made a while back.

define('DB_NAME', 'yourdatabasename'); 
define('DB_USER', 'yourusername'); 
define('DB_PASSWORD', 'yourpassword');

Save the file and exit.

Now we have to give our server access rights to our wordpress directory. If we don’t do that we won’t be able to update plugins upload images etc.In order to accomplish that we have to login as root.

su

Enter your root password

sudo chown -R www-data:www-data /var/www/html/wordpress

Return to your normal user account

su - yourusername

We have to grant read access to our general directory. In order to do that type:

sudo chmod -R 755 /var/www

Modifying Apache

In order to associate the domain we chose for our website with it’s proper location we have to make some changes

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/wordpress.conf

Now we have to edit wordpress.conf

vim wordpress.conf

We need to add the following lines

ServerName yourdomain.com ServerAlias www.yourdomain.com
Also we have to change this to your E-mail in order for you to receive E-mails

ServerAdmin [email protected]

Save and exit

We need to enable our website

sudo a2ensite wordpress.conf

In order for changes to take effect type

sudo service apache2 restart

To access your wordpress installation type the name of your domain in your browser and follow the installation instructions.

If you want to use wordpress pretty permalinks feature you have to make some changes in the host file.

vim /etc/apache2/sites-available/wordpress.conf

You have to add those lines bellow DocumentRoot  /var/www/html/wordpress.

AllowOverride All

Save and close. Next we need to enable the rewrite module. This enables you to rewrite URL’s

sudo a2enmod rewrite

restart the apache web server

sudo service apache2 restart

We need to create a .htaccess file in order for wordpress to write changes to it.

sudo touch /var/www/html/wordpress/.htaccess

To make the web server the group owner type

sudo chown :www-data /var/www/html/wordpress/.htaccess

Our last step is to give the .htaccess file the right permissions

sudo chmod 664 /var/www/html/wordpress/.htaccess

You can enjoy your newly installed WordPress website. Cheers!

Installing LAMP on Ubuntu

LAMP is an acronym which consists of: Linux (in our case Ubuntu), Apache web server, MySQL database for storing our website data and PHP for handling the dynamic content.

Creating a non-root user with super user privileges

Before we begin with the installation of the LAMP instance we have to make sure we have a non-root user with super user privileges. This step is important because in Linux managing your system while logged in as root user is considered bad practice. The reason behind this is that the root user has very broad privileges which allow him to gain access and to execute critical commands-commands that can possibly lead to system failure.

In order for us to make a non-root user with super user privileges we need to be logged in as a root user.

Type su in your shell for logging in as root user.

su

If you don’t have a root account you have to create one.

In order to do so you need to run the following commands

sudo passwd root

You will be prompted for a password for your root account. Then you need to execute the following command in order to unlock your root account.

sudo passwd -u root

Now let’s create the user. Execute the following command:

adduser yourusername

You’ll be asked some questions. Other than the password the other fields aren’t mandatory.

In order to give your user root privileges execute the following:

gpasswd -a yourusername sudo

This will add your user to the sudo group. As a consequence every time when you run a command starting with sudo you’ll be executing it with root privileges.

In order to log in with your newly created user type this:

su – yourusername

Now let us get back to installing the LAMP instance.

Installing Apache Web Server

First we need to install the Apache web server. We’ll be using the Ubuntu repository for the task.

First we have to make sure that our repository is updated. We should run the following.

sudo apt-get update

After our repository has been updated we are ready to install the apache web server. Type this command:

sudo apt-get install apache2

Now our Apache Web Server is installed. To check if your Apache web server installation was successful type your server ip address in your browser. You have to see the Apache2 Ubuntu Default Page.

If you don’t know your server public ip address type the following:

Ip addr show

Next to inet you”ll find your ip address

Inet youripaddress/

When a directory is requested by default Apache first looks for index.html. We want to change that so as a result apache will look first for index.php. To do so type this:

sudo vim /etc/apache2/mods-enabled/dir.conf

We want to move the index.php in the first place next to the DirectoryIndex

DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm

Now we need to restart the Apache web server in order for our changes to take effect.

sudo service apache2 restart

Installing MySQL

MySQl is a database management system. With it you can easily store, access and organize your website information.

We need to run the following command in order to install MySQL:

sudo apt-get install mysql-server php5-mysql

During the installation you’ll be prompted for the MySQL root user password. Just generate one and enter it. After the installation we have to generate MySQL database directory structure.

sudo mysql_install_db

After that we have to run a security script in order to secure our MySQL installation.

sudo mysql_secure_installation

Remove the anonymous user, disallow the remote root login and remove the test database. After that reload the privileged tables. That’s it.

Installing PHP

PHP is going to be used in order to display our dynamically generated content. Again we are going to use the apt-get.

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

Now our php package has been installed. Php comes with optional modules you can install. In order to search them up type:

apt-cache search php5-

From the additional modules we will install php5-cli- command-line interpreter for the php5 scripting language.

sudo apt-get install php5-cli

Our last task is to test how php handles things. We have to create a test file in a specific directory (web root). on our server.

sudo vim /var/www/html/test.php

Now we want to put the following and to save the file:

<?php 
phpinfo(); 
?>

In order to test our php we need to navigate to the newly created test.php file in our browser.

http://your_server_IP_address/test.php

You have to see something like this:

php
In order to keep your server secured you should remove the test.php file

sudo rm /var/www/html/test.php

Now you have a working LAMP instance ready to host your websites.