天天看點

Ubuntu LAMP下搭建wordpress

在Ubuntu安裝完LAMP環境的基礎上搭建我們搭建wordpress

Ubuntu LAMP下搭建wordpress
1.png

一、wordpress網站檔案放置

step1.下載下傳源碼

zzq@ubuntu:/var/www/html$ sudo wget https://wordpress.org/latest.zip
           

step2.安裝解壓工具

zzq@ubuntu:/var/www/html$ sudo apt-get install unzip 
           

step3. 解壓latest.zip

zzq@ubuntu:/var/www/html$ unzip latest.zip
           

step4.移動源碼到網站的根目錄

zzq@ubuntu:/var/www/html$ sudo mv wordpress /var/www/html/
           

step5.更改根目錄權限

  • 首先更改目錄/var/www/html/wordpress/的所屬主以及所屬組
zzq@ubuntu:/var/www/html$ sudo chown -R www-data:www-data /var/www/html/wordpress/
           
  • 然後更改目錄/var/www/html/wordpress/權限為755
zzq@ubuntu:/var/www/html$ sudo chmod -R 755 /var/www/html/wordpress/
           

二、然後修改Apache配置檔案

配置虛拟主機:

  • 首先備份配置檔案
zzq@ubuntu:/$ sudo cp /etc/apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/000-default.conf.bak
           
  • 然後修改配置檔案
zzq@ubuntu:/$ sudo vim /etc/apache2/sites-enabled/000-default.conf
           
Ubuntu LAMP下搭建wordpress

2.png

  • 修改完配置檔案,重新開機apache服務
zzq@ubuntu:~$ sudo service apache2 restart
           
Ubuntu LAMP下搭建wordpress

3.png

三、資料庫配置

step1.連接配接進入資料庫

zzq@ubuntu:~$ mysql -u root -p
           
Ubuntu LAMP下搭建wordpress

4.png

step2. 建立wordpress資料庫

mysql> create database wordpress;
           
Ubuntu LAMP下搭建wordpress

5.png

四、浏覽器通路wordpress配置

  • web通路http://192.168.178.135,回車就會看到如下頁面:
Ubuntu LAMP下搭建wordpress

6.png

  • 選擇語言“簡體中文”
Ubuntu LAMP下搭建wordpress

7.png

  • 點選“現在開始”
Ubuntu LAMP下搭建wordpress

8.png

  • 填寫資料庫使用者名以及密碼
Ubuntu LAMP下搭建wordpress

9.png

Ubuntu LAMP下搭建wordpress

10.png

  • 點選送出
Ubuntu LAMP下搭建wordpress

11.png

  • 點選現在安裝,設定一些資訊如下圖所示
Ubuntu LAMP下搭建wordpress

12.png

  • 安裝成功,傳回如下
Ubuntu LAMP下搭建wordpress

13.png

  • 登入wordpress
Ubuntu LAMP下搭建wordpress

14.png

  • 成功進入wordpress
Ubuntu LAMP下搭建wordpress

15.png

PS:可能以後會遇到Wordpress不能正常通路,這可能是你的Ubuntu伺服器更換了IP。解決辦法參考以下部落格:

https://blog.csdn.net/zyw19871007/article/details/52775781