- Internet of Things Programming with JavaScript
- Rubén Oliva Ramos
- 254字
- 2021-04-02 20:31:18
Configuring a web server
There are several web servers available that we can install on your Raspberry Pi. We're going to install the lighttpd
web server. Also, we need to install PHP support, which will help us run a website into our Raspberry Pi and have dynamic web pages.
To install and configure, log in to the Raspberry Pi via the terminal console of PuTTY:
- Update the package installer:
sudo apt-get update
- Install the
lighttpd
web server:sudo apt-get install lighttpd
Once installed, it will automatically start up as a background service; it will do so each time the Raspberry Pi starts up:
- To set up our PHP 5 interface for programming with PHP 5, we need to install the
PHP5
module support with the following command; this is necessary to have our server, and it can execute PHP files so that we can make our website:sudo apt-get install php5-cgi
- Now we need to enable the
PHP FastCGI
module on our web server:sudo lighty-enable-mod fastcgi-php
- For the last step, we have to restart the server with the following command:
sudo /etc/init.d/lighttpd
In the following screenshot, we show the content of the page that will to appear when we configure the web server and the PHP 5 interface. The web server installs a test placeholder page in the location /var/www
. Type the IP address of your Raspberry Pi in the browser, for example, http://192.168.1.105/
, and the following screen appears, opening the active page of the configured server:

- 計(jì)算機(jī)組成原理與接口技術(shù):基于MIPS架構(gòu)實(shí)驗(yàn)教程(第2版)
- 漫話大數(shù)據(jù)
- 企業(yè)數(shù)字化創(chuàng)新引擎:企業(yè)級(jí)PaaS平臺(tái)HZERO
- 在你身邊為你設(shè)計(jì)Ⅲ:騰訊服務(wù)設(shè)計(jì)思維與實(shí)戰(zhàn)
- Greenplum:從大數(shù)據(jù)戰(zhàn)略到實(shí)現(xiàn)
- 云數(shù)據(jù)中心基礎(chǔ)
- Microsoft SQL Server企業(yè)級(jí)平臺(tái)管理實(shí)踐
- 數(shù)據(jù)庫(kù)原理及應(yīng)用教程(第4版)(微課版)
- Google Visualization API Essentials
- SQL Server入門經(jīng)典
- Python數(shù)據(jù)分析:基于Plotly的動(dòng)態(tài)可視化繪圖
- 大數(shù)據(jù)架構(gòu)和算法實(shí)現(xiàn)之路:電商系統(tǒng)的技術(shù)實(shí)戰(zhàn)
- ZeroMQ
- Python金融數(shù)據(jù)分析(原書第2版)
- R語(yǔ)言數(shù)據(jù)挖掘