Skip to content

Instantly share code, notes, and snippets.

@tanftw
Last active June 15, 2024 05:00
Show Gist options
  • Save tanftw/6e6e8d2c14db85b5f5a5ca5f7c2d18e0 to your computer and use it in GitHub Desktop.
Save tanftw/6e6e8d2c14db85b5f5a5ca5f7c2d18e0 to your computer and use it in GitHub Desktop.
Install LEMP stack for WordPress
# MySQL
sudo apt install mysql-server
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '11';
sudo mysql_secure_installation
sudo systemctl restart mysql
# PHP 7.4 because WP sucks at PHP8
sudo apt install software-properties-common apt-transport-https -y
sudo apt install php php-cli php-mysql php-mbstring php-xml php-curl php-fpm
## Crontab
*/10 * * * * cd /var/www; php /var/www/wp-cron.php?doing_wp_cron > /dev/null 2>&1
## Nginx Block
server {
listen 80;
root /var/www/pma;
index index.php index.html index.htm index.nginx-debian.html;
server_name pma.test;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
@tanftw
Copy link
Author

tanftw commented Feb 11, 2024

Create SSC

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/localhost. Key -out /etc/ssl/certs/localhost.crt

Note that entity should be match with file name ("localhost")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment