Store and share experiences about robocon, IoT, Embedded...
  • Home
  • Linux
  • Window
    • Latex
    • Matlab
  • Embedded programming
    • Jetson Tx1
    • Raspberry Pi
    • Raspberry Pico
  • Internet of things
    • HTTP+MySQL cho IoT
    • Websocket+Nodejs
    • ESP32
  • Electronics and robots
    • Robocon
    • Arduino
    • RISCV
    • FPGA
  • Network and devices
    • Basic CCNA
  • IoT Server
  • Q&A (Hỏi đáp)
  • About
No Result
View All Result
  • Home
  • Linux
  • Window
    • Latex
    • Matlab
  • Embedded programming
    • Jetson Tx1
    • Raspberry Pi
    • Raspberry Pico
  • Internet of things
    • HTTP+MySQL cho IoT
    • Websocket+Nodejs
    • ESP32
  • Electronics and robots
    • Robocon
    • Arduino
    • RISCV
    • FPGA
  • Network and devices
    • Basic CCNA
  • IoT Server
  • Q&A (Hỏi đáp)
  • About
No Result
View All Result
Store and share experiences about robocon, IoT, Embedded...
No Result
View All Result
Home Lập trình nhúng Raspberry Pi

Xây dựng một Website cá nhân với Raspberry Pi và WordPress- Phần 1

Cài đặt Php, MySQL, WordPress lên Raspberry Pi

admin by admin
August 27, 2020
in Raspberry Pi
1 0
1
  1. Cài đặt hệ điều hành Raspbian lên Raspberry. Sủ dụng VNC và UART để cấu hình, không cần dùng bàn phím rời hay màn hình. https://khochiase.net/cai-dat-va-su-dung-raspberry-pi-khong-can-ban-phim-chuot-hay-man-hinh.html
  2. Cài đặt Php, MySQL, WordPress

– Chạy cập nhật cho Pi: sudo apt-get update

– Cài đặt Apache2: sudo apt install apache2

Mở trình duyệt của Pi chạy 127.0.0.1 xem có giao diện của Apache trả về.

Hoặc mở trình duyệt của Laptop, gõ địa chỉ IP của Rasp cũng có kết quả tương tự

– Cài đặt php 7: sudo apt install php php-mbstring

Kiểm tra xem php7 đã cài đặt thành công chưa

+ Xóa file html cũ của Apache đi:

sudo rm /var/www/html/index.html

+ Thêm file mới trong đó có câu lệnh kiểm tra php:

sudo nano index.php

Thêm các dòng sau:

<?php echo “hello world”; ?>

<?php echo date(‘Y-m-d H:i:s’); ?>

<?php phpinfo(); ?>

Khởi động lại apache:

sudo service apache2 restart

Làm lại cách kiểm tra apache

– Cài đặt MySQL

sudo apt install mariadb-server php-mysql

Kiểm tra MySQL, xóa tài khoản root mặc định ( no password), thêm một tài khoản root khác với password, lưu lại để dùng cho việc cài đặt wordpress

sudo mysql –user=root

DROP USER ‘root’@’localhost’;

CREATE USER ‘root’@’localhost’ IDENTIFIED BY ‘password’;

GRANT ALL PRIVILEGES ON *.* TO ‘root’@’localhost’ WITH GRANT OPTIONS;

– Cấu hình SQL cho wordpress

sudo mysql -u root -p

– Tạo database wordpress

create database wordpress;- GRANT ALL PRIVILEGES ON wordpress.* TO ‘root’@’localhost’ IDENTIFIED BY ‘PASSWORD’;

Follow this by flushing previous database privileges:

FLUSH PRIVILEGES;

Exit the MariaDB database management tool with Ctrl + D

2. Cài đặt WordPress

cd /var/www/html/

sudo rm *

Tải gói phần mềm wordpress

sudo wget http://wordpress.org/latest.tar.gz

sudo tar xzf latest.tar.gz

sudo mv wordpress/* .

sudo rm -rf wordpress latest.tar.gz

sudo chown -R www-data: .

3. Truy cập wordpress để thiết lập các tham số ban đầu

Chú ý sử dụng tài khoản, tên database, mật khẩu database đã thiết lập ở trên nhé!

To login to your WordPress installation, go to http://localhost/wp-admin.

Sau đó chúng ta sẽ vào khu vực thiết lập ban đầu cho WordPress

Nếu mọi thứ điền ok chúng ta sẽ có

Việc cuối cùng là tùy chỉnh lại website theo ý của chúng ta,

 

Tiếp theo, đăng ký freeDNS để có thể đăng kí một tên miền truy cập cho Raspberry và nó sẽ cập nhật IP của chúng ta tự động.

Xây dựng một Website cá nhân với Raspberry Pi và WordPress- Phần 2

 

 

Số lượt xem: 2,063
Tags: apache2 raspberryphp raspberryraspberry pisqlwordpress raspberry

Related Posts

Hướng dẫn cài đặt driver cho màn hình SPI 3.5 inches Raspberry (updated 2020)

Hướng dẫn cài đặt driver cho màn hình SPI 3.5 inches Raspberry (updated 2020)

August 26, 2021
518
Xây dựng một Website cá nhân với Raspberry Pi và WordPress- Phần 1

Cài đặt webserver trên Raspberry Pi 3,3+,4 (cập nhật 2020)

August 26, 2021
741
IoT webserver – Giới thiệu về thu thập dữ liệu và điều khiển từ xa với http

Cài đặt và sử dụng Raspberry Pi không cần bàn phím, chuột hay màn hình

June 5, 2020
456

Comments 1

  1. phukhang2211 says:
    3 years ago

    Thank admin, hóng phần 2

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Bài viết đọc nhiều

IoT Webserver- ESP8266/ESP32 gửi dữ liệu lên Cloud, hiển thị ra trình duyệt web với MySQL và PHP

IoT Webserver- ESP8266/ESP32 gửi dữ liệu lên Cloud, hiển thị ra trình duyệt web với MySQL và PHP

February 9, 2023
17.6k
Điều khiển ESP8266/ESP32 từ xa qua internet, không cần mở Port modem

Điều khiển ESP8266/ESP32 từ xa qua internet, không cần mở Port modem

November 7, 2019
10.7k
ESP32-CAMERA: Cài đặt môi trường Arduino IDE và nạp chương trình

ESP32-CAMERA: Cài đặt môi trường Arduino IDE và nạp chương trình

December 27, 2019
7.3k
IoT webserver- Gửi thông báo bằng email từ ESP8266 không dùng IFTTT

IoT webserver- Gửi thông báo bằng email từ ESP8266 không dùng IFTTT

November 19, 2020
5.7k
Store and share experiences about robocon, IoT, Embedded…

Lưu và chia sẻ những gì đã đọc, đã làm, đã nghiên cứu về vi điều khiển, hệ thống nhúng, internet of things, kiến trúc máy tính và hệ điều hành.

Liên hệ với quản trị viên

Chủ đề

  • Arduino
  • CCNA cơ bản
  • Cisco
  • Điện tử- Robot
  • ESP32
  • FPGA
  • HTTP+MySQL cho IoT
  • IoT Server
  • Jetson Tx1
  • Lập trình nhúng
  • Latex
  • Linux
  • Mạng và thiết bị mạng
  • Raspberry Pi
  • Raspberry Pico
  • RISCV
  • Robocon
  • Web of things
  • Websocket+Nodejs
  • Window
  • WordPress

Quản trị trang

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

© 2019- 2023 luuvachiase.net - Phát triển và quản trị bởi Đỗ Ngọc Tuấn và Nguyễn Văn Tuấn ***Vui lòng ghi rõ nguồn khi trích dẫn bài viết từ Website này. DMCA.com Protection Status

No Result
View All Result
  • Trang chủ
  • Linux
  • Window
  • Lập trình nhúng
    • Jetson Tx1
    • Raspberry Pi
  • Web of things
    • HTTP+MySQL cho IoT
    • Websocket+Nodejs
  • Điện tử- Robot
    • Robocon
    • Arduino
    • RISCV
    • FPGA
  • Mạng và thiết bị mạng
    • CCNA cơ bản
  • IoT Server
  • Giới thiệu
  • Q&A (Hỏi đáp)

© 2019- 2023 luuvachiase.net - Phát triển và quản trị bởi Đỗ Ngọc Tuấn và Nguyễn Văn Tuấn ***Vui lòng ghi rõ nguồn khi trích dẫn bài viết từ Website này. DMCA.com Protection Status

Login to your account below

Forgotten Password?

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In