Thursday, 7 January 2016

Wordpress Installation in linux server

1. Log in as Root user.
$ sudo -i
2. Install the Httpd or Apache service.
# yum install httpd
Now Start the httpd service.
# service httpd restart
To start the service while booting run following command.
# chkconfig httpd on
Now Check the httpd service is working or not.
http://<ip address>
you will get the Default Httpd page.
3. Install MySQL Server service.
# yum install mysql-server
Now Start the Mysqld service.
# service mysqld restart
Once it is done installing, you can set a root MySQL password using below command.
# /usr/bin/mysql_secure_installation
The prompt will ask you for your current root password.
Since you just installed MySQL, you most likely won’t have one, so leave it blank by pressing enter.
Login to mysql
# mysql -u <username> -p <password>
create database for wordpress
mysql> create database <databasename>;
mysql> exit
4. Installing PHP service.
# yum install php php-mysql
Once you answer yes to the PHP prompt, PHP will be installed.
PHP Modules
PHP also has a variety of useful libraries and modules that you can add onto your server. You can see the libraries that are available by typing following command.
 #  yum search php-
If you want install the required module install by using below command.
 #  yum install name of the module

Congratulations! You now have LAMP stack on your droplet!.
5. Download the wordpress
# wget https://wordpress.org/latest.zip
it download the wordpress zip file
go to download folder
unzip the wordpress
# unzip latest.zip
copy the files in wordpress folder to the /var/www/html
#cp -fr wordpress/*  /var/www/html
go to /var/www/html
copy the wp-config-simple.php   to wp-config.php
# cp -rf wp-config-sample.php  wp-config.php
then edit wp-config.php file
# vim wp-config.php


           Enter the database name in place of "database-name"
           Enter the database username in place of "user"
           Enter the database password  in place of "password"
         if you are  using remote mysql server edit localhost name with you remote server ip or domain


Restart apache so that all of the changes take effect on your server.
   #   service httpd restart

Now check your  result in web browser.
http://<ip address>/