Tuesday, November 19, 2013

Install Apache 2 Web Server on Raspberry

Install Apache webserver, enter the command:
$ sudo apt-get install apache2

The /var/www directory is owned by the root by default after installed. It's suggested to change the owner to another group/user, such as www-data. Such that you can easy to modify it, even via ssh remotely.

To change it owned by www-data user and group, enter the command.
$ sudo chown -R www-data:www-data /var/www

To grant permission to www-data group to read/write/execute the directory /var/www.
$ sudo chmod -R 775 /var/www

Add user pi to the group www-data
$ sudo usermod -a -G www-data pi

Log-out/log-in to let the change take effect.

Then you can edit //var/www/index.html by Pi.

No comments: