WEEK 12
Server Setup
Domain Name System
Domain Name System - Terminology
Domain Name System – Name Servers
Domain Name System – Installation
Domain Name System – Configuration
Domain Name System – Forward & Reverse Lookup Zone
Domain Name System – Record Creation
Domain Name System – Configuration
Domain Name System – Tools
File Transfer Protocol - Introduction
File Transfer Protocol - Installation
PREREQUISITES
File Transfer Protocol – Installation Procedure
To launch the service and enable it at startup, run the commands
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf_default
sudo useradd -m testuser
sudo passwd testuser
sudo ufw allow 20/tcp
sudo ufw allow 21/tcp
sudo ftp ubuntu-ftp // (system_name)
File Transfer Protocol – Configuration
Use mkdir to create new directory and usermod to change user home directory.
Restart vsftpd service to apply the change.
sudo systemctl restart vsftpd.service
Edit the vsftpd.conf using cat command or nano text editor
write_enable=NO, and change the value to “YES.”
Restart vsftpd service to apply the change.
File Transfer Protocol – Secure
Open vsftpd.conf in an editor and uncomment the following command:
chroot_local_user=YES
Edit /etc/vsftpd.chroot_list, and add one user per line.
Open vsftpd.conf , set chroot_list_file=/etc/vsftpd.chroot_list
Restart the vsftpd service:
sudo systemctl restart vsftpd.service
To add blocked users, edit this file and add one user per line.
To encrypt the traffic, use FTPS – FTP over SSL (Secure Socket Layer).
Apache Web Server - Introduction
Apache Web Server - Installation
XAMPP etc.
Apache Web Server - Configuration
The default directory structure is /var/www.
Create a new directory under this directory using the command
sudo mkdir -p /var/www/example.com
Change the root ownership to others normal
sudo chown -R $USER:$USER /var/www/example.com
sudo chmod -R 755 /var/www
Design a very simple Web page.
nano /var/www/example.com/index.html
A default virtual host file is 000-default.conf. Now copy it
sudo cp /etc/apache2/sites-available/000-default.conf
/etc/apache2/sites-available/example.com.conf
Add server admin, name, alias and document root information
Use the a2ensite tool to enable sites
sudo a2ensite example.com.conf
Disable the default site
sudo a2dissite 000-default.conf
Restart Apache to make these changes take effect:
sudo systemctl restart apache2
Edit local file with administrative privileges by typing:
sudo nano /etc/hosts
For example, for the domains machine with IP address 172.16.20.107 is used then, add the following lines to the bottom of hosts file:
127.0.0.1 localhost
127.0.1.1 guest-desktop
172.16.20.107 example.com
Go to the other machines /etc/hosts and do the above settings (step 6) like
172.16.20.107 example.com
Try http://example.com, this will display the web page of virtual host.