Web ServerThe 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.
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
FTP ServerTo manage the website from another device could be useful to work with FTP. The most used FTP server is vsftpd
sudo 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
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.
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
login=[DNSDYNAMIC.ORG USER LOGIN]
password='[DNSDYNAMIC.ORG USER PASSWORD]'
[DNSDYNAMIC.ORG USER DOMAIN]
Now you can access to Raspberry Pi with your domain name. (maybe it's necessary to wait minutes/hours)