Hello all,
This is my first post on this blog and I will write about how I installed my WordPress page.
To run WordPress website we need to have Web Server and database. For Web Server I have chosen most easiest and that is Apache, for database I picked out MariaDB also known as MySQL.
Step 1. Installing all required packages Link to heading
To install all needed packages you need to run this command:
sudo apt install -y apache2 php mariadb-server php-mysql php-xml php-curl
I added installation of php-xml
and php-curl
because my plugins need them in order to work
Step 2. Downloading and unpacking WordPress Link to heading
I have installed WordPress in default location which is /var/www/html
cd /var/www/html
sudo wget http://wordpress.org/latest.tar.gz
sudo tar xzf latest.tar.gz
sudo mv wordpress/* .
sudo rm -rf wordpress latest.tar.gz
sudo chown -R www-data: .
As I am writing blog I will need to configure Permalinks to Post Name so I have look of my links like https://dewa.hopto.org/%postname%/.
To enable this I need to configure two things on Apache.
First I enabled rewrite module, because this will be rewriting all my URLs to look i want.
To enable rewrite module:
sudo a2enmod rewrite
Next we need to enable directory options
#find /var/www directory and set AllowOverride All and Require all granted, like code bellow
vi /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Lets now restart Apache and enable it to run on boot
sudo systemctl restart apache2
sudo systemctl enable apche2
Step 3. Configuring database Link to heading
To setup database first command I ran:
sudo mysql_secure_installation
Here MySQL will ask you some question on which the best way to answer is to type Y
to all questions
Next step is creating database and setting root user to have all permission on new database
sudo mysql -uroot -p
#mysql prompt
> CREATE DATABASE wordpress;
> GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
> FLUSH PRIVILEGES;
Press CTRL + D to exit
Last step is to enable database to run if we restart our system
sudo systemctl enable mysql
Step 4. Configure WordPress installation Link to heading
To finish WordPress installation, go to http://localhost/wp-admin
and give the answers to the questions that come up.