• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomepcDuinoLinux ApplicationsRunning a lightweight webserver on the pcDuino (li ...
Previous Next

Running a lightweight webserver on the pcDuino (lighttpd)

Posted by: admin , August 7, 2014

This post details the steps to install a light webserver on the pcDuino.

 

Installing lighttpd:

To install the lighttpd web server, type  the command on the terminal:

$sudo apt-get install lighttpd

lighttpd_1

 

Install mysql database (optional)

Mysql is the most popular database server, whilst there are other alternatives some of which may require less resources most third party software for Linux is designed to use Mysql.If required it can be installed using:

$sudo apt-get install mysql-server

During the installation, it will ask the password of the root user:

mysql_1`

 

After the installation is finished, it will show:

mysql_2

Install PHP

The following commands will install PHP version 5:

$sudo apt-get install php5-common php5-cgi php5

Note it’s important to install in the order listed above. If you try to install php5 without first installing the php5-cgi package then it will install Apache as well, which we don’t want for this light-weight lighttpd server.

If you installed mysql then you should also issue the following command to install the php mysql libraries to allow PHP to access the mysql database.

$sudo apt-get install php5-mysql

To enable the server to handle php scripts the fastcgi-php module should be enabled by issuing in the command:

$sudo lighty-enable-mod fastcgi-php

 

php1

Then reload the server using:

$sudo service lighttpd force-reload

php2

Set permissions on the web directory /var/www/

 

It is useful to change the permissions on the www directory to allow your user to update the webpages without needing to be root.

Change the directory owner and group

$sudo chown www-data:www-data /var/www

allow the group to write to the directory:

$sudo chmod 775 /var/www


Add the ubuntu user to the www-data group:

$sudo usermod -a -G www-data ubuntu

Testing the server

 

The ip address of pcDuino can be found by typing ‘$ifconfig’ in the pcDuino terminal. In this case, the IP address is 192.168.1.20. We launch the browser in one of the PC that lives in the same local network as pcDuino, and we get:

test

Horay! We are done with the installation!

Twitter:@pcDuino_NO1

Facebook: pcDuino

Tags: Linux Applications, php

Share!
Tweet

admin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors