Operation Sheet 4.4 - Web Server FTP Server Email Server Linux
Operation Sheet 4.4 - Web Server FTP Server Email Server Linux
Procedure:
1. Open a terminal
2. Type in the following command to install
Apache:
sudo apt-get install apache2
3. To check to see if Apache is running open Firefox and type in the following web
address: http://localhost or, http://127.0.0.1
You should see the message, "It Works!" This is the Apache homepage, the index.html file
and it means the server has installed correctly and is currently running.
4. If you didn't see "It Works!" try starting the server. The commands to start, stop and
restart Apache are:
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart
5. Go to the Apache web directory (i.e. where you put your webpages and websites) and look
for the index.html file. Type in the following commands:
cd /var/www/
ls
Procedure:
Step 2: After installing, the server will automatically start and be configured with anonymous access but
the anonymous login is disabled by default.
The main configuration file for VSFTPD is at /etc/vsftpd.conf. Open the configuration file and
configure different settings for the server.
sudo vi /etc/vsftpd.conf or sudo nano /etc/vsftpd.conf
Step 3: To allow anonymous login, make sure the line below is uncommented. To uncomment means
to remove the # before each line.
anonymous_enable=YES
Step 4: To disable anonymous login and only allow authenticated users to sign in, disable anonymous login
and add the lines below.
local_enable=YES
write_enable=YES
Step 5: After making changes to the configuration file, you should always restart VSFTPD server. To do that,
run the commands below
sudo service vsftpd restart
4.4.3 Installing and Configuring Email Server using PostFix in Ubuntu Linux
Postfix is a free, open source Mail Transfer Agent which works to route and deliver email.
Prerequisites
Before installing Postfix, you will need to have a Fully Qualified Domain Name pointing to the server that you
will be using.
Install Postfix
During the installation, you will see a dialogue box appear, asking you which kind of installation you would
prefer. Select “Internet Site”.
Once Postfix is installed there are a few steps that need to be taken before it is fully functional.
Step 2: Configure Postfix
Once Postfix is installed, go ahead and open the main configuration file.
sudonano /etc/postfix/main.cf
If you want to have mail forwarded to other domains, replace alias_maps with virtual_alias_maps and point it
to /etc/postfix/virtual.
virtual_alias_maps = hash:/etc/postfix/virtual
mydestination defines the domains that postfix is going to serve, in this case—localhost and your domain (eg.
example.com).
relayhost can be left, as is the default, empty.
mynetworks defines who can use the mail server. This should be set to local—creating an open mail server is
asking for SPAM. This will usually have damaging effects on your server and may put you in line for discipline
from your web hosting provider.
If it is not set up by default, as it should be, make sure you have the following text on that line:
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
The rest of the lines are set by default. Save, exit, and reload the configuration file to put your changes into
effect:
sudo /etc/init.d/postfix reload
Step 3: Configure Additional Emails
To redirect emails to specific emails, you can add users to the alias file. By default each user on the server will
be able to read emails directed to their [email protected].
Within that file, enter in the names of your users. For example:
[email protected] username1
[email protected] username2
Once you are finished, save, exit, and run the following command:
postmap /etc/postfix/virtual
Step 4: Reload postfix once more.
sudo /etc/init.d/postfix reload