Nginx & Wordpress
Nginx & Wordpress
Nginx & Wordpress
CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; |
wget https://tw.wordpress.org/latest-zh_TW.zip |
sudo cp -R wordpress/ /var/www/wordpress.local |
sudo chown -R www-data:www-data /var/www/wordpress.local |
cd /var/www/wordpress.local/ |
define( 'DB_NAME', 'wordpress' ); /** Database username */ define( 'DB_USER', 'wordpress' ); /** Database password */ define( 'DB_PASSWORD', 'Kyy_y(YL901OzLBh' ); /** Database hostname */ define( 'DB_HOST', 'localhost' ); |
sudo nano /etc/nginx/sites-available/wordpress.local.conf |
server { listen 80; listen [::]:80; root /var/www/wordpress.local; index index.php index.html index.htm; server_name wordpress.local; error_log /var/log/nginx/mysite.com_error.log; access_log /var/log/nginx/mysite.com_access.log; client_max_body_size 100M; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php8.1-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } |
sudo ln -s /etc/nginx/sites-available/wordpress.local.conf /etc/nginx/sites-enabled/ |
sudo rm /etc/nginx/sites-enabled/default |
留言