0% found this document useful (0 votes)
57 views

Operation Sheet 4.4 - Web Server FTP Server Email Server Linux

This document provides instructions for configuring common server applications in Linux, including an Apache web server, VSFTPD FTP server, and a Postfix email server. For the web server, it describes how to install Apache, check that it is running, start/stop/restart it, and edit the default homepage. For the FTP server, it outlines installing and configuring VSFTPD to allow anonymous or authenticated logins. For the email server, it details installing Postfix, configuring the main configuration file and hostname, enabling email forwarding, and redirecting emails to specific users.

Uploaded by

Patrick D Cerna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Operation Sheet 4.4 - Web Server FTP Server Email Server Linux

This document provides instructions for configuring common server applications in Linux, including an Apache web server, VSFTPD FTP server, and a Postfix email server. For the web server, it describes how to install Apache, check that it is running, start/stop/restart it, and edit the default homepage. For the FTP server, it outlines installing and configuring VSFTPD to allow anonymous or authenticated logins. For the email server, it details installing Postfix, configuring the main configuration file and hostname, enabling email forwarding, and redirecting emails to specific users.

Uploaded by

Patrick D Cerna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Operation Sheet 4.

4: Web Server, FTP Server and Email Server


Configuration in Linux

Operation Sheet 4.4.1: Web Server in 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

You should see the index.html file listed in the directory


6. Open the index.html file, edit it and save it. Type in the following
command: sudo nano index.html
Edit the file by personalizing it, and save:

<html><body><h1>Your Name's Website</h1> <p>Hello


everyone, this is my homepage!</p> <p>I will update this
page soon.</p> </body></html>
7. Using any internet browser from the client,
visit 127.0.0.1
Operation Sheet 4.4.2: FTP Server in Linux

Procedure:

Step 1: Install vsftpd in terminal

sudo apt-get install vsftpd

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

Step1. Postfix can easily be installed through apt-get:


sudo apt-get install postfix

During the installation, you will see a dialogue box appear, asking you which kind of installation you would
prefer. Select “Internet Site”.

Follow up by entering the name of your domain.

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

There are a few changes that should be made in this file.


myhostname = example.com

Put in name of your domain into myhostname.

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

The rest of the entries are described below

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].

Open up the the alias database:


sudonano /etc/postfix/virtual

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

You might also like