Computer >> Hướng Dẫn Máy Tính >  >> Hệ Thống >> Windows

Cài đặt WordPress MU trên Windows Localhost với XAMPP

Chúng ta đều quen WordPress, phần mềm phổ biến làm blog dễ dàng và thú vị. WordPress MU mở rộng WordPress cho phép tạo nhiều blog trên một domain. Ví dụ điển hình: WordPress.com.

Nếu muốn dùng WordPress MU cho site nhưng muốn test kỹ trước khi lên server, cách tốt nhất là tạo server local và test cài đặt trên máy. Hướng dẫn này chỉ cách tạo local server trên Windows (dùng XAMPP) và cài WordPress MU.

Cài đặt Local Server

1. Vào XAMPP for Windows tải bản cài đặt Windows.

Chạy installer. Khi đến trang tùy chọn cài đặt, chọn cài Apache và MySQL as a service.

Cài đặt WordPress MU trên Windows Localhost với XAMPP

2. Sau khi cài xong, vào Start → Programs → Apache Friends → XAMPP → XAMPP Control Panel. Nhấn Start cạnh Apache và MySQL.

Cài đặt WordPress MU trên Windows Localhost với XAMPP

Local server đã chạy. Mở trình duyệt truy cập https://localhost. Sẽ thấy trang sau:

Cài đặt WordPress MU trên Windows Localhost với XAMPP

Cài đặt WordPress MU

3. Tải file zip WordPress MU.

4. Giải nén vào thư mục: C:\xampp\htdocs\ (nếu cài XAMPP nơi khác, giải nén thư mục WordPress-MU vào htdocs trong thư mục XAMPP)

Thiết lập database cho WordPress-MU

5. Trên trình duyệt, truy cập https://localhost/phpmyadmin

Ở trường "Create New Database", nhập tên database. Nhấn Create.

Cài đặt WordPress MU trên Windows Localhost với XAMPP

Cấu hình virtualhost

6. Để cài WordPress MU trên localhost, cần thiết lập virtual hosting trên Windows.

Vào C:\WINDOWS\system32\drivers\etc mở file "hosts" bằng notepad (cần quyền admin. Chuột phải Notepad trong Start menu chọn Run As Administrator).

Thêm dòng

127.0.0.1 localhost.localdomain

vào cuối file. Lưu và đóng.

7. Quay lại trình duyệt, truy cập https://localhost.localdomain/wordpress-mu. Sẽ thấy trang cài đặt WordPress MU.

Ở trường chọn Sub-domains hoặc Sub-directories, chọn Sub-directories. Điều này tiết kiệm rắc rối sau này.

Cài đặt WordPress MU trên Windows Localhost với XAMPP

Nếu insist chọn Sub-domains, mỗi khi tạo blog test mới (sub-domain test1), phải cập nhật file hosts với entry sub-domain.

127.0.0.1 test1.localhost.localdomain

Phần database, nhập tên database vừa tạo. Username nhập root, để trống password.

Cài đặt WordPress MU trên Windows Localhost với XAMPP

Điền xong các chi tiết còn lại, nhấn Submit hoàn tất cài đặt. Nếu suôn sẻ, sẽ thấy trang "Installation Finished".

Cài đặt WordPress MU trên Windows Localhost với XAMPP

Xong.