set up ubuntu server with ehcp (lamp, dns, ftp, mail)

14
Set Up Ubuntu Server With EHCP (LAMP, DNS, FTP, Mail) 1. Introduction This tutorial will help you setup a web server to host multiple domains. We will use EHCP , a free control panel, to manage the server. The tutorial should be easy to follow even for beginners and you'll probably need about an hour to have your server up & running. You will need a unique static ip address for your server. This can be behind your nat router as long as you set up port forwarding. You will need to know the ip address you want to assign to the server, it's subnet mask, the default gateway and the ip for the dns server. I used Ubuntu Server 8.04, but this should work on any Ubuntu or Debian version. 2. Install Ubuntu Server This page explains you how to install the base Ubuntu Server system and OpenSSH. If you already know how to do that, you can jump to page 2. Boot you computer from the Ubuntu CD, choose your language, then select "Install Ubuntu Server."

Upload: yahya-nursalim

Post on 18-Nov-2014

134 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

Set Up Ubuntu Server With EHCP (LAMP, DNS, FTP, Mail)

1. Introduction

This tutorial will help you setup a web server to host multiple domains. We will use EHCP, a free control panel, to manage the server. The tutorial should be easy to follow even for beginners and you'll probably need about an hour to have your server up & running. You will need a unique static ip address for your server. This can be behind your nat router as long as you set up port forwarding. You will need to know the ip address you want to assign to the server, it's subnet mask, the default gateway and the ip for the dns server.

I used Ubuntu Server 8.04, but this should work on any Ubuntu or Debian version.

2. Install Ubuntu Server

This page explains you how to install the base Ubuntu Server system and OpenSSH. If you already know how to do that, you can jump to page 2.

Boot you computer from the Ubuntu CD, choose your language, then select "Install Ubuntu Server."

Page 2: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

Next you'll have to answer a few questions about your language and keyboard layout.

Page 3: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

The Ubuntu installer will try to acquire an ip by DHCP; you'll change the ip address to a static one later. Next you will have to enter the hostname (you can use anything you want).

Page 4: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

Select your timezone:

Page 5: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

Next you'll partition the disk. This will erase all data on the disk! Please be carrefull when performing this step!

Page 6: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

Next you'll have to wait for the base system to install. It may take a few minutes.

Enter your desired name, username and password:

Page 7: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

If you connect to the internet through a proxy server, enter its address here:

Page 8: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

In the software selection screen choose only "OpenSSH Server"; you'll install the rest later.

Remove the CD from your CD-ROM and press continue to reboot:

Page 9: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

3. Install EHCP

After your system reboots, you'll see the login prompt. Enter the username and password you selected earlier.

Next you'll have to become root (you'll have to type your password again):

sudo bash

Because this is a server, we'll need a static ip address. Edit /etc/network/interfaces. Yor file should look like this (use your own ip addresses):

nano /etc/network/interfaces

# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.1.254 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1

I replaced allow-hotplug eth0 with auto eth0; otherwise restarting the network doesn't work, and we'd have to reboot the whole system. I have to thank Falko for this great tip!

Enter your dns in /etc/resolv.conf:

nano /etc/resolv.conf

nameserver 192.168.1.1

You have to restart networking to apply the changes:

/etc/init.d/networking force-reload

Page 10: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

Now we'll update our linux system

apt-get update apt-get upgrade

Now we download ehcp:

wget http://www.ehcp.net/download

Extract and install ehcp:

tar -zxvf ehcp_latest.tgz cd ehcp ./install.sh

Please read the information carefully! Ehcp will send some information by email to it's developer. If you don't want this to happen, read this forum post.

You'll be required to press enter a few times, then you'll have to choose a MySQL root password (this can and should be different from your user password).

Page 11: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

The setup script will ask you a few questions:

Next you'll have to choose your mail server configuration. Choose "Internet site" and type your domain name.

Page 12: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

Press ok to generate an SSL certificate (please read the notice before pressing ok):

Page 13: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

In the phpmyadmin configuration screen select apache 2, then press ok.

That's it!

4. Use EHCP

Page 14: Set Up Ubuntu Server With Ehcp (Lamp, DNS, Ftp, Mail)

Open a web browser (firefox, internet explorer etc.) on your desktop computer and enter the server's IP in the address field. You should see a page with a link to your ehcp control panel. Click that link and you should see something like:

Your username is "admin" and the password is the one you chose when you installed ehcp.

You can see more screenshots here.