After the first blog, I wanne describe how I build my wordpress blog.

As you guys know, we usually choose a delicate or neat theme to build the WordPress sites. So am I, I chose the theme of Minimal Lite which suits my taste of beauty thing. And I think that even though I have the excellent programming skill, I won’t change the code of the theme a lot. Whatever although having the limit of programming skill, I want to build a blog to record my life as I said on the introduction of the author section. Cut the crap, let’s start to see how I build my blog site. I hope this experience will be helpful for you.

Step one: Basic configuration

I chose the LAMP to establish my 2G serve which I have rent from Linode. And I have found a guide from a blog. But it is a Chinese site, so I will write the code below, or If you know Chinese, you can check it by yourself.

Server Configuration

  • 2G RAM
  • 1 CPU
  • 50G storages

LAMP Version

  • OS ubuntu 16.04 LTS 
  • Apache2
  • Mysql 5.7.25 
  • PHP7.0

Step two: Server Establishment

“-y” is mean that when you install the components or software, there will be a hint whether you want to install or not. Choose to use by your case.

 sudo apt-get update
 sudo apt-get upgrade
apt-get install apache2 –y

(If you can access the “it works” page, It means the installation of the apache2 is OK)

You can see there is a php7.0 in apt-get, so we can install the php7.0 directly.

sudo apt-get install php7.0 -y

And then to install a component to associate the php and apache:

sudo apt-get install libapache2-mod-php7.0
sudo apt-get install mysql-server -y

Then install a component to associate the php and mysql.

sudo apt-get install php7.0-mysql

We can install the phpmyadmin for easily manage the mysql database.

(p.s. you will need to choose the apache2 and then input the root password when you install the phpmyadmin using the apt-get.)

sudo apt-get install phpmyadmin –y

(You can access all the files of /www directly when you setup the soft connection to associate the mysql and phpmyadmin files.)

sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
sudo service mysql restart
sudo systemctl restart apache2.service

Use your root account to enter the database

mysql -u root -p

And then create a new database and user.

mysql>CREATE DATABASE wordpress;
mysql>CREATE USER wordpressuser;
mysql>SET PASSWORD FOR wordpressuser= PASSWORD("password123");

At last, grant database operation permissions for new users

mysql>GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser IDENTIFIED BY"password123";

Effective configuration

mysql>FLUSH PRIVILEGES;
mysql>exit;

 

Ok, the LAMP establishment is done, and it almost will be Ok in a one-time. But well I’m not on the almost cases. I have encountered a lot of issues. And I will list all of the issues I have met later. 

Step three: WordPress Site Building

In most of the cases, we usually download the WordPress installation through terminal. But I suggest upload the code repository decompressed from tar file.

Wherever you upload the repository, just run the command below to move the repository to the apache2 default root folder which we can access your public IP address to open the WordPress index page.

sudo mv wordpress/* /var/www/html/

We need to give Higher permission to html for modifying WordPress repository easily.

sudo chmod -R 777 /var/www/html/
sudo mv /var/www/html/index.html /var/www/html/index~.html
sudo systemctl restart apache2.service

Now, the installation of WordPress site is done. Also, it will be OK in most of the cases. You can access the WordPress index page through inputting the public IP address and use your new mysql user and database to setup your WordPress site. At last, my first WordPress version page. 👇