There are several ways to install WordPress. In this tutorial, we will download and install a WordPress CMS using SVN on CentOS 7. What is SVN?
SVN stands for Apache Subversion, which is version control and version control software and is distributed as free software under the Apache license. Many developers use Subversion to maintain current and historical versions of files, such as the source code for web pages and documentation.
Apache Subversion is an open source, centralized version control system characterized by its reliability as a secure storage for valuable data, its ease of model and use, and its ability to support the needs of a wide range of users and projects, up to large-scale enterprise operations.
The official WordPress repository uses SVN (http://core.svn.wordpress.org/), which means you get the files directly from WordPress.
Although you can install WordPress in different ways, if you are using a repository you can do the following:
- Fast and easy upgrade and downgrade to different WordPress versions;
- Faster updates as only changed files are transferred;
- Rollback to a previous version of files if you get confused.
Please make sure you have a LAMP stack installed on your server. If not, then follow our article on installing LAMP (Linux Apache, MariaDB and PHP) on CentOS 7.
Update the system
Log in to the server as “root” and make sure your Linux is fully up to date:
ssh [email protected] yum update
You can install SVN by running the following command:
yum install svn
Then check the installation:
You should get the following output:
Type 'svn help' for usage.
Now that you’ve installed SVN, check out the latest stable version of WordPress. You can do this by visiting the official WordPress site …
At the time of this writing, the latest version of WordPress is 4.1.
For our site, we will install WP in Apache by default at the document root located at / var / www / html /. Therefore, we need to create a directory for installation by running the following command:
Check out WordPress 4.1 from the repository. Enter the following command:
svn co http://core.svn.wordpress.org/tags/4.0.1/ /var/www/html/wordpress/
With the above, the download commands will be placed in the / var / www / html / wordpress / directory. You will see the files being loaded, noting the version numbers. After completing the process, you will see the message: Checked out revision [random number]…
Congratulations. You have installed WordPress using SVN.
Next, you need to set up your database and set up WP.
You can do this easily by following our tutorial on how to install WordPress on CentOS 7. To create a database, modify wp-config.php by running 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 complete the WordPress installation by opening your web browser and navigating to the following URL http: // your_ip_address / wordpress /.
SVN uses a special directory that contains important information. It is called .svn and it is recommended to block access to this data so that it cannot access the outside world.
You can visit http: //your_ip_address/.svn/ and you will see all the administrative files for the repository, definitely not good! So let’s fix that.
Open the Apache config file:
Find the line AllowOverride in the
Now create a new .htaccess file by entering the following command:
Add the following content to this file:
order deny, allow deny from all
Restart the web server after the change to become active:
systemctl restart httpd.service
After that, you or someone will try to open http: //your_ip_address/.svn/ and get an internal server error.
Everything. You have successfully installed WordPress using SVN.