WordPress is one of the popular Content Management System (CMS). It is an open source website creation tool build by PHP. Most the websites are running through this application. It is also available in FTP server or we can configure it and run from our own servers.

In this article we going to see how to install and run Wordpress in our local system.

For installing wordpress the server should be a LAMP configured server since wordpress is a PHP based application,

For LAMP installation,

For Centos,

Click here for RPM based machines.

For Ubuntu,

Click here for Debian based machines.

Installing wordpress,

    Download the wordpress opensource package from their official site Wordpress.Org. You can either download the zip file or tar.gz file.

$ wget https://wordpress.org/latest.zip

Unzip the file

$ unzip latest.zip

Move the unzipped file to the document root of your apache server.

$ mv wordpress /usr/local/apache-2.4.37/htdocs/

Add a Virtual host to run a website using the wordpress, We gonna run my.com through wordpress,

<virtualhost *:80>
ServerAdmin admin@my.com
DocumentRoot "/usr/local/apache-2.4.37/htdocs/wordpress"
ServerName my.com
ErrorLog "logs/my.com-error_log"
CustomLog "logs/my.com-access_log" common
</VirtualHost>

To know about more on setting up a virtual host Click here

Permissions for the web user,

Change the ownership for the wordpress directory since it requires permissions to folders while you are uploading files, images,etc..,. to your site.

$ chown daemon:daemon /usr/local/apache-2.4.37/htdocs/wordpress/ -R

Creating a database and providing grants:

$ mysql

Create a database for your site,

mysql> create database mysite;

Grant privileges to the wordpress user for the database,

mysql> grant all privileges on mysite.* to "admin"@"localhost" identified by "Password123";

mysite will be your database name, for "admin" enter the username and for "localhost" leave it if you want to install wordpress on your local system or mention the server IP if installing in anyother server.

Flush the privileges,

mysql> flush privileges;

Add a host entry to the server IP to my.com and access the same on your browser, you will be redirected to the setup page. Click Let's go! to begin the installation.

 Database Name - Enter the database name of your site.
  
 Username - The one you provided on the mysql grants.

 Password -  The one you provided on the mysql grants. 

 Database Host - Enter the IP of the server or 127.0.0.1 if its in local system.

 Table Prefix - You can leave it as default.

Click Submit which will prompt another window for installation,

 After Clicking the Run the install, it will redirect to another prompt for the Site details,


Click Install Wordpress, Final one will be the success prompt which will allow you to login to your Wordpress Dashboard,


Finally you will be redirected to your Wordpress dashboard for your site.


You have successfully installed wordpress on your system,

Please let me know if you have any questions.


Comments

  1. Be the first to add a comment.