How To Install WordPress On Ubuntu 20.04

Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is an most popular opensource CMS. You can install on your vps or local server using my tutorial.

How To Install Zabbix 5.0 On Centos 7

How To Install DNS Server (Bind9) On Ubuntu 20.04

My server info :
Server IP : 10.66.11.15
Disk : 25 GB
RAM : 1GB
vCPU : 2
Service : WordPress
Web : Apache
Database : Mariadb
Php : 7.4

Step : Check server version and ip address.

root@WordPress:~# lsb_release -a
root@WordPress:~# ip r

Step : Server update & install web server and database.

root@WordPress:~# apt-get update && apt-get upgrade -y
root@WordPress:~# apt-get install apache2 apache2-utils -y
root@WordPress:~# systemctl enable apache2
root@WordPress:~# systemctl start apache2
root@WordPress:~# apt install mariadb-server -y
root@WordPress:~# systemctl enable mariadb
root@WordPress:~# systemctl start mariadb
root@WordPress:~# mysql_secure_installation

Press y| Y    << Type Y press enter

Do you want to continue press y|Y   << Type Y press enter

Remove anonymous user press y|Y  << Remove anonymous user type Y press enter

Disallow root login remoetly y|Y  << Disallow root user login type Y press enter

Remove test database and access to it y|Y  << Remove test database type Y press enter

Reload privilege tables now? y|Y  << Reload all tables type Y press enter

Step : Install php and check properly working.

root@WordPress:~# apt-get install php7.4 php7.4-mysql libapache2-mod-php7.4 php7.4-cli php7.4-cgi php7.4-gd -y
root@WordPress:~# vi /var/www/html/tech.php

Insert below code into tech.php file.

 //PHP code goes here 

Browse your server ip address with file name tech.php

http://10.66.11.15/tech.php

Step : Download latest WordPress and setup permission.

root@WordPress:~# wget -c http://wordpress.org/latest.tar.gz
root@WordPress:~# tar -xzvf latest.tar.gz
root@WordPress:~# rsync -av wordpress/* /var/www/html/
root@WordPress:~# chmod -R 755 /var/www/html/
root@WordPress:~# chown -R www-data:www-data /var/www/html/
root@WordPress:~# rm -rf /var/www/html/index.html

Step : Create database for install WordPress.

root@WordPress:~# mysql -u root -p

If you not setup mysql root password from step last command. So it is default password is blank.

MariaDB [(none)]> create database wp_db;
MariaDB [(none)]> grant all privileges on wp_db.* to 'wp_db_user'@'localhost' identified by 'wp_db_passw0rd';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> q

Step Create wp-config.php file from original file.

root@WordPress:~# mv /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
root@WordPress:~# vi /var/www/html/wp-config.php

Now insert below details already created from Step .

define('DB_NAME', 'wp_db');
define('DB_USER', 'wp_db_user');
define('DB_PASSWORD', 'wp_db_passw0rd');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

Restart apache and mariadb server and check default vHost file is ok.

root@WordPress:~# systemctl restart apache2.service
root@WordPress:~# systemctl restart mariadb.service
root@WordPress:~# vi /etc/apache2/sites-available/000-default.conf

Like example below


       ServerAdmin webmaster@localhost
       DocumentRoot /var/www/html
       ServerName server_domain_name_or_IP

       AllowOverride All

       ErrorLog ${APACHE_LOG_DIR}/error.log
       CustomLog ${APACHE_LOG_DIR}/access.log combined

Step Rewrite enable and create htaccess file and setup permission.

root@WordPress:~# a2enmod rewrite
root@WordPress:~# systemctl restart apache2
root@WordPress:~# touch /var/www/html/.htaccess
root@WordPress:~# chown :www-data /var/www/html/.htaccess
root@WordPress:~# chmod 664 /var/www/html/.htaccess
root@WordPress:~# service apache2 restart

Now browse your server ip address and complete installation process.

http://10.66.11.15/

Then click Continue and type site title, Username, Password and Your Email. Now click Install WordPress.

If all is ok so you see Success! 

WordPress has been installed. Thank you and enjoy!

For more details see my YouTube video.

 

The post How To Install WordPress On Ubuntu 20.04 appeared first on TechnologyRSS.


Discover more from Ubuntu-Server.com

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply