Web Server
The most common web server is Apache. To install it type this command:sudo apt-get update
sudo apt-get install apache2
Now you can access to the server from another device (on the local network) using the raspberry's IP address.
ATTENTION!
Sometimes Apache get 403 Forbidden Error. So give the right permissions to var/www folder
sudo chmod 755 -R /var/www/
Change Apache default user to avoid user permissions issue
sudo nano /etc/apache2/envvars
correcting the following lines
export APACHE_RUN_USER=pi
export APACHE_RUN_GROUP=pi
FTP Server
To manage the website from another device could be useful to work with FTP. The most used FTP server is vsftpdsudo apt-get install vsftpdMake sure you are the owner of the Web Server directory (in this case the user is 'pi')
sudo chown -R pi /var/wwwEdit the configuration file /etc/vsftpd.conf. The following lines must be present:
anonymous_enable=NOIf you want to set /var/www as the root directory add also this line
local_enable=YES
write_enable=YES
force_dot_files=YES
local_root=/var/www
Restart the FTP server
sudo service vsftpd restartNow you can access to the FTP server using IP address, username and password of the Raspberry PI.
DYNAMIC DNS
To access the server from the global network you must configure the DNS service.
I suggest to sign up on dnsdynamic.org for a free dynamic DNS.
Install the DNS client
sudo apt-get install ddclientSkip the installation wizard and edit the configuration file /etc/ddclient.conf:
# Configuration file for ddclient generated by debconfMake sure that ddclient start as a daemon editing the file /etc/default/ddclient
#
# /etc/ddclient.conf
daemon=360
syslog=yes
mail=root
mail-failure=root
pid=/var/run/ddclient.pid
ssl=yes
use=web, web=myip.dnsdynamic.com
protocol=dyndns2
server=www.dnsdynamic.org
login=[DNSDYNAMIC.ORG USER LOGIN]
password='[DNSDYNAMIC.ORG USER PASSWORD]'
[DNSDYNAMIC.ORG USER DOMAIN]
run_ipup="false"
run_daemon="true"
Now you can access to Raspberry Pi with your domain name. (maybe it's necessary to wait minutes/hours)
RispondiEliminaextraction harry turner jacketExcellent post. I am also experiencing a few of these issues as well, but now I have got some ideas. Thanks!