WordPress installation and configuration with Nginx in Debian 10


Complete Guide to the Installation and Configuration of WordPress with Nginx in Debian 10. WordPress is one of the most popular Content Management System (CMS) platforms in the world, many creator content uses it. One of the main reasons for its popularity is the ease of use and the ability to adjust the appearance and features as needed. In this article, we will guide you through complete steps to install and configure WordPress using Nginx as a web server in the Debian Operating System 10.

Step 1: System Update

Before doing the installation, it is very important to update the operating system so that all packages and dependencies are already in the latest version. This can help avoid compatibility problems.

Open your terminal and run the following command to update and improve the system:

apt update && apt upgrade -y

Step 2: Create a database in Mariadb

Mariadb is a database management system (DBMS) to store all WordPress data, including posts, users, comments, and others. To install Mariadb, you can look at the following link in a CLI -based database server management guide.

To prepare a database on WordPress follow the following information, among others, WordPress_DB is the name of your database, WordPress_user is a user name, and 123456 is a password for the user. The following code:

mysql -u root -p

CREATE DATABASE wordpress_db;
CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wordpress_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 3: PHP installation and extension

PHP is needed to run WordPress because this is a programming language used by WordPress. Besides PHP, some additional extensions are also needed.

The following command to install PHP and extension, use the following command:

apt install php-fpm php-mysql php-curl php-xml php-xmlrpc php-gd php-mbstring php-zip -y

After PHP and all extensions installed, make sure PHP-FPM runs with the command:

systemctl start php7.3-fpm
systemctl enable php7.3-fpm

Step 4: Download and configuration WordPress

Now we are ready to download WordPress from the official website. After the file downloads, extract the file. Move the extraction results to the Nginx web root directory. Set a file permit so that Nginx can access and write files. Do this with the following command:

wget 
tar -xvzf latest.tar.gz
mv wordpress /home/tjkt/html/wordpress
chown -R www-data:www-data /home/tjkt/html/wordpress
chmod -R 755 /home/tjkt/html/wordpress

Step 5: Nginx Configuration for WordPress

Now, we need to configure Nginx in order to serve WordPress. Create a new configuration file for WordPress sites at Nginx:

nano /etc/nginx/sites-available/wordpress

Add the following configuration:

server {
    listen 80;
    server_name _;
    root /home/tjkt/html/wordpress;

    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }
}

After creating a configuration file, activate the WordPress site virtualhosting with the command:

ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx

Step 6: WordPress Configuration

Now, we will set the WordPress configuration file. First, copy the default configuration file:

cd /home/tjkt/html/wordpress
cp wp-config-sample.php wp-config.php
nano wp-config.php

define( 'DB_NAME', 'wordpress_db' );
define( 'DB_USER', 'wordpress_user' );
define( 'DB_PASSWORD', '123456' );
define( 'DB_HOST', 'localhost' );

Save and close the file after completion.

Step 7: Complete the installation in the browser

The final step is to complete the WordPress installation through the web interface.

  1. Open a browser and navigate to your server address or domain name, such as or
  2. You will see the WordPress installation page. Select language and follow the instructions on the screen to set the site name, create an admin account, and complete the installation.

Cover

By following the complete guide to the installation and configuration of WordPress with Nginx in Debian 10, you have successfully installed WordPress on Debian 10. Thus this guide is made, hopefully this guide is useful for you!

Also read articles about: Nginx Web Server Installation and Configuration Guide on Debian 10



Game Center

Game News

Review Film
Rumus Matematika
Anime Batch
Berita Terkini
Berita Terkini
Berita Terkini
Berita Terkini
review anime

Gaming Center