[Raspberry] Triển khai Web application trên Raspberry Pi Part 3

Mình sẽ tiếp tục hướng dẫn các bạn cấu hình Web Server trên Raspberry.

1. Tạo thư mục: 
1
root@raspberrypi:/var/www/lab_app# mkdir static

2. Tạo thư mục:
1
root@raspberrypi:/var/www/lab_app/static# mkdir css

3. Tạo thư mục: 
1
root@raspberrypi:/var/www/lab_app/static# mkdir images

4. Chỉnh sửa file: 
1
root@raspberrypi:/var/www/lab_app/static# gedit a_static_file.html

5. Copy nội dung dưới đây vào trong file.
1
2
3
4
5
6
7
8
9
<html>
 <head>
  <title>Static page</title>
 </head>
 <body>
  <h1>This is an example of a staic page</h1>
  <p>Neat, isn't it?</p>
 </body>
</html>

6. Mở browser, nhập vào http://ipraspberry/static/a_static_file.html

7. Download file skeleton ở đây và sau đó giải nén file ra, copy 2 *.css file trong thư mục Skeleton-x.x.x/css/ vào trong thư mục /var/www/lab_app/static/css.

Sau đó, các bạn copy file .png trong thư mục Skeleton-x.x.x/images/ vào trong thư mục  /var/www/lab_app/static/images.


8. Sau đó, nhập vào terminal: 

 root@raspberrypi:/var/www/lab_app/static# vim a_static_file_v2.html
Or
 root@raspberrypi:/var/www/lab_app/static# gedit a_static_file_v2.html   

Và copy code này vào file(link).

Khởi động server:
 root@raspberrypi:~# service uwsgi start  

6. Mở browser, nhập vào http://ipraspberry/static/a_static_file_v2.html

Bài tiếp theo mình sẽ hướng dẫn tiếp tục nhé !!!

Bài đăng phổ biến từ blog này

Stack And Queue Trong Python

Review Sách 23 Thói quen chống lại sự trì hoãn