Debian-Raspberry Pi 使用日記–wordpress建置

本篇為Wordpress安裝的教學文,也是我認為一台網頁伺服器最最經典的小軟體~
讓我們開始吧~
(本文以樹莓派-Debian 11作為基礎,可能與您使用的版本略有不同,本文亦適用於Ubuntu)(架構:aarch64)

以下指令請在終端機進行

前置作業:安裝php&Apache2

請參考另一篇文章的教學

連結:https://brian70.tw/?p=78 https://brian70.tw/?p=92

第一步:安裝並設定MariaDB

  1. sudo apt-get install mariadb-server php-mysql -y
  2. sudo service apache2 restart

這樣就安裝好了,接下來就是設定了

  1. sudo mysql_secure_installation

接下來照著下面做~~

  • Enter current password for root (enter for none):Enter.
  • Set root password?.=>按Y&Enter
  • New password:設定新密碼&Enter
  • Remove anonymous users.=>按Y&Enter
  • Disallow root login remotely.=>視情況是否允許root遠端登入(*註1)按Y or N &Enter
  • Remove test database and access to it.=>按Y&Enter
  • Reload privilege tables now. =>按Y&Enter
  • All done! Thanks for using MariaDB!.=>看到這個就代表完成了

接下來設定資料庫

  1. sudo mysql -uroot -p

然後輸入你的密碼,接下來建立資料庫

  1. create database wordpress;

你會看到這個代表成功

  • Query OK, 1 row affected (0.00 sec)

接下來設定wordpress資料庫使用者,<YOURPASSWORD>請自行設定密碼

  1. GRANT ALL PRIVILEGES ON wordpress.* TO ‘wordpress’@’localhost’ IDENTIFIED BY ‘<YOURPASSWORD>’;
  2. FLUSH PRIVILEGES;

打完後按Ctrl+D退出並重新開機=>完成

第二步:下載並設定WordPress軟體

  1. sudo wget http://wordpress.org/latest.tar.gz
  2. sudo tar xzf latest.tar.gz
  3. sudo mv wordpress/ /var/www/html/wordpress/
  4. sudo chown -R 33:33 /var/www/html/wordpress/

第三步:享受你新設定好的WordPress~~

程式打完了,進網站設定吧!

進入http://你的樹梅派IP/wordpress

跟隨網站指示進行設定就可以了~~

本文教學至此,希望大家能受用~~

——————

註1:我的情況是設定允許,方便資料庫管理

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock