Skip to main content

How to install wordpress in linux

WordPress is a powerful, free and open-source, highly pluggable and customizable CMS that is being used by millions around the world to run blogs and fully functional websites.

It is easy to install and learn, especially for persons who do not have prior website design and development knowledge.

Step 1: Install Apache Web Server
   To install apache server follow the instructions below
   $ sudo apt-get install apache2 apache2-utils 
 
   Now we need to check whether it is installed or not
    Go to the browser and type localhost if it is shown like this then no problem your apache is installed successfully
 

NOTE: The default Apache root directory is /var/www/html all your files are stored in the directory.


STEP 2: Install MYSQL Database Server:
   Now we need to install the MYSQL Database Server by running this command
  $ sudo apt-get install mysql-client mysql-server
During the package installation, you will be prompted to set the root user password for mysql .

To open the mysql ,type 
      $ mysql -u root -p in terminal
STEP 3 : Install PHP and Modules
    
       we can install PHP by type the command in terminal

       $ sudo apt-get install php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-cli php7.0-cgi php7.0-gd  

 OR

   sudo systemctl restart apache2 
for 19.0 and above
To check the PHP is  installed properly , we need to create a info.php file inside /var/www/html. $ sudo vi /var/www/html/info.php
And paste the code below into the file, save it and exit.
   <?php 
    phpinfo();
    ?>  
Then open the browser and type localhost/info.php .If you find a screen like this then no problem
all set is ok.


STEP 4: Install WordPress CMS;
   Download the latest version of wordpress by typing the command below:
$ wget -c http://wordpress.org/latest.tar.gz
$ tar -xzvf latest.tar.gz
Then move the WordPress files from the extracted folder to the Apache default root directory, /var/www/html/:
$ sudo rsync -av wordpress/* /var/www/html/
Next, set the correct permissions on the website directory, that is give ownership of the WordPress files to the web server as follows:
$ sudo chown -R www-data:www-data /var/www/html/
$ sudo chmod -R 755 /var/www/html/
STEP 5: Create WordPress Database
 Type the command 
   $ mysql -u root -p
At the mysql shell, type the following commands, pressing Enter after each line of a mysql command. Remember to use your own, valid values for database_name, databaseuser, and also use a strong and secure password as databaseuser_password
mysql> CREATE DATABASE wp_myblog;
mysql> GRANT ALL PRIVILEGES ON wp_myblog.* TO 'your_username_here'@'localhost' IDENTIFIED BY 'your_chosen_password_here';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
Go the /var/www/html/ directory and rename existing wp-config-sample.php to wp-config.php
Open the file wp-config.php and change the dbname,dbuser,db_password,and etc
Note: Do not change all the things.

Afterwards restart the server by this command
$ sudo systemctl restart apache2.service 
$ sudo systemctl restart mysql.service 
Open your web browser, then enter your server address: http://server-address to get the welcome page and enter the asked detail.

Contents and Commands from tecmint.com

                  Now all set ok Please leave a comment if you have any doubts

Comments

  1. Really very informative and creative. This sharing concept is a good way to enhance knowledge. I was searching for the best cms for seo on google search and found your blog. Keep sharing such great information.

    ReplyDelete

Post a Comment

Popular posts from this blog

how to install flutter in linux mint:

What is Flutter?        Flutter is Google’s portable UI toolkit for building beautiful, natively-compiled applications for mobile, web, and desktop from a single codebase.   And Flutter have Many characteristics and you can see here .  How to Install it in your Linux Machine? You can download the Flutter package here . Extract the file in a separate folder.  cd ~/development  tar xf ~/Downloads/flutter_linux_v1.5.4-hotfix.2-stable.tar.xz Add the flutter tool to your path:  export PATH="$PATH:`pwd`/flutter/bin" And enter the code   flutter precache to check the flutter installed. And Run Flutter Doctor By the command   flutter doctor to see any folder is missing for that. (From Flutter.dev) Android Setup: Download and install the android studio . Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDK Platform-Tools, and Android SDK Build-Tools, which are required by Flutter when

How to install Blender 2.80 (beta) in Linux:

About Blender:        Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing and motion tracking, even video editing and game creation. How to install the beta version: Download the latest version of the blender from here  . It will download an tar.gz folder. Extract the folder . Jump into the folder   and click on the Blender named file it will direct to the latest version but don't click on the blender.desktop file. Then it will open the blender window like this.