In this chapter we have gone through all the knowledge required to set up a Linux web server from scratch, and explained in detail, step my step, the procedures and command involved. We have also provided the first rudiments of Linux system administration and filesystem management.
Despite the lengthy explanations in the previous sections, once you have some familiarity with Linux, and have an Ubuntu desktop linux installed on a machine, setting up a web server is actually a matter of a few minutes.
In this section we summarize, for quick reference, with no further explanations (please refer to previous sections), all the commands required to install the server software and configure the machine so that each user have access to an individual web folder with a dedicated address.
Updating repositories
andrea@ubuntu:~$ sudo apt-get update
Installing OpenSSH Server
andrea@ubuntu:~$ sudo apt-get install openssh-server
Installing tasksel
andrea@ubuntu:~$ sudo apt-get install tasksel
Installing LAMP server
andrea@ubuntu:~$ sudo apt-get install lamp-server
Activate module userdir
andrea@ubuntu:~$ sudo a2enmod userdir
Create public_html directories for each user
Unlike the steps above, this step can be done directly by each user
username@ubuntu:~$ mkdir /home/username/public_html
if the administrator does it, it is then a good idea to assign ownership of the public_html directories to each user with chown.
Also, make sure the users directories at /home/username have a 755 permission.
Find out the name of the apache mods-enabled php configuration file
andrea@ubuntu:~$ ls /etc/apache2/mods-enabled/ | grep php
Comment out a directive in the apache php configuration file
andrea@ubuntu:~$sudo nano -w /etc/apache2/mods-enabled/php7.0.conf (to be adjusted to the correct name of the php conf file)
Comment out (add # at the beginning of the line) all the lines from:
<ifModule mod_userdir.c>
to
</ifModule>
Restart apache
andrea@ubuntu:~$ sudo service apache2 restart
Done! If you have comments or issues or success reports (most welcome!), please share by posting below.
Chapter Sections
[pagelist include=”63″]
[siblings]