在Debian 9系統上安裝WordPress是一個相對簡單的過程,只需要幾個步驟就能完成。本文將詳細介紹如何在Debian 9上部署WordPress。
首先需要安裝LAMP(Linux, Apache, MySQL, PHP)環境:
sudo apt update
sudo apt install apache2 mysql-server php php-mysql libapache2-mod-php
為WordPress創建數據庫和用戶:
sudo mysql -u root -p
CREATE DATABASE wordpress;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
下載最新版WordPress并解壓:
cd /tmp
wget https://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
sudo mv wordpress /var/www/html/
設置正確的文件權限:
sudo chown -R www-data:www-data /var/www/html/wordpress
sudo chmod -R 755 /var/www/html/wordpress
在瀏覽器中訪問服務器IP地址或域名,按照WordPress安裝向導完成最后的配置步驟。
通過以上步驟,您就可以在Debian 9系統上成功安裝并運行WordPress了。記得定期更新系統和WordPress以保持安全性。