Текущая версия |
Ваш текст |
Строка 342: |
Строка 342: |
| | | |
| ===14. Install fail2ban=== | | ===14. Install fail2ban=== |
− |
| |
− | This is optional but recommended, because the ISPConfig monitor tries to show the log:
| |
− | apt-get install fail2ban
| |
− |
| |
− | To make fail2ban monitor PureFTPd and Dovecot, create the file /etc/fail2ban/jail.local:
| |
− | vi /etc/fail2ban/jail.local
| |
− |
| |
− | <pre>
| |
− | [pureftpd]
| |
− |
| |
− | enabled = true
| |
− | port = ftp
| |
− | filter = pureftpd
| |
− | logpath = /var/log/syslog
| |
− | maxretry = 3
| |
− |
| |
− |
| |
− | [dovecot-pop3imap]
| |
− |
| |
− | enabled = true
| |
− | filter = dovecot-pop3imap
| |
− | action = iptables-multiport[name=dovecot-pop3imap,
| |
− | port="pop3,pop3s,imap,imaps", protocol=tcp]
| |
− | logpath = /var/log/mail.log
| |
− | maxretry = 5
| |
− | </pre>
| |
− |
| |
− | Then create the following two filter files:
| |
− | vi /etc/fail2ban/filter.d/pureftpd.conf
| |
− |
| |
− | <pre>
| |
− | [Definition]
| |
− | failregex = .*pure-ftpd: \(.*@<HOST>\) \[WARNING\]
| |
− | Authentication failed for user.*
| |
− | ignoreregex =
| |
− | vi /etc/fail2ban/filter.d/dovecot-pop3imap.conf
| |
− | </pre>
| |
− |
| |
− | <pre>
| |
− | [Definition]
| |
− | failregex = (?: pop3-login|imap-login): .*(?:Authentication failure|Aborted login \(auth failed|
| |
− | Aborted login \(tried to use disabled|Disconnected \(auth failed|Aborted login \
| |
− | (\d+ authentication attempts).*rip=(?P<host>\S*),.*
| |
− | ignoreregex =
| |
− | </pre>
| |
− |
| |
− | Restart fail2ban afterwards:
| |
− | /etc/init.d/fail2ban restart
| |
− |
| |
− |
| |
− |
| |
− | ===15. Install SquirrelMail===
| |
− |
| |
− | To install the SquirrelMail webmail client, run
| |
− | apt-get install squirrelmail
| |
− |
| |
− | Then create the following symlink...
| |
− | ln -s /usr/share/squirrelmail/ /var/www/webmail
| |
− |
| |
− | ... and configure SquirrelMail:
| |
− | squirrelmail-configure
| |
− |
| |
− | We must tell SquirrelMail that we are using Dovecot-IMAP/-POP3:
| |
− |
| |
− | <pre>
| |
− | 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 on
| |
− | 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 >> dovecot
| |
− |
| |
− | imap_server_type = dovecot
| |
− | default_folder_prefix = <none>
| |
− | 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 = detect
| |
− | delete_folder = false
| |
− |
| |
− | Press any key to continue... <-- press a key
| |
− |
| |
− |
| |
− | 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 on
| |
− | 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 on
| |
− | S Save data
| |
− | Q Quit
| |
− |
| |
− | Command >> <-- Q
| |
− |
| |
− | </pre>
| |
− |
| |
− | Afterwards you can access SquirrelMail under http://server1.example.com/webmail or http://192.168.0.100/webmail:
| |
− |
| |
− | [[Файл:SquirrelMail.jpg]]
| |
− |
| |
− | ===16. Install ISPConfig 3===
| |
− |
| |
− | To install ISPConfig 3 from the latest released version, do this:
| |
− | <pre>
| |
− | cd /tmp
| |
− | wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
| |
− | tar xfz ISPConfig-3-stable.tar.gz
| |
− | cd ispconfig3_install/install/
| |
− | </pre>
| |
− | The next step is to run
| |
− | php -q install.php
| |
− |
| |
− | This will start the ISPConfig 3 installer. The installer will configure all services like Postfix, Dovecot, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary.
| |
− |
| |
− | root@server1:/tmp/ispconfig3_install/install# php -q install.php
| |
− |
| |
− | [[Файл:ISP.jpg]]
| |
− |
| |
− | >> Initial configuration
| |
− |
| |
− | Operating System: Debian 6.0 (Squeeze/Sid) or compatible
| |
− |
| |
− | 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.
| |
− | -----
| |
− | <pre>
| |
− | Country Name (2 letter code) [AU]: <-- ENTER
| |
− |
| |
− | State or Province Name (full name) [Some-State]: <-- ENTER
| |
− |
| |
− | Locality Name (eg, city) []: <-- ENTER
| |
− |
| |
− | Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- ENTER
| |
− |
| |
− | Organizational Unit Name (eg, section) []: <-- ENTER
| |
− |
| |
− | Common Name (eg, YOUR name) []: <-- 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 Firewall
| |
− |
| |
− | Installing ISPConfig
| |
− |
| |
− | ISPConfig Port [8080]: <-- ENTER
| |
− |
| |
− |
| |
− | Configuring DBServer
| |
− |
| |
− | Installing ISPConfig crontab
| |
− |
| |
− | no crontab for root
| |
− |
| |
− | no crontab for getmail
| |
− |
| |
− | Restarting services ...
| |
− |
| |
− | Stopping MySQL database server: mysqld.
| |
− |
| |
− | Starting MySQL database server: mysqld.
| |
− |
| |
− | Checking for corrupt, not cleanly closed and upgrade needing tables..
| |
− |
| |
− | Stopping Postfix Mail Transport Agent: postfix.
| |
− |
| |
− | Starting Postfix Mail Transport Agent: postfix.
| |
− |
| |
− | Stopping amavisd: amavisd-new.
| |
− |
| |
− | Starting amavisd: amavisd-new.
| |
− |
| |
− | Stopping ClamAV daemon: clamd.
| |
− |
| |
− | Starting ClamAV daemon: clamd Bytecode: Security mode set to "TrustSigned".
| |
− |
| |
− | .
| |
− |
| |
− | If you have trouble with authentication failures,
| |
− | enable auth_debug setting. See http://wiki.dovecot.org/WhyDoesItNotWork
| |
− | This message goes away after the first successful login.
| |
− | Restarting IMAP/POP3 mail server: dovecot.
| |
− | Restarting web server: apache2 ... waiting ..
| |
− | Restarting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot -l
| |
− | mysql:/etc/pure-ftpd/db/mysql.conf -l pam -Y 1 -8 UTF-8 -H -D -b -O clf:/var/log/
| |
− | pure-ftpd/transfer.log -E -u 1000 -A -B
| |
− | Installation completed.
| |
− | root@server1:/tmp/ispconfig3_install/install#
| |
− | </pre>
| |
− |
| |
− | The installer automatically configures all underlying services, so no manual configuration is needed.
| |
− |
| |
− | Afterwards you can access ISPConfig 3 under http://server1.example.com:8080/ or http://192.168.0.100:8080/. Log in with the username admin and the password admin (you should change the default password after your first login):
| |
− |
| |
− | [[Файл:40.png]]
| |
− |
| |
− | [[Файл:41.png]]
| |
− |
| |
− | The system is now ready to be used.
| |
− |
| |
− |
| |
− |
| |
− | ====16.1 ISPConfig 3 Manual====
| |
− |
| |
− | In order to learn how to use ISPConfig 3, I strongly recommend to download the ISPConfig 3 Manual.
| |
− |
| |
− | On about 300 pages, it covers the concept behind ISPConfig (admin, resellers, clients), explains how to install and update ISPConfig 3, includes a reference for all forms and form fields in ISPConfig together with examples of valid inputs, and provides tutorials for the most common tasks in ISPConfig 3. It also lines out how to make your server more secure and comes with a troubleshooting section at the end.
| |
− |
| |
− |
| |
− |
| |
− | ====16.2 ISPConfig Monitor App For Android====
| |
− | With the ISPConfig Monitor App, you can check your server status and find out if all services are running as expected. You can check TCP and UDP ports and ping your servers. In addition to that you can use this app to request details from servers that have ISPConfig installed (please note that the minimum installed ISPConfig 3 version with support for the ISPConfig Monitor App is 3.0.3.3!); these details include everything you know from the Monitor module in the ISPConfig Control Panel (e.g. services, mail and system logs, mail queue, CPU and memory info, disk usage, quota, OS details, RKHunter log, etc.), and of course, as ISPConfig is multiserver-capable, you can check all servers that are controlled from your ISPConfig master server.
| |
− |
| |
− | For download and usage instructions, please visit http://www.ispconfig.org/ispconfig-3/ispconfig-monitor-app-for-android/.
| |
− |
| |
− | ===17. Additional Notes===
| |
− |
| |
− | ====17.1 OpenVZ====
| |
− | If the Debian server that you've just set up in this tutorial is an OpenVZ container (virtual machine), you should do this on the host system (I'm assuming that the ID of the OpenVZ container is 101 - replace it with the correct VPSID on your system):
| |
− |
| |
− | <pre>
| |
− | VPSID=101
| |
− | for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN
| |
− | SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_
| |
− | ADMIN SYS_CHROOT SYS_NICE
| |
− | do
| |
− | vzctl set $VPSID --capability ${CAP}:on --save
| |
− | done
| |
− | </pre>
| |
− |
| |
− | ====17.2 SquirrelMail====
| |
− | Lots of people have reported problems (such as getting 404 Not Found errors) using the SquirrelMail webmail package in their web sites created through ISPConfig 3. This guide explains how to configure SquirrelMail on a Debian Squeeze server so that you can use it from within your web sites (created through ISPConfig).
| |
− |
| |
− | SquirrelMail's Apache configuration is in the file /etc/squirrelmail/apache.conf, but this file isn't loaded by Apache because it is not in the /etc/apache2/conf.d/ directory. Therefore we create a symlink called squirrelmail.conf in the /etc/apache2/conf.d/ directory that points to /etc/squirrelmail/apache.conf and reload Apache afterwards:
| |
− |
| |
− | <pre>
| |
− | cd /etc/apache2/conf.d/
| |
− | ln -s ../../squirrelmail/apache.conf squirrelmail.conf
| |
− | /etc/init.d/apache2 reload
| |
− | </pre>
| |
− |
| |
− | Now open /etc/apache2/conf.d/squirrelmail.conf...
| |
− | vi /etc/apache2/conf.d/squirrelmail.conf
| |
− |
| |
− | ... and add the following lines to the <Directory /usr/share/squirrelmail></Directory> container that make sure that mod_php is used for accessing SquirrelMail, regardless of what PHP mode you select for your website in ISPConfig:
| |
− |
| |
− | <pre>
| |
− | [...]
| |
− | <Directory /usr/share/squirrelmail>
| |
− | Options FollowSymLinks
| |
− | <IfModule mod_php5.c>
| |
− | AddType application/x-httpd-php .php
| |
− | php_flag magic_quotes_gpc Off
| |
− | php_flag track_vars On
| |
− | php_admin_flag allow_url_fopen Off
| |
− | php_value include_path .
| |
− | php_admin_value upload_tmp_dir /var/lib/squirrelmail/tmp
| |
− | php_admin_value open_basedir /usr/share/squirrelmail:/etc/squirrelmail:
| |
− | /var/lib/squirrelmail:/etc/hostname:/etc/mailname:/var/spool/squirrelmail
| |
− | php_flag register_globals off
| |
− | </IfModule>
| |
− | <IfModule mod_dir.c>
| |
− | DirectoryIndex index.php
| |
− | </IfModule>
| |
− | # access to configtest is limited by default to prevent information leak
| |
− | <Files configtest.php>
| |
− | order deny,allow
| |
− | deny from all
| |
− | allow from 127.0.0.1
| |
− | </Files>
| |
− | </Directory>
| |
− | [...]
| |
− | </pre>
| |
− |
| |
− | Create the directory /var/lib/squirrelmail/tmp...
| |
− | mkdir /var/lib/squirrelmail/tmp
| |
− |
| |
− | ... and make it owned by the user www-data:
| |
− | chown www-data /var/lib/squirrelmail/tmp
| |
− |
| |
− | Reload Apache again:
| |
− | /etc/init.d/apache2 reload
| |
− |
| |
− | That's it already - /etc/apache2/conf.d/squirrelmail.conf defines an alias called /squirrelmail that points to SquirrelMail's installation directory /usr/share/squirrelmail.
| |
− |
| |
− | You can now access SquirrelMail from your web site as follows:
| |
− |
| |
− | http://www.example.com/squirrelmail
| |
− |
| |
− | You can also access it from the ISPConfig control panel vhost as follows (this doesn't need any configuration in ISPConfig):
| |
− |
| |
− | http://server1.example.com:8080/squirrelmail
| |
− |
| |
− | If you'd like to use the alias /webmail instead of /squirrelmail, simply open /etc/apache2/conf.d/squirrelmail.conf...
| |
− | vi /etc/apache2/conf.d/squirrelmail.conf
| |
− |
| |
− | ... and add the line Alias /webmail /usr/share/squirrelmail:
| |
− |
| |
− | <pre>
| |
− | Alias /squirrelmail /usr/share/squirrelmail
| |
− | Alias /webmail /usr/share/squirrelmail
| |
− | [...]
| |
− | </pre>
| |
− |
| |
− | Then reload Apache:
| |
− | /etc/init.d/apache2 reload
| |
− |
| |
− | Now you can access Squirrelmail as follows:
| |
− |
| |
− | http://www.example.com/webmail
| |
− | http://server1.example.com:8080/webmail
| |
− |
| |
− | If you'd like to define a vhost like webmail.example.com where your users can access SquirrelMail, you'd have to add the following vhost configuration to /etc/apache2/conf.d/squirrelmail.conf:
| |
− | vi /etc/apache2/conf.d/squirrelmail.conf
| |
− |
| |
− | <pre>
| |
− | [...]
| |
− | <VirtualHost 1.2.3.4:80>
| |
− | DocumentRoot /usr/share/squirrelmail
| |
− | ServerName webmail.example.com
| |
− | </VirtualHost>
| |
− | </pre>
| |
− |
| |
− | Make sure you replace 1.2.3.4 with the correct IP address of your server. Of course, there must be a DNS record for webmail.example.com that points to the IP address that you use in the vhost configuration. Also make sure that the vhost webmail.example.com does not exist in ISPConfig (otherwise both vhosts will interfere with each other!).
| |
− |
| |
− | Now reload Apache...
| |
− | /etc/init.d/apache2 reload
| |
− |
| |
− | ... and you can access SquirrelMail under http://webmail.example.com!
| |
− |
| |
− | ===18. Links===
| |
− | Debian: http://www.debian.org/
| |
− |
| |
− | ISPConfig: http://www.ispconfig.org/
| |