Script For Automatically Setting Up A "Perfect Server" On OpenSUSE And Installing ISPConfig 3
This page contains downloads for the latest script versions. A variant of this page is available at:
Here's a script that automates the task of setting up a HowToForge: Perfect Server - OpenSUSE 11.3 x86_64 [ISPConfig 3], and in the end it also installs ISPConfig 3.
Please note: do not execute this script on an already working server, because this script may overwrite configuration files and break the running system. It is only meant to be used on a fresh installation of supported version of OpenSUSE.
For OpenSuSE 12.x the script takes advantage of the btrfs file system and snapper utility to create rollback snapshots during installation. If the system is ext4, snapper command execution errors can be ignored without consequences.
Please pick the correct version of the script in relation to the installed version of OpenSuSE distribution:
There are few things missing from the original tutorial on HowToForge, as I have found it. I have made a script, based on the tutorial, that prepares a system, and which contains several steps that, if not done, will leave the system unfinished in some way.
- fail2ban configuration
- SuSEfirewall2 enabled
- Pure-ftpd configuration change (allow renames, change passive ports and permissions)
- Postfix certificate generation
- Apache SSL certificate generation, and switching ISPConfig to HTTPS
- Fix of NameVirtualHost apache config with OpenSUSE (important for Apache to recognize multiple domains from ISPConfig)
- Setup of rdiff-backup with cron
- Fixed dovecot configuration to enable SSL and support courier-compatibility
- Fixed pam_mysql to work on 64-bit systems
- Fixed amavis to find clamd socket
- Installed eAccelerator
- Fixed apache custom errors path
- Install and configure awstats
- Configure apache and awstats to use mod_logio for correct bandwidth measurement
- and more...
The script is imperfect in the fact that requires manual entry twice - when mysql_secure_install is run, and when ispconfig_update_svn is run. (I use svn, because ISPConfig latest SVN looks much nicer, but one can type stable as well - on production systems, you should use stable!)
before running this script.
Also better change the host name (file HOSTNAME) manually with yast2 before running this script, so that OpenSUSE will put a proper name into Postfix configuration.
This script requires manual actions:
- When mysql_secure_install is run (for OpenSuSE 12.x it is automatic without requiring manual intervention).
- If zypper asks for conflicting packages, please choose option 4 (break dependency).
- For ISPConfig3 update, if SVN update is chosen, one may need to say 'y' to enable SSL, while for all other options - one can choose a default value by just pressing ENTER.
You should change the following variables in the script before you run it:
- THIS_PLATFORM: Either x86_64 or i586.
- MYSQLROOTPASS: Please change MYSQLROOTPASS, and be sure to enter it verbatim during the installation of mysql_secure_install, if asked.
- MY_HOSTNAME, MY_DOMAIN: Change this to your server name. By default it's configured to server1.mydomain.com. If your web site hosts a complete domain, such as domain.com, still leave something for MY_HOSTNAME. server1 or host is a good name.
- ISPCONFIG_TAR_GZ: Make sure that ISPCONFIG_TAR_GZ holds the latest available ISPConfig 3 version. Beware, that automatic piping to answer all the questions is set up to work with ISPConfig 126.96.36.199 (and 188.8.131.52 for OpenSuSE 12.x and 13.x), and you may need to change that part of the script, if ISPConfig is of a later version.
Save the modified script to your server's directory (e.g. /root/opensuse_ispconfig3_my.sh):
Then run the script as:
- sh /root/opensuse_ispconfig3_my.sh