WordPress Setup Guide on Debian 12: Nginx, PHP, and MySQL Environment Configuration
To set up WordPress, you can use a Linux system. The Linux environment can either be a virtual machine on your local computer or a server from a cloud provider. Since WordPress is developed using PHP, you’ll need to install the PHP runtime environment, as well as the web service Nginx and MySQL database.
Log in to your Linux system using an SSH tool. In this case, I’m using Debian 12.
rm -rf /var/root/html/* # Delete the default Nginx files in the root directory vim /etc/nginx/sites-enabled/default # Edit the Nginx configuration file
index index.html index.htm index.php; # Add index.php
# After editing the configuration, use the following command to check if the configuration file is correct. If the following output appears, it's correct: ➜ ~ nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
systemctl start nginx # Start the Nginx service systemctl enable nginx
netstat -ntlp # Check if port 80 is listening
Installing MySQL
1 2 3 4 5 6 7 8 9 10 11 12 13
apt install -y gnupg
wget https://repo.mysql.com/mysql-apt-config_0.8.33-1_all.deb # Download the deb package
dpkg -i mysql-apt-config_0.8.33-1_all.deb # Install the apt source