It has been a long time not write for this blog because I’m busy with my project and this is a documentation of what I have been done in the past few months to develop a website for a friend of mine. Luckily, WordPress helps me a lot when come to a simple and easy way for website development. In this article, I will describe how to install WordPress in my system to provide a separate website with different themes configuration.
First of all, you have to install Apache, MySQL/MariaDB, and PHP before installing WordPress. I don’t want to repeat on how to install Lamp in Fedora but you can find many tutorial related with Lamp installation on Fedora like from techmint.
This step is not necessary, but installing phpMyAdmin as an interface for MySQL/MariaDB will help you manage your database easily. Here is the steps that I do in my system.
- Open terminal
- type this command, sudo dnf install -y phpmyadmin and wait until the installation process is done.
- Open your favorite web browser and type localhost/phpmyadmin in the web browser address bar.
- The username and password that you have to fill in is the username and password that you create in the Lamp installation step. Type that username and password and you will see the dashboard screen of phpmyadmin.
- You’re ready to manage your database in your database server.
The requirement to install WordPress in your system besides the WordPress package itself, it is a database and database server username and password. To provide the WordPress requirement, here is what I’m done in my system.
Usually, when I use WordPress in my computer I will use the database root username and password then create a database. So, if I have more than one WordPress installation in my computer, the username and password is same but the database name is different. Now, I want try another things which is use a different database server username and here is what I do,
- Open terminal and type mysql -u root -p
- Type your root database username password
- Type this command below to create a new database and database user then assign the right database privileges for the new user to be able to use the new database.
- create database wordpress;
- create user ‘wpuser1’@’localhost’ identified by ‘wpuser1pass’;
- grant all privileges on wordpress.* to ‘wpuser1’@’localhost’;
- flush privileges;
- Quit from database server.
In the future, when I need to install WordPress again for another prototype or example of my project, I just need to repeat the steps above for different username and database name.
Get the WordPress Package
Get the latest WordPress package from WordPress by download it through your web browser or use terminal like I do. Here is the steps if you want to download WordPress package from your terminal.
- Open your terminal
- Type wget http://wordpress.org/latest.tar.gz and wait until the download process is done.
- Copy and extract latest.tar.gz into /var/www/html/ using this command:
- sudo cp latest.tar.gz /var/www/html/
- cd /var/www/html/
- sudo tar zxvf latest.tar.gz
- Change the owner and group of the extracted package into apache using this command: sudo chown apache.apache -R wordpress/
Now, we’re ready to start the WordPress installation.
After finish extracting the WordPress package and set the right owner and group, the installation time is arrive. You can start the installation from two ways.
First is by using your browser then type localhost/wordpress in the address bar and start fill out the requirement such as the database server username and password and the database name then continue the installation steps by following the provided guide line. Second, you can set up first the wp-config.php then start the WordPress installation. Both way will give you same result but for me, I like the second way better. Here is what I’m doing in the second way.
- Open your terminal and then go to /var/www/html/wordperss
- Make a copy of wp-config-sample.php into wp-config.php using this command: sudo cp wp-config-sample.php wp-config.php.
- Open wp-config.php with your favorite text editor, I will use nano for this, and this is what I do: sudo nano wp-config.php
- Change the word database_name_here with your database name, username_here and password_here with the database username server and password that you created before.
- Save the changes by pressing CTRL+O and CTRL+X for quit from nano.
- Open your browser then type localhost/wordpress in the address bar to start configure the WordPress.
The steps for WordPress installation is stops in here and the rest of the installation you can do it by yourself by reading every guide line that appears during the installation.
I hope this documentation is helpful for all of you who have similar project with me.