There is a new revision of this tutorial available for Ubuntu 16.04 (Xenial Xerus).

The Perfect Server - Ubuntu 14.04 (Apache2, PHP, MySQL, PureFTPD, BIND, Dovecot, ISPConfig 3)

This tutorial shows how to prepare an Ubuntu 14.04 (Trusty Tahr) server (with Apache2, BIND, Dovecot) for the installation of ISPConfig 3, and how to install ISPConfig 3. ISPConfig 3 is a web hosting control panel that allows you to configure the following services through a web browser: Apache or nginx web server, Postfix mail server, Courier or Dovecot IMAP/POP3 server, MySQL, BIND or MyDNS nameserver, PureFTPd, SpamAssassin, ClamAV, and many more. This setup covers Apache (instead of nginx ), BIND (instead of MyDNS), and Dovecot (instead of Courier).

I do not issue any guarantee that this will work for you!

 

1. Requirements

To install such a system you will need the following:

  • the Ubuntu 14.04 server CD, available here: http://releases.ubuntu.com/releases/14.04/ubuntu-14.04-server-i386.iso (i386) or http://releases.ubuntu.com/releases/14.04/ubuntu-14.04-server-amd64.iso(x86_64)
  • a fast Internet connection.

 

2. Preliminary Note

In this tutorial I use the hostname server1.example.com with the IP address 192.168.2.251 and the gateway 192.1682.249. These settings might differ for you, so you have to replace them where appropriate.

3. The Base System

Insert your Ubuntu install CD into your system and boot from it. Select your language:

Then select Install Ubuntu Server:

Choose your language again (?):

Then select your location:



Choose a keyboard layout (you will be asked to press a few keys, and the installer will try to detect your keyboard layout based on the keys you pressed) In my case I prefer No & keyboard layout as English US:





The installer checks the installation CD, your hardware, and configures the network with DHCP if there is a DHCP server in the network:



Enter the hostname. In this example, my system is called server1.example.com, so I enter server1:



Create a user, for example the user administrator with the user name administrator (don't use the user name admin as it is a reserved name on Ubuntu 14.04):



Share this page:

46 Comment(s)

Add comment

Comments

From:

The gateway address is missing a '.'

From: amldc

I'm very lazy  and I love seting up server with just copy-paste from howtoforge !

For those who install from USB stick: the system may recognize your USB stick as SDA and then try to install GRUB to /dev/sda. Just select NO in the 'Install the GRUB boot loader to the master boot record?' dialog; you will be prompted with another dialog which allows you to specify the correct device (mine was /dev/sdb as shown in the disk partitioning section during the installation).

From: Marc

Thank you very much Falko

Your guides helped me a lot.

From: Bogdan

Great tutorial. Everything works great, except amavis complains in mail.log :

 amavis[2269]: (02269-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to UNIX socket /var/run/clamav/clamd.ctl: No such file or directory

Clamav didn't start after the first reboot of the server. Probably because it didn't have it's virus definitions updated. I had to start it manually. 

 #service clamav-daemon start

It started normally after the second reboot.

From: Gordon Fielden

Is the going to be an update that includes Roundcube install of squirrell, as squirrel doesn't have that professional feel, i see there PS for CentOS and Debian using Rouncube.

From: Karlis Eriks Grinbergs

good morning

Ok. so fare works all good. But how i do log on to Squirrelmail or how i do configure for log so i eable do configure Emailadresses????

From: till

The email address is created in ISPConfig, not in squirrelmail.Login to ispconfig and create the mailbox there. Then you can login with this email address and the password of the mailbox that you created in squirrelmail or your Desktopp email program to send and receive emails.

From: Bubba

Followed the guide line-by-line.

Having trouble receiving mail from external sites like gmail etc. to my server.

System SENDS mail just fine but am unable to recieve.

My ip is through godady.

output of dig -t mx example.com is as follows:

; <<>...<<>> -t mx example.com

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47746

;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 4

 

;; OPT PSEUDOSECTION:

; EDNS: version: 0, flags:; udp: 1300

;; QUESTION SECTION:

;example.com. IN MX

 

;; ANSWER SECTION:

example.com. 3600 IN MX 0 smtp.example.com.

example.com. 3600 IN MX 10 mail.example.com.

 

;; AUTHORITY SECTION:

example.com. 3600 IN NS ns72.domaincontrol.com.

example.com. 3600 IN NS ns71.domaincontrol.com.

 

;; ADDITIONAL SECTION:

ns71.domaincontrol.com. 66161 IN A 216.69.185.46

ns71.domaincontrol.com. 87240 IN AAAA 2607:f208:206::2e

ns72.domaincontrol.com. 26469 IN A 208.109.255.46

 

;; Query time: 37 msec

;; SERVER: 127.0.1.1#53(127.0.1.1)

;; WHEN: Tue Mar 31 10:13:53 EDT 2015

;; MSG SIZE  rcvd: 199

 

I found this post: http://ubuntuforums.org/archive/index.php/t-2131846.html

Which seems to reference some of the same issues I am having but the broken english

makes it hard for me to understand.  Any suggestions or help appreciated.

From: Madness

Thanks for another great walkthrough!

 

Everything had seemed to be working fine, but now in doing further tests when i try to send myself an email from php using mail(), it says the email sends successfully, but the email is never delivered.

 

What do I look for to troubleshoot this issue?

 

Thanks!

From: Madness

When I send an email through php mail() it says success, but no email is received.

What could be the cause? I have checked the logs, I don't see anything. Verifyied postfix IS running.

What steps should I take? Thank you!

From: Bubba

If anybody else is having problems with mail setup and they are using a godaddy DNS

you might find some helpful info here:

http://scottelkin.com/programming/how-to-properly-configure-godaddy-dns-settings/

From:

Some of the programs that you refer are not current in the apt-get ! who proced ?

From: Mike

I get the following error when I run newaliases - newaliases: fatal: /etc/postfix/main.cf, line 51: missing '=' after attribute name: "permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination"

From: Ricardo

Hello. I get this message: Package dovecot-mysql is not available, but is referred to by another package.This may mean that the package is missing, has been obsoleted, oris only available from another sourceE: Unable to locate package getmail4E: Unable to locate package rkhunterE: Package 'dovecot-mysql' has no installation candidate

 

Any idea how to fix? Thank you :)

From: till

Check the /etc/apt/sources.list file, the universe or multiverse repository must be missing.

From: AC

Is there a specific reason why you are setting the mysql service to listen on all interfaces?

Wouldn't the localhost/loopback be enough

From: Alan

So far I have followed the tutorial exactly and when I check hostname -f it says there is no address associated with the hostname.  Plus at this point I cannot ping google or anything.  Any suggestions?

From: Thomas CARTER

Hi, I had same issue with getmail4 missing. I updated /etc/apt/sources.list using http://repogen.simplylinux.ch/generate.php, in my case choosing France as the source, did an apt-get update and getmail installed correctly. Thomas CARTER

From: djsilas

There is a broken link on text "How To Use Multiple PHP Versions (PHP-FPM & FastCGI) With ISPConfig 3 (Ubuntu 12.10)" -> file:///how-to-use......

From: joe

fantastic article, saved me many times!

thanks!

From: 'the Moose'

Great tutorial! Works perfect for me, even installed Roundcube instead of Squirelmail.

However I face a problem now with my FTP... not sure why. I can log into the website accounts with FTP (easy done via ISPConfig), but I also want an account to just log into my server for up-/downloading files.

How do I do that? I installed 'PureAdmin' to create an FTP user account outside of ISPConfig, but I just can't login with it. I see in the message log of Fillezilla:

Status: Connection established, waiting for welcome message...

Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------

Response: 220-You are user number 1 of 5 allowed.

Response: 220-Local time is now 16:16. Server port: 21.

Response: 220-This is a private system - No anonymous login

Response: 220-IPv6 connections are also welcome on this server.

Response: 220 You will be disconnected after 60 minutes of inactivity.

Command: USER [username]

Response: 331 User [username] OK. Password required

Command: PASS *******

Response: 530 Login authentication failed

Error: Critical error: Could not connect to server

 

Any idea what I'm doing wrong here?

 

All help is appreciated.

From: Heriberto Torrado

How can I open 465 port on Postfix?

Thanks a lot

From: till

Just follow the instructions, the tutorial opens port 465 (smtps) in postfix. The step is the one where you remove the # in front of the smtps line in the master.cf file.

From: trond

If I have forgotten to install jailkit before installing ispconfig - and I have moved sites to the server - is there a way to install jailkit afterwards?

From: Graham

hi, I got some error when I install ispconfig-3. Here is the error:

 

AH00543: apache2: bad user name ispapps

and there are some warnning:

 

PHP Warning:  chown(): Unable to find uid for ispapps in /tmp/ispconfig3_install/install/lib/installer_base.lib.php on line 1564

 

PHP Warning:  chown(): Unable to find uid for ispconfig in /tmp/ispconfig3_install/install/lib/installer_base.lib.php on line 1985

 

chown: invalid user: ‘ispconfig:ispconfig’

here is apache error.log:

 

[mpm_prefork:notice] [pid 15794] AH00169: caught SIGTERM, shutting down

It was ok before I followed  your install doc. While this time it occurs error in the last step :install ispconfig-3.

I will appreciate that if someone  can help me. thanks !

From: till

Either you did not run the ispconfig installer as root or you did not start from a fresh and empty system so that e.g. exec is disabled in cli php.ini. Fix thie issue in php.ini or login with the root user, then uninstall ispconfig with the uninstall.php script and then install it again with install.php script.

From: eduard

I cannot login squirrelmail : ERRORUnknown user or password incorrect.

tail /var/log/mail.log :

Sep  4 07:35:01 ns1 postfix/smtpd[10000]: disconnect from localhost[::1]Sep  4 07:35:58 ns1 dovecot: imap-login: Aborted login (auth failed, 1 attempts in 2 secs): user=<e>, method=PLAIN, rip=::1, lip=::1, secured, session=<Z86Rb+QeswAAAAAAAAAAAAAAAAAAAAAB>

From: till

This means that a wrong username or password was used. The username is the full email address and the password is the password of the mailbox that you created in ISPConfig.

From: xplode

i get this in syslog and no incoming or outgoing mail is possible :(

postfix/error[28574]: C4441A2E4A: to=<[email protected]>, orig_to=<root>, relay=none, delay=0.02, delays=0.01/0/0/0, dsn=4.3.0, status=deferred (mail transport unavailable)

From: Jeff

I have an issue with Memcache using this setup. In PHP, Memcache caches and retrieves valus just fine but the stats array is empty. By this I mean that if I create and connect a memcache object, then issue:

print_r($memcache_obj->getStats());

the array is blank.

If I do the following:

print_r($memcache_obj->getExtendedStats());

All i get is

"Array ( [localhost:11211] => )"

 

I have the same setup on Centos with CPanel and it works fine. I've tried to compare the config files but there seems to be no discrepancies. Has anyone else had this issue and if they have can they please, please tell me how to solve it!

 

It would be greatly appreciated.

From: Nigel Aves

Followed everything and I believe that the install is OK.  Created a web site and decided to use a "package" to load Joomla. When I do this I get the following error message in the cron.log

Fri Sep 18 11:30:01 MDT 2015 PHP Warning:  ZipArchive::getStream(): Invalid or unitialized Zip object in /usr/local/ispconfig/server/lib/classes/aps_installer.inc.php on line 114

I don't know if this is because of something missing in the install procedures, or possibly a bug.

From: till

This message means that the joomla package from apsstandard.org is broken at the moment so that the zip file could not be unpacked. Try to wait a day, then delete the broken install iin the ispconfig installed aps list and remove the package in /usr/local/ispconfig/server/aps_packages/ and try again. It can also be that the package got broken during download, so check that your server can download files from the internet.

From: Tyler

You sir are an amazing person!!!!

From: ragtimesp

For all of you who can't connect to FTP with website users after following this guide, please do as follow:

·         sudo nano /etc/pure-ftpd/conf/PassivePortRange

asAnd write inside "29799 29899" withouth the quotes. After that open the ports in your firewall, restart your server and will work like a charm!

 

From: rosario

thanks for your tutorial . I have a problem. control script provides this result . What it means ?<You missed to install these packages cat missing_packages You need to install these packages. To install these packages you need to run the command apt-get install package_name You can cross check the particular installation as follows:dpkg -l | grep package_name | cut -d ' ' -f3If it is showing the package_name then you can ignore the package.>

From: Alex

Hi there,

there seems to bee a problem. In Step7. at service restart hostname I got this error

stop: Unknown instance:hostname stop/waiting

my host looks like this

127.0.0.1   localhost hauptdomainxx.xx.xx.xx domain.de hauptdomain

Is there a soulotion?

Thank´s for your help

 

Kind Regards

Alex

From: till

Run:

 

hostname -f

 

when it shows the correct hostname, then proceed with the next step. If it does not show the right hostname, then edi the /etc/hosts file, it should have a line:

127.0.0.1   localhost localhost.localdomain

and a line for your server IP and main domain name, e.g.:

192.168.1.100 hauptdomainxx.xx.xx.xx domain.de hauptdomain

 

then restart the server.

 

From: Mordimer

jail.local should be updated.

I was following the guide and the filter files was already there, but with different names: pure-ftpd.conf and dovecot.conf.Difference makes fail2ban failure to restart.

From: Tatto

Hi guys, i face the problem of increase the size of the attachments, for all of you ho face the same problem, modify the file /etc/apache2/sites-available/ispconfig.vhost nad change the MaxRequestLen to something higher like 15728640

From: Shankar

My installation went through perfectly without any errors. I have installed ISP 3 in a local server that is behind a firewall router in a LAN. I have configured the firewall to port forward ports 25, 110, 143, 993 and 995 to my server.  I am able to reach my hosted domain through the static ip provided by ISP and by my domain name. I have configured one mail box and I am able to send mail to the outside world without any problem. However, when I send mail from the outside world, it does not reach the mailbox. It does not bounce back either.  Any pointers on what is happening ? If you would like me to send you any report, please let me know. I am a Linux newbie. Please help.

From: Shankar

This refers to my earlier post. I sent a test mail to this server from my gmail. The mail bounced back several hours with this :

Mail Delivery Subsystem <[email protected]> 11:02 PM (11 hours ago) to me This is an automatically generated Delivery Status Notification THIS IS A WARNING MESSAGE ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. Delivery to the following recipient has been delayed:      [email protected] Message will be retried for 2 more day(s) Technical details of temporary failure: The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720 [mail.plworldways.net. 113.193.28.94: unable to read banner] ----- Original message ----- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;         d=gmail.com; s=20120113;         h=mime-version:date:message-id:subject:from:to;         bh=71hhVV6g4DQ0XAemWgxAP65orBCSKE57uAj0vKCvV5g=;         b=pNiqbBP844Rqaok+DSPub0nUtYnq/bQUsrn7h90L1xdW+5p4OVz/ABeLYJo09U2t3y          HME7FLzIZyAknbFU2EOpQru//ZJ927y/dqxEuZsL9FP15+MqJ15dI9AJUmYR6EfBLGJC          KeG6cDsc+A/gQ/cBQJklmjPLUMSl/MyGDDbS5HhU8qiM+cV3CkE1x6UjjmdFiAkG21O2          7PmDnSYvommq59RJizGxJr4y17HragpW7hoQ9tpUcg44GX830V9xdLodtWbbvUm8cYPK          tK0kAWk7P1C7ulA3+jPR4RRThE4N93SRj2/Gi8XO7Sv5YbiDx7JOWDnzzLJqLDUyKQPp          gV3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;         d=1e100.net; s=20130820;         h=x-gm-message-state:mime-version:date:message-id:subject:from:to;         bh=71hhVV6g4DQ0XAemWgxAP65orBCSKE57uAj0vKCvV5g=;         b=bOqmDoP5KIpsoStmwpH3HEmerquDc6wlVFhzAuXfEZ99cRPcSQhaKfGPzMY2GC6yd+          BkLeHqmo20dPSoa/93VbOsHJGnBoEwjrB6X8P/PsySNN3KW9x9I+rstiiMXcuc96ROGT          7SOsO/3E140qLHKrs6qBjO4fz1XJTRrF21Yfdf5YcIQCL08WpqH0WByVn9CpbdzInhzZ          DjIsTdPj4vAmXuu5f21mkST+7vGrYbpW2cy55NCXSxNxpf5EN6Svjjl3rRpkKnqY4TRu          mIdkp4ESycJNkV+r2IOyTzQoQdX1YyuMj1ucKmbtheIRnA0y0tIx0NBUmSr2I4W3+jzS          IInQ== X-Gm-Message-State: AD7BkJJG6jjbBoWdSz6+DHmJQlAwsk1WFtckDB2Ei2QMnV6c91lx/ze6/k85KdMWTEPCHMVSCKbInJPWg5CtUQ== MIME-Version: 1.0 X-Received: by 10.112.168.194 with SMTP id zy2mr2272865lbb.102.1459961874655;  Wed, 06 Apr 2016 09:57:54 -0700 (PDT) Received: by 10.112.201.168 with HTTP; Wed, 6 Apr 2016 09:57:53 -0700 (PDT) Received: by 10.112.201.168 with HTTP; Wed, 6 Apr 2016 09:57:53 -0700 (PDT) Date: Wed, 6 Apr 2016 22:27:53 +0530 Message-ID: <CAJcY1MTftBHHL8=[email protected]> Subject: Test at 10:25 pm From: Shankar Lakshmanan <[email protected]> To: [email protected] Content-Type: multipart/alternative; boundary=001a11c333f2ecb125052fd3dc78 Test

The clue is :

The recipient server did not accept our requests to connect. Learn more at https://support.google.com/mail/answer/7720 [mail.plworldways.net. 113.193.28.94: unable to read banner]

What could be the problem ? I am able to telnet to port 110, 143, 995, 25 successfully to my server. Any help would be much appreciated.

 

From: Vic Silvano

Hi Shankar,

It seems we have same problem..i don't know if there are any configuration in ISP or In the squirrelmail..please share if you have any idea about problem..i am now trying to configure the New version of ubuntu which is 16.04..i hoping that this version 14.04 wil be stable email server..

thanks,

Vic

From: till

Gmail explains the message in detail:

 

- Have network problems at the moment - Lack up-to-date Mail Exchange (MX) records - Be blocking messages from Gmail or moving them into a separate folder

So the most likely reason is that your ISP blocks port 25 incoming or that the server is behind a router and port 25 is not forwarded to the server. This is not an issue of using Ubuntu nor the setup descrbed here nor a squirrelmail or ispconfig settings.

From: Dev Null

I'm having this problem loging into SQUIRRELMAIL.  It won't let me login.  Can anyone please help me out?

 

sudo tail -f /var/log/mail.logApr 21 15:28:36 immortals dovecot: imap(user): Disconnected: Logged out in=323 out=1884Apr 21 15:28:40 immortals dovecot: imap-login: Aborted login (auth failed, 1 attempts in 4 secs): user=<user>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured, session=<IqUOjgQx1AB/AAAB>sudo tail -f /var/log/auth.logApr 21 15:28:36 immortals auth: PAM adding faulty module: pam_systemd.soApr 21 15:28:36 immortals auth: pam_unix(dovecot:auth): authentication failure; logname= uid=0 euid=0 tty=dovecot ruser=user rhost=127.0.0.1  user=user

From: till

Seems as if you did not use the full email address for login. The login username is the complete email address and not juts the part in front of the @.

From: Dev Null

Would this work for Linux Mint as well if someone wanted GUI on a server?