Der Perfekte Server – CentOS 6.1 x86_64 mit nginx [ISPConfig 3]
24 Installation von SquirrelMail
Um den SquirrelMail Webmail Client zu installieren, benutzen Sie…
yum install squirrelmail
Konfigurieren Sie dann SquirrelMail:
/usr/share/squirrelmail/config/conf.pl
SquirrelMail muss wissen, dass Courier-IMAP/-POP3 verwendet wird:
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 >> <– courier
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… <– 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
Eine letzte Einstellung, die Sie vornehmen müssen, ist das Auskommentieren der $default_folder_prefix Variable in der /etc/squirrelmail/config_local.php Datei – tun Sie dies nicht, werden Sie die folgende Fehlermeldung in SquirrelMail sehen, nachdem Sie sich angemeldet haben: 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 © 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 = ''; ?>
Sie können SquirrelMail nun im /usr/share/squirrelmail/ Verzeichnis finden.
Nachdem Sie ISPConfig 3 installiert haben, können Sie folgendermaßen auf SquirrelMail zugreifen:
Der ISPConfig apps vhost auf Port 8081 für nginx kommt mit einer SquirrelMail Konfiguration, Sie können daher http://server1.example.com:8081/squirrelmail oder http://server1.example.com:8081/webmail benutzen um auf SquirrelMail zuzugreifen.
Wollen Sie ein /webmail oder /squirrelmail Alias einrichten, das Sie von Ihren Webseiten aus benutzen können, so ist dies etwas komplizierter als für Apache, da nginx keine globalen Aliase hat (also Aliase, welche für alle vhosts definiert werden können). Sie müssen Ihre Aliase deshalb für jeden vhost definieren, von dem aus Sie auf phpMyAdmin zugreifen wollen.
Um dies zu tun, fügen Sie folgendes in das nginx Directives Feld im Options Reiter der Webseite in ISPConfig ein:
location /squirrelmail { root /usr/share/; index index.php index.html index.htm; location ~ ^/squirrelmail/(.+.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; include /etc/nginx/fastcgi_params; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_buffer_size 128k; fastcgi_buffers 256 4k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; } location ~* ^/squirrelmail/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /webmail { rewrite ^/* /squirrelmail last; }
Benutzen Sie für Ihren vhost https statt http, sollten Sie die Zeile fastcgi_param HTTPS on; zu Ihrer SquirrelMail Konfiguration hinzufügen:
location /squirrelmail {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/squirrelmail/(.+.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param HTTPS on; # <-- Fügen Sie diese Zeile hinzu
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
location ~* ^/squirrelmail/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /webmail {
rewrite ^/* /squirrelmail last;
}
Benutzen Sie für Ihren vhost sowohl http als auch https, müssen Sie die folgende Sektion zur http {} Sektion in /etc/nginx/nginx.conf hinzufügen (vor jeglichen include Zeilen) welche überprüft, ob der Besucher http oder https benutzt und dementsprechend die $fastcgi_https Variable setzt (welche in der SquirrelMail Konfiguration benutzt wird) (beachten Sie bitte, dass Sie dies nicht mehr tun müssen, wenn Sie die Sektion bereits hinzugefügt haben, zum Beispiel bei der Konfiguration von phpMyAdmin – siehe Kapitel 16):
vi /etc/nginx/nginx.conf
[...] http { [...] ## Detect when HTTPS is used map $scheme $fastcgi_https { default off; https on; } [...] } [...]
Vergessen Sie nicht, danach nginx neu zu starten:
/etc/init.d/nginx reload
Gehen Sie danach wieder in das nginx Directives Feld und anstatt der Zeile fastcgi_param HTTPS on; fügen Sie nun fastcgi_param HTTPS $fastcgi_https; hinzu, sodass Sie SquirrelMail sowohl für http als auch für https Anfragen benutzen können:
location /squirrelmail {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/squirrelmail/(.+.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param HTTPS $fastcgi_https; # <-- Fügen Sie diese Zeile hinzu
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
location ~* ^/squirrelmail/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /webmail {
rewrite ^/* /squirrelmail last;
}
25 Installation von ISPConfig 3
Bevor Sie mit der Installation von ISPConfig beginnen, stellen Sie sicher, dass Apache gestoppt ist (falls es installiert ist – es ist möglich, dass einige installierte Pakete Apache als vorausgesetztes Paket mitinstalliert haben, ohne, dass Sie dies gemerkt hätten). Ist Apache2 installiert, stoppen Sie es jetzt…
/etc/init.d/httpd stop
… und entfernen die Apache Systemstartlinks:
chkconfig –del httpd
Stellen Sie sicher, dass nginx gestartet ist:
/etc/init.d/nginx restart
(Haben Sie sowohl Apache als auch nginx installiert, wird Sie der Installer fragen, welches davon Sie benutzen möchten: Apache and nginx detected. Select server to use for ISPConfig: (apache,nginx) [apache]:
Geben Sie hier nginx ein. Ist nur Apache oder nur nginx installiert wird dies automatisch vom Installer erkannt und es werden keine Fragen gestellt.)
Laden Sie die aktuelle Version von ISPConfig 3 herunter und installieren Sie. Der ISPConfig Installer wird alle Dienste wie Postfix, Courier, etc. für Sie konfigurieren. Manuelle Einstellungen wie in ISPConfig 2 sind nicht mehr notwendig.
Sie haben nun außerdem die Möglichkeit, den Installer einen SSL vhost für die ISPConfig Kontrolloberfläche erstellen zu lassen, sodass ISPConfig durch https:// anstatt von http:// erreichbar ist. Um dies zu bewerkstelligen, drücken Sie einfach ENTER, wenn Sie diese Frage sehen: Do you want a secure(SSL) connection to the ISPConfig web interface (y,n) [y]:.
Um die aktuellste Version von ISPConfig 3 zu installieren, führen Sie folgendes aus:
cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install/
Als nächstes benutzen Sie folgenden Befehl:
php -q install.php
Dieser wird den ISPConfig 3 Installer starten:
[[email protected] 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 []: <– IhrrootsqlPasswort
MySQL database to create [dbispconfig]: <– ENTER
MySQL charset [utf8]: <– ENTER
Apache and nginx detected. Select server to use for ISPConfig: (apache,nginx) [apache]: <– nginx
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 SASL
Configuring PAM
Configuring Courier
Configuring Spamassassin
Configuring Amavisd
Configuring Getmail
Configuring Pureftpd
Configuring BIND
Configuring nginx
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 ]
Shutting down amavisd: Daemon [1503] terminated by SIGTERM
[ OK ]
amavisd stopped
Starting amavisd: [ OK ]
Stopping clamd.amavisd: [ OK ]
Starting clamd.amavisd: [ OK ]
Stopping Courier authentication services: authdaemond
Starting Courier authentication services: authdaemond
Stopping Courier-IMAP server: imap imap-ssl pop3 pop3-ssl
Starting Courier-IMAP server: imap imap-ssl pop3 pop3-ssl
Stopping Courier-IMAP server: imap imap-ssl pop3 pop3-ssl
Starting Courier-IMAP server: imap imap-ssl pop3 pop3-ssl
Stopping Courier-IMAP server: imap imap-ssl pop3 pop3-ssl
Starting Courier-IMAP server: imap imap-ssl pop3 pop3-ssl
Stopping Courier-IMAP server: imap imap-ssl pop3 pop3-ssl
Starting Courier-IMAP server: imap imap-ssl pop3 pop3-ssl
SyntaxError: (‚invalid syntax‘, (‚/usr/lib/mailman/Mailman/mm_cfg.py‘, 76, 27, ‚DEFAULT_SERVER_LANGUAGE = n‘))
Traceback (most recent call last):
File „/usr/lib/mailman/bin/mailmanctl“, line 109, in <module>
from Mailman import mm_cfg
File „/usr/lib/mailman/Mailman/mm_cfg.py“, line 76
DEFAULT_SERVER_LANGUAGE =
^
SyntaxError: invalid syntax
Shutting down mailman: [FAILED]
SyntaxError: (‚invalid syntax‘, (‚/usr/lib/mailman/Mailman/mm_cfg.py‘, 76, 27, ‚DEFAULT_SERVER_LANGUAGE = n‘))
Traceback (most recent call last):
File „/usr/lib/mailman/bin/mailmanctl“, line 109, in <module>
from Mailman import mm_cfg
File „/usr/lib/mailman/Mailman/mm_cfg.py“, line 76
DEFAULT_SERVER_LANGUAGE =
^
SyntaxError: invalid syntax
Starting mailman: [FAILED]
Reloading php-fpm: [ OK ]
Reloading nginx: [ OK ]
Stopping pure-ftpd: [ OK ]
Starting pure-ftpd: [ OK ]
Installation completed.
[[email protected] install]#
Um die Mailman Fehler zu beheben, die während der Installation
auftreten könnten, öffnen Sie /usr/lib/mailman/Mailman/mm_cfg.py…
vi /usr/lib/mailman/Mailman/mm_cfg.py
… und setzen Sue DEFAULT_SERVER_LANGUAGE =
‚en‘:
[...] #------------------------------------------------------------- # The default language for this server. DEFAULT_SERVER_LANGUAGE = 'en' [...]
Starten Sie Mailman danach neu:
/etc/init.d/mailman restart
Sie können ISPConfig 3 danach unter http(s)://server1.example.com:8080/ oder http(s)://192.168.0.100:8080/ (http oder https ist abhängig davon, wofür Sie sich während der Installation entschieden haben). Loggen Sie sich mit dem Benutzernamen admin und dem Passwort admin (Sie sollten das Standartpasswort nach Ihrer ersten Anmeldung ändern):
Das System kann nun benutzt werden.
25.1 ISPConfig 3 Handbuch
Um den Umgang mit ISPConfig 3 zu lernen, empfehlen wir das ISPConfig 3 Handbuch herunterzuladen (bislang nur auf Englisch erhältlich).
Auf mehr als 300 Seiten beschreibt das Handbuch den Aufbau von ISPConfig und geht auf die unterschiedlichen Gruppen wie Admins, Wiederverkäufer und Kunden ein. Es wird nicht nur beschrieben, wie man ISPConfig 3 installiert und aktualisiert, sondern beinhaltet zusätzlich Referezen, in welchen alle Formularfelder mit Beispielen für mögliche Eingaben beschrieben werden. Für die gängigen Aufgaben in ISPConfig 3 werden ebenfalls detaillierte Anleitungen zur Verfügung gestellt. Ergänzend wird umfassend auf den Bereich der Serversicherheit eingegangen sowie eine ausführliche Fehlersuche bereit gestellt.
25.2 ISPConfig Monitor App für Android
Mit der ISPConfig Monitor App können Sie den Status Ihrer Server abrufen und nachsehen, ob alle Dienste wie geplant laufen. Sie können Ihre TCP und UDP ports kontrollieren und Ihren Server pingen. Zusätzlich
können Sie die App benutzen um Details von Servern abzurufen, auf denen ISPConfig installiert ist (beachten Sie bitte, dass mindestens ISPConfig Version 3.0.3.3 installiert sein muss, um mit der Monitor App interagieren zu können!); diese Details beinhalten alles, was Sie vom Monitor Modul aus ISPConfig 3 gewohnt sind (z.B. Dienste, Mail- und Systemlogs, Mail queue, CPU und RAM Info, Speichergebrauch, Quota, OS Details, RKHunter log, etc.) und natürlich können Sie, da ISPConfig multiserverfähig ist, alle Server überwachen, die von Ihrem ISPConfig Master Server kontrolliert werden.
Den Download und die Gebrauchsanleitung finden Sie hier http://www.ispconfig.org/ispconfig-3/ispconfig-monitor-app-for-android/
26 Links
- CentOS: http://www.centos.org/
- ISPConfig: http://www.ispconfig.org/