The Perfect Server - CentOS 6.4 x86_64 (Apache2, Dovecot, ISPConfig 3) - Page 6

Want to support HowtoForge? Become a subscriber!
 
Submitted by falko (Contact Author) (Forums) on Thu, 2013-03-14 18:44. ::

23 Install SquirrelMail

To install the SquirrelMail webmail client, run...

yum install squirrelmail

... and restart Apache:

/etc/init.d/httpd restart

Then configure SquirrelMail:

/usr/share/squirrelmail/config/conf.pl

We must tell SquirrelMail that we are using Dovecot:

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1.  Organization Preferences
2.  Server Settings
3.  Folder Defaults
4.  General Options
5.  Themes
6.  Address Books
7.  Message of the Day (MOTD)
8.  Plugins
9.  Database
10. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color off
S   Save data
Q   Quit

Command >>
 <-- D


SquirrelMail Configuration : Read: config.php
---------------------------------------------------------
While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others.  If you select your IMAP server, this option will
set some pre-defined settings for that server.

Please note that you will still need to go through and make sure
everything is correct.  This does not change everything.  There are
only a few settings that this will change.

Please select your IMAP server:
    bincimap    = Binc IMAP server
    courier     = Courier IMAP server
    cyrus       = Cyrus IMAP server
    dovecot     = Dovecot Secure IMAP server
    exchange    = Microsoft Exchange IMAP server
    hmailserver = hMailServer
    macosx      = Mac OS X Mailserver
    mercury32   = Mercury/32
    uw          = University of Washington's IMAP server
    gmail       = IMAP access to Google mail (Gmail) accounts

    quit        = Do not change anything
Command >>
 <-- dovecot


SquirrelMail Configuration : Read: config.php
---------------------------------------------------------
While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others.  If you select your IMAP server, this option will
set some pre-defined settings for that server.

Please note that you will still need to go through and make sure
everything is correct.  This does not change everything.  There are
only a few settings that this will change.

Please select your IMAP server:
    bincimap    = Binc IMAP server
    courier     = Courier IMAP server
    cyrus       = Cyrus IMAP server
    dovecot     = Dovecot Secure IMAP server
    exchange    = Microsoft Exchange IMAP server
    hmailserver = hMailServer
    macosx      = Mac OS X Mailserver
    mercury32   = Mercury/32
    uw          = University of Washington's IMAP server
    gmail       = IMAP access to Google mail (Gmail) accounts

    quit        = Do not change anything
Command >> courier

              imap_server_type = courier
         default_folder_prefix = INBOX.
                  trash_folder = Trash
                   sent_folder = Sent
                  draft_folder = Drafts
            show_prefix_option = false
          default_sub_of_inbox = false
show_contain_subfolders_option = false
            optional_delimiter = .
                 delete_folder = true

Press enter to continue...
 <-- press ENTER


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1.  Organization Preferences
2.  Server Settings
3.  Folder Defaults
4.  General Options
5.  Themes
6.  Address Books
7.  Message of the Day (MOTD)
8.  Plugins
9.  Database
10. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color off
S   Save data
Q   Quit

Command >>
 <--S


SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1.  Organization Preferences
2.  Server Settings
3.  Folder Defaults
4.  General Options
5.  Themes
6.  Address Books
7.  Message of the Day (MOTD)
8.  Plugins
9.  Database
10. Languages

D.  Set pre-defined settings for specific IMAP servers

C   Turn color off
S   Save data
Q   Quit

Command >>
 <--Q

One last thing we need to do is modify the file /etc/squirrelmail/config_local.php and comment out the $default_folder_prefix variable - if you don't do this, you will see the following error message in SquirrelMail after you've logged in: Query: CREATE "Sent" Reason Given: Invalid mailbox name.

vi /etc/squirrelmail/config_local.php

<?php

/**
 * Local config overrides.
 *
 * You can override the config.php settings here.
 * Don't do it unless you know what you're doing.
 * Use standard PHP syntax, see config.php for examples.
 *
 * @copyright &copy; 2002-2006 The SquirrelMail Project Team
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @version $Id: config_local.php,v 1.2 2006/07/11 03:33:47 wtogami Exp $
 * @package squirrelmail
 * @subpackage config
 */

//$default_folder_prefix                = '';
?>

Now you can type in http://server1.example.com/webmail or http://192.168.0.100/webmail in your browser to access SquirrelMail.

 

24 Install ISPConfig 3

Download the current ISPConfig 3 version and install it. The ISPConfig installer will configure all services like Postfix, Dovecot, etc. for you. A manual setup as required for ISPConfig 2 is not necessary anymore.

You now also have the possibility to let the installer create an SSL vhost for the ISPConfig control panel, so that ISPConfig can be accessed using https:// instead of http://. To achieve this, just press ENTER when you see this question: Do you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]:.

To install ISPConfig 3 from the latest released version, do this:

cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install/

The next step is to run

php -q install.php

This will start the ISPConfig 3 installer:

[root@server1 install]# php -q install.php


--------------------------------------------------------------------------------
 _____ ___________   _____              __ _         ____
|_   _/  ___| ___ \ /  __ \            / _(_)       /__  \
  | | \ `--.| |_/ / | /  \/ ___  _ __ | |_ _  __ _    _/ /
  | |  `--. \  __/  | |    / _ \| '_ \|  _| |/ _` |  |_ |
 _| |_/\__/ / |     | \__/\ (_) | | | | | | | (_| | ___\ \
 \___/\____/\_|      \____/\___/|_| |_|_| |_|\__, | \____/
                                              __/ |
                                             |___/
--------------------------------------------------------------------------------


>> Initial configuration

Operating System: Redhat or compatible, unknown version.

    Following will be a few questions for primary configuration so be careful.
    Default values are in [brackets] and can be accepted with <ENTER>.
    Tap in "quit" (without the quotes) to stop the installer.


Select language (en,de) [en]:
 <-- ENTER

Installation mode (standard,expert) [standard]: <-- ENTER

Full qualified hostname (FQDN) of the server, eg server1.domain.tld  [server1.example.com]: <-- ENTER

MySQL server hostname [localhost]: <-- ENTER

MySQL root username [root]: <-- ENTER

MySQL root password []: <-- yourrootsqlpassword

MySQL database to create [dbispconfig]: <-- ENTER

MySQL charset [utf8]: <-- ENTER

Generating a 2048 bit RSA private key
..........................................................+++
................................+++
writing new private key to 'smtpd.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:
 <-- ENTER
State or Province Name (full name) []: <-- ENTER
Locality Name (eg, city) [Default City]: <-- ENTER
Organization Name (eg, company) [Default Company Ltd]: <-- ENTER
Organizational Unit Name (eg, section) []: <-- ENTER
Common Name (eg, your name or your server's hostname) []: <-- ENTER
Email Address []: <-- ENTER
Configuring Jailkit
Configuring Dovecot
Configuring Spamassassin
Configuring Amavisd
Configuring Getmail
Configuring Pureftpd
Configuring BIND
Configuring Apache
Configuring Vlogger
Configuring Apps vhost
Configuring Bastille Firewall
Configuring Fail2ban
Installing ISPConfig
ISPConfig Port [8080]:
 <-- ENTER

Do you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]: <-- ENTER

Generating RSA private key, 4096 bit long modulus
.....................++
.......++
e is 65537 (0x10001)
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:
 <-- ENTER
State or Province Name (full name) []: <-- ENTER
Locality Name (eg, city) [Default City]: <-- ENTER
Organization Name (eg, company) [Default Company Ltd]: <-- ENTER
Organizational Unit Name (eg, section) []: <-- ENTER
Common Name (eg, your name or your server's hostname) []: <-- ENTER
Email Address []: <-- ENTER

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
 <-- ENTER
An optional company name []: <-- ENTER
writing RSA key
Configuring DBServer
Installing ISPConfig crontab
no crontab for root
no crontab for getmail
Restarting services ...
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
Shutting down postfix:                                     [  OK  ]
Starting postfix:                                          [  OK  ]
Stopping saslauthd:                                        [FAILED]
Starting saslauthd:                                        [  OK  ]
Waiting for the process [1424] to terminate
Shutting down amavisd: Daemon [1424] terminated by SIGTERM
                                                           [  OK  ]
amavisd stopped
Starting amavisd:                                          [  OK  ]

Stopping clamd.amavisd:                                    [  OK  ]
Starting clamd.amavisd:                                    [  OK  ]
Stopping Dovecot Imap:                                     [  OK  ]
Starting Dovecot Imap:                                     [  OK  ]
Stopping httpd:                                            [  OK  ]
[Thu Mar 14 14:12:32 2013] [warn] NameVirtualHost *:80 has no VirtualHosts
Starting httpd:                                            [  OK  ]
Stopping pure-ftpd:                                        [  OK  ]
Starting pure-ftpd:                                        [  OK  ]
Installation completed.
[root@server1 install]#

To fix the Mailman errors you might get during the ISPConfig installation, open /usr/lib/mailman/Mailman/mm_cfg.py...

vi /usr/lib/mailman/Mailman/mm_cfg.py

... and set DEFAULT_SERVER_LANGUAGE = 'en':

[...]
#-------------------------------------------------------------
# The default language for this server.
DEFAULT_SERVER_LANGUAGE = 'en'
[...]

Restart Mailman:

/etc/init.d/mailman restart

Afterwards you can access ISPConfig 3 under http(s)://server1.example.com:8080/ or http(s)://192.168.0.100:8080/ (http or https depends on what you chose during installation). Log in with the username admin and the password admin (you should change the default password after your first login):

The system is now ready to be used.

 

 

25 Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by dendic (not registered) on Tue, 2014-04-29 13:43.

I am a novice. What should I install with ISPConfig 3 if the web server is set by the existing farm servers.I already have separate mail server  in system farm  room. What do I need to install the software import the ispconfig 3  with already existing mail server '(postfix, dovecot, GetMail, mailman.squirellmail??)

 My aim is to this Web server set up several websites with which you could make several email addresses and email addresses that I cherish the already existing mail server in the server room.

Submitted by dendic (not registered) on Fri, 2014-05-02 08:55.
Can someone put an example configuration file main.cf  if I have to relayhost separate mail server system in the hall and I just need to add a (local) for option mydomain = myserver.mydomain.com.local    in etc/postfix/ main.cf  
Submitted by faizan (not registered) on Mon, 2014-04-28 09:32.

Dear All,

While i am running step 24.(entering url )..it was generating error saying that..error 404 not found 

Submitted by sthevan79 (registered user) on Mon, 2014-03-03 12:33.

setup without any error , but when access http://192.168.0.136:8080/

getting belwo page only 

 

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Reason: You're speaking plain HTTP to an SSL-enabled server port.<br />
Instead use the HTTPS scheme to access this URL, please.<br />
<blockquote>Hint: <a href="https://redirector-sjl.enom.com:8080/"><b>https://redirector-sjl.enom.com:8080/</b></a></blockquote></p>
</body></html>

Please help

Thanks

Submitted by Thevan (not registered) on Mon, 2014-03-03 12:26.

HI

 Has followed the installation guide without any error, But when put for example  http://192.168.0.136:8080/  i am getting 

 

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
Reason: You're speaking plain HTTP to an SSL-enabled server port.<br />
Instead use the HTTPS scheme to access this URL, please.<br />
<blockquote>Hint: <a href="https://redirector-sjl.enom.com:8080/"><b>https://redirector-sjl.enom.com:8080/</b></a></blockquote></p>
</body></html>
 
If put  http://192.168.0.136:8080/ 
I am getting apache test page only 
 
Please advise 
Thanks 

 


Submitted by Anonymous (not registered) on Fri, 2014-06-06 00:33.
Same issue. when i go to my server with :8080, no response. Just apache test page. Please advise!!!!!!!
Submitted by Anonymous (not registered) on Thu, 2014-02-06 23:00.

                 

              Hi , i have used 'Perfect server Centos 6.3 with Courier' with for Centos 6.5

The problem appears when i add a ssl website . The ssl certificate is working but the page still remains default Apache 2 . Doesn't change like when you add a http website with ispconfig 3, and because of that i cannot acces https pages , it tells me that it cannot be found.

 

Not Found

The requested URL /admin/ was not found on this server.


Apache/2.2.15 (CentOS) Server at www.domain.com Port 443

 The site is working fine when it is only with http

Submitted by Erik (not registered) on Thu, 2014-01-02 16:20.

 First:  GREAT STUFF!  I really appreciate your work in this package and it really does KICK ASS!

 Second:  Postfix kept coming up with "fatal: open database /etc/postfix/virtual.db: No such file or directory" and was unable to start properly.

 The solution was "postmap /etc/postfix/virtual" to build the virtual.db then restart postfix.

Thanks again!

Submitted by Kaan Varol (not registered) on Fri, 2013-12-27 18:29.
Thank You for this great tutorial. Much much appreciated.
Submitted by ANRES (not registered) on Tue, 2013-12-17 23:15.
I followed the manual but I can not enter ispconfig web site, enter the default can help me?

thanks
Submitted by Gyrocode (not registered) on Fri, 2014-02-07 16:11.

I went back and reviewed users' comments for previous versions of this tutorial. Here is what I found here.

php-eaccelerator conflicts with Apache and causes the error. It can be removed by running the following commands:

rpm -e php-eaccelerator
service httpd restart

Submitted by martindubois (registered user) on Fri, 2013-09-06 19:24.
 hello I just followed the tutorial for centos 6.4 but I have the page Defaux apache I can not have access to the page ispconfig

 

 https://212.76.139.94:8080/ 

Submitted by Jamie Bond (not registered) on Fri, 2013-08-16 00:16.
Thank you for this very useful guide! Kind Regards.
Submitted by linuxuzerno1 (not registered) on Sun, 2013-05-26 16:15.

SquirrelMail Configuration : Read: config.php
---------------------------------------------------------
While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others. If you select your IMAP server, this option will
set some pre-defined settings for that server.
Please note that you will still need to go through and make sure
everything is correct. This does not change everything. There are
only a few settings that this will change.
Please select your IMAP server:
bincimap = Binc IMAP server
courier = Courier IMAP server
cyrus = Cyrus IMAP server
dovecot = Dovecot Secure IMAP server
exchange = Microsoft Exchange IMAP server
hmailserver = hMailServer
macosx = Mac OS X Mailserver
mercury32 = Mercury/32
uw = University of Washington's IMAP server
gmail = IMAP access to Google mail (Gmail) accounts
quit = Do not change anything

Command >> <-- dovecot


SquirrelMail Configuration : Read: config.php
---------------------------------------------------------
While we have been building SquirrelMail, we have discovered some
preferences that work better with some servers that don't work so
well with others. If you select your IMAP server, this option will
set some pre-defined settings for that server.
Please note that you will still need to go through and make sure
everything is correct. This does not change everything. There are
only a few settings that this will change.
Please select your IMAP server:
bincimap = Binc IMAP server
courier = Courier IMAP server
cyrus = Cyrus IMAP server
dovecot = Dovecot Secure IMAP server
exchange = Microsoft Exchange IMAP server
hmailserver = hMailServer
macosx = Mac OS X Mailserver
mercury32 = Mercury/32
uw = University of Washington's IMAP server
gmail = IMAP access to Google mail (Gmail) accounts
quit = Do not change anything

Command >> courier

imap_server_type = courier
default_folder_prefix = INBOX.
trash_folder = Trash
sent_folder = Sent
draft_folder = Drafts
show_prefix_option = false
default_sub_of_inbox = false
show_contain_subfolders_option = false
optional_delimiter = .
delete_folder = true
Press enter to continue... <-- press ENTER

Ignore the second set of instructions! 

(unless they get deleted)

Submitted by andrewf (not registered) on Tue, 2013-04-02 14:58.

I have been running a virtual server setup using your most excellent guides for a couple of years now (it was an open-suse, Apache, courier, ispconfig3 configuration) but one of the many sites I run may have been compromised today.

It was a Drupal site, and my "blind-panic"  response was to restore from the last known good DB backup which immediately resolved the problems on that specific site. As it is a security related site, it tends to be a target and I had noticed a concerted attempt to breach it over about a 3 hour period from the same IP address.

Anyway, what I would like to see added to the tutorial (and applicable to all of them), in a an approximate order of priority, is how to:

  1. Add Tripwire (or AFICK, etc) to the install/configuration
  2. Add mod_security and mod_evasive to the Apache setup
  3.  Add separate DB and mail servers, especially behind a DMZ.
  4. Configure partitions so your web sites were on a separate partition (disc/LVM) and the effect that has on quota configuration where file uploads are a major consideration else the DB files where it is mainly content driven, and hence the (typically) /var partition for MySQL databases, whether an "all in one" server or separated by role.
  5. Setup the email notifications (both local and via a 3rd party such as gmail) for all the alerting including rkhunter, clamav, and tripwire.
  6. Optimal configuration of Apache log files for use by AWStats

These are (I feel) pretty small changes to this "most excellent" tutorial, and given I run 18 web sites from 1 virtual server, + 10 other virtual development machines from Windows XP, through Win7 to Server 2008 R2 and Windows 8 all on a box with 2 Tb of disc and 16 Gb ram which cost me AU$800 to build, it is not a high-end system, but well within the reach of most people.

 I would be more than happy to help with the tutorial updates.

 

Submitted by psykosen (registered user) on Thu, 2013-03-21 21:22.

Look out for this error!

Mar 21 22:11:32 server1 clamd[18414]: Self checking every 600 seconds.
Mar 21 22:11:33 server1 dovecot: master: Warning: Killed with signal 15 (by pid=18417 uid=0 code=kill)
Mar 21 22:11:35 server1 dovecot: master: Dovecot v2.0.9 starting up (core dumps disabled)
Mar 21 22:12:10 server1 postfix/smtpd[18526]: connect from localhost[::1]
Mar 21 22:12:10 server1 dovecot: auth: Error: Can't open configuration file /etc/dovecot-sql.conf: No such file or directory
Mar 21 22:12:10 server1 dovecot: master: Error: service(auth): command startup failed, throttling
Mar 21 22:12:10 server1 dovecot: log: Error: service(auth): child 18528 returned error 89 (Fatal failure)
Mar 21 22:12:10 server1 postfix/smtpd[18526]: fatal: no SASL authentication mechanisms
Mar 21 22:12:11 server1 postfix/master[18347]: warning: process /usr/libexec/postfix/smtpd pid 18526 exit status 1
Mar 21 22:12:11 server1 postfix/master[18347]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

it happend to me both on 64Bit and 32Bit
it stats that "/etc/dovecot-sql.conf" is not found thats true the file is in /etc/dovecot/dovecot-sql.conf
open /etc/dovecot/dovecot.conf and replace.
passdb {
## args = /etc/dovecot-sql.conf
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}
userdb {
## args = /etc/dovecot-sql.conf
args = /etc/dovecot/dovecot-sql.conf
driver = sql
}

!!Allso the squirrelmail is configurated for courier but the Howto installs dovecot!!

any ways keep it up..! nice work straightforward for newbie on CentOS

Submitted by almereyda (not registered) on Mon, 2013-12-30 22:49.

Someone should file a bug report. Maybe I'll do that in the next days.

Because this fix did it for me, too, on a fresh install.

Still I'm wondering why ISPConfig 3.0.5.4 is taking so long, as many bugs are already known and/or fixed.

Thanks for providing the solution, @psykosen.

Submitted by Anonymous (not registered) on Mon, 2013-12-16 07:16.
Thank you!  I spent the last two hours trying to figure this out!  I appreciate you posting the fix!
Submitted by Kian Mayne (not registered) on Sat, 2013-05-25 13:05.

Thank you so much, I wasn't eagle-eyed enough to notice the /etc/dovecot-sql.conf - /etc/dovecot/dovecot-sql.conf discrepancy!

 Dovecot is finally working :) Thanks a lot

Submitted by abintipl (registered user) on Sat, 2013-07-27 20:06.

Hi, 

 Thank you for this solution, it's been one week I am stuggling finally made it

Thanks  

Submitted by Anonymous (not registered) on Fri, 2014-05-16 11:45.
another solution

ln -s /etc/dovecot/dovecot-sql.conf /etc/dovecot-sql.conf

ln -s /etc/dovecot/dovecot.conf /etc/dovecot.conf