Install WordPress using SVN on a CentOS 7 VPS
There are multiple ways of installing WordPress. In this tutorial we will download and install WordPress CMS using SVN on a CentOS 7 VPS .
What is SVN?
SVN stands for Apache Subversion which is a software versioning and revision control system distributed as free software under the Apache License. Many developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation.
This is because Apache Subversion is a centralized and open source version control system characterized by its reliability as a safe haven for valuable data, the simplicity of its model and usage and its ability to support the needs of a wide variety of users and projects, from individuals to large-scale enterprise operations.
The official WordPress repository uses SVN ( http://core.svn.wordpress.org/ ) which means that you’re getting the files directly from WordPress.
Although you can install WordPress in many different ways, if you are using a repository you will can do the following:
Fast and easy upgrades and downgrades to different versions of WordPress;
Faster updates since only the changed files are transferred;
Roll back to the previous version of files if you mess something up.
We are using our SSD 1 VPS hosting plan for this tutorial.
UPDATE THE SYSTEM
Login to your server as user ‘root’ and make sure your Linux VPS is fully up-to-date:
# ssh [email protected] # yum update
You can install SVN by issuing the following command:
# yum install svn
Then test the installation:
You should get the following output:
Type 'svn help' for usage.
Now that you installed SVN, check out the latest stable version of WordPress. You can do that by visiting the official WordPress website.
At the time of writing of this article, the latest WordPress version is 4.1.
For our purpoces we will install WP into the default Apache document root which is /var/www/html/. Therefore we need to create a directory for the installation by issuing the following command:
# mkdir /var/www/html/wordpress
Check out WordPress 4.1 from their repository. Enter the following command:
# svn co http://core.svn.wordpress.org/tags/4.0.1/ /var/www/html/wordpress/
With the above command the download will be placed into the /var/www/html/wordpress/ directory. You will see the files being downloaded while noting the version numbers. After the process is complete you will notice the message: Checked out revision [random number].
Congratulations. You have installed WordPress using SVN.
Next, you need to set up the database and configure WP.
You can do that easily by following our fine tutorial on how to Install WordPress on a CentOS 7 VPS . Create the database, change your wp-config.php details and run the following command:
# chown -R apache:apache /var/www/html/wordpress/*
which will set the correct ownership of your files.
WordPress is now ready to use. You can finish your WordPress installation by opening your favorite web browser and navigate to: http://your_ip_address/wordpress/
SVN uses a special directory that contains important information. It is called .svn and it’s recommended to block access to this data so it can’t be accessed by the outside world.
You can visit http://your_ip_address/.svn/ and you will see all the administrative files for the repository, which is definetely not good! Therefore let’s fix this.
Open the Apache configuration file:
# vim /etc/httpd/conf/httpd.conf
Locate the AllowOverride line in the <Directory “/var/www/html”> section. Change the setting from None to All. This will allow .htaccess to be active.
Now create a new .htaccess file by entering the following command:
# vim /var/www/html/.svn/.htaccess
Add the following contents to this file:
order deny, allow deny from all
Restart your web server for the changes to become active:
# systemctl restart httpd.service
After this you or anyone trying to open http://your_ip_address/.svn/ will get an Internal Server Error.
That is it. You successfully installed WordPress using SVN.
Of course you don’t have to do any of this if you use one of our Linux VPS hosting services, in which case you can simply ask our expert Linux admins to do this for you.They are available 24×7 and will take care of your request immediately.
PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.