The Perfect Server - OpenSUSE 12.2 x86_64 (Apache2, Dovecot, ISPConfig 3) - Page 4
8 Install Postfix, Dovecot, MySQLRun zypper install postfix postfix-mysql mysql-community-server libmysqlclient-devel dovecot21 dovecot21-backend-mysql pwgen cron python If you get the following message, please select to uninstall exim: Problem: postfix-2.8.11-2.6.1.x86_64 conflicts with exim provided by exim-4.77-2.1.3.x86_64 You might also have to uninstall patterns-openSUSE-minimal_base-conflicts-12.2-5.5.1.x86_64: Problem: patterns-openSUSE-minimal_base-conflicts-12.2-5.5.1.x86_64 conflicts with python provided by python-2.7.3-3.6.1.x86_64 Create the following symlink: ln -s /usr/lib64/dovecot/modules /usr/lib/dovecot At this point I had to reboot because otherwise MySQL refused to start with the error: Failed to issue method call: Unit mysql.service failed to load: No such file or directory. See system logs and 'systemctl status mysql.service' for details. reboot Start MySQL, Postfix, and Dovecot and enable the services to be started at boot time. systemctl enable mysql.service systemctl enable postfix.service systemctl enable dovecot.service Now I install the getmail package: zypper install getmail To secure the MySQL installation, run: mysql_secure_installation Now you will be asked several questions: server1:~ # mysql_secure_installation Now your MySQL setup should be secured.
9 Amavisd-new, Spamassassin And ClamavInstall Amavisd-new, Spamassassin and Clamav antivirus. Run zypper install amavisd-new clamav clamav-db zoo unzip unrar bzip2 unarj perl-DBD-mysql Open /etc/amavisd.conf... vi /etc/amavisd.conf ... and add the $myhostname line with your correct hostname below the $mydomain line:
Then create a symlink from /var/run/clamav/clamd to /var/lib/clamav/clamd-socket: mkdir -p /var/run/clamav OpenSUSE 12.2 has a /run directory for storing runtime data. /run is now a tmpfs, and /var/run is now bind mounted to /run from tmpfs, and hence emptied on reboot. This means that after a reboot, the directory /var/run/clamav that we have just created will not exist anymore, and therefore clamd will fail to start. Therefore we create the file /etc/tmpfiles.d/clamav.conf now that will create this directory at system startup (see http://0pointer.de/public/systemd-man/tmpfiles.d.html for more details): vi /etc/tmpfiles.d/clamav.conf
Before we start amavisd and clamd, we must edit the /etc/init.d/amavis init script - I wasn't able to reliably start, stop and restart amavisd with the default init script: vi /etc/init.d/amavis Comment out the following lines in the start and stop section:
Because we have changed the init script, we must run systemctl --system daemon-reload now. To enable the services, run: systemctl enable amavis.service
10 Install The Apache 2 Webserver With PHP5, Python, WebDAVInstall Apache2 and suphp. Run: zypper install apache2 apache2-mod_fcgid Install PHP5: zypper install php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-mysql php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm ImageMagick curl apache2-mod_php5 zypper install http://download.opensuse.org/repositories/server:/php/openSUSE_12.2/x86_64/suphp-0.7.1-5.1.x86_64.rpm Then run these commands to enable the Apache modules (including WebDAV): a2enmod suexec a2enflag SSL To add Python support, run: zypper install apache2-mod_python a2enmod python Next we install phpMyAdmin: zypper install phpMyAdmin To make sure that we can access phpMyAdmin from all websites created through ISPConfig later on by using /phpmyadmin (e.g. http://www.example.com/phpmyadmin) and /phpMyAdmin (e.g. http://www.example.com/phpMyAdmin), open /etc/apache2/conf.d/phpMyAdmin.conf... vi /etc/apache2/conf.d/phpMyAdmin.conf ... and add the following two aliases right at the beginning:
Start Apache: systemctl enable apache2.service
10.1 PHP-FPMStarting with the upcoming ISPConfig 3.0.5, there will be an additional PHP mode that you can select for usage with Apache: PHP-FPM. If you plan to use this PHP mode, it makes sense to configure your system for it now so that later on when you upgrade to ISPConfig 3.0.5, your system is prepared (the latest ISPConfig version at the time of this writing is ISPConfig 3.0.4.6). To use PHP-FPM with Apache, we need the mod_fastcgi Apache module (please don't mix this up with mod_fcgid - they are very similar, but you cannot use PHP-FPM with mod_fcgid). We can install PHP-FPM and mod_fastcgi as follows: mod_fastcgi is available from a third-party repository which we can enable it as follows: zypper --gpg-auto-import-keys addrepo --name "Third-party modules for the Apache HTTP server. (Apache_openSUSE_12.2)" http://download.opensuse.org/repositories/Apache:/Modules/Apache_openSUSE_12.2/ apache-third-party-12.2 Next we install mod_fastcgi and PHP-FPM: zypper install apache2-mod_fastcgi php5-fpm Unfortunately there's a bug in the apache2-mod_fastcgi package which does not allow the usage of the FastCgiExternalServer directive inside a <VirtualHost> section (see How To Build mod_fastcgi For Apache2 On OpenSUSE 12.2). That's why we must rebuild mod_fastcgi: zypper install apache2-devel wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz ln -s /usr/include/apache2-worker/mpm.h /usr/include/apache2/ Before we start PHP-FPM, rename /etc/php5/fpm/php-fpm.conf.default to /etc/php5/fpm/php-fpm.conf: mv /etc/php5/fpm/php-fpm.conf.default /etc/php5/fpm/php-fpm.conf Change the permissions of PHP's session directory: chmod 1733 /var/lib/php5 Then open /etc/php5/fpm/php-fpm.conf... vi /etc/php5/fpm/php-fpm.conf ... and change error_log to /var/log/php-fpm.log:
There's no php.ini file for PHP-FPM under OpenSUSE 12.2, therefore we copy the CLI php.ini: cp /etc/php5/cli/php.ini /etc/php5/fpm/ Next open /etc/php5/fpm/php.ini... vi /etc/php5/fpm/php.ini ... and set cgi.fix_pathinfo to 0:
Next create the system startup links for php-fpm and start it: systemctl enable php-fpm.service PHP-FPM is a daemon process that runs a FastCGI server on port 9000, as you can see in the output of netstat -tapn server1:~ # netstat -tapn Next enable the following Apache modules... a2enmod actions ... and restart Apache: systemctl restart apache2.service
|



Recent comments
12 hours 16 min ago
18 hours 57 min ago
22 hours 48 min ago
1 day 26 min ago
1 day 8 hours ago
1 day 18 hours ago
1 day 19 hours ago
1 day 22 hours ago
2 days 3 hours ago
2 days 3 hours ago