VMware Images: |
The Perfect Server - Debian Wheezy (Apache2, BIND, Dovecot, ISPConfig 3) - Page 4
12 Install Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, And mcryptApache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, and mcrypt can be installed as follows: apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libruby libapache2-mod-ruby libapache2-mod-python php5-curl php5-intl php5-memcache php5-memcached php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl memcached You will see the following question: Web server to reconfigure automatically: <-- apache2 Then run the following command to enable the Apache modules suexec, rewrite, ssl, actions, and include (plus dav, dav_fs, and auth_digest if you want to use WebDAV): a2enmod suexec rewrite ssl actions include a2enmod dav_fs dav auth_digest Next open /etc/apache2/mods-available/suphp.conf... vi /etc/apache2/mods-available/suphp.conf ... and comment out the <FilesMatch "\.ph(p3?|tml)$"> section and add the line AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtml - otherwise all PHP files will be run by SuPHP:
Restart Apache afterwards: /etc/init.d/apache2 restart If you want to host Ruby files with the extension .rb on your web sites created through ISPConfig, you must comment out the line application/x-ruby rb in /etc/mime.types: vi /etc/mime.types
(This is needed only for .rb files; Ruby files with the extension .rbx work out of the box.) Restart Apache afterwards: /etc/init.d/apache2 restart
12.1 XcacheXcache is a free and open PHP opcode cacher for caching and optimizing PHP intermediate code. It's similar to other PHP opcode cachers, such as eAccelerator and APC. It is strongly recommended to have one of these installed to speed up your PHP page. Xcache can be installed as follows: apt-get install php5-xcache Now restart Apache: /etc/init.d/apache2 restart
12.2 PHP-FPMStarting with ISPConfig 3.0.5, there is an additional PHP mode that you can select for usage with Apache: PHP-FPM. 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: apt-get install libapache2-mod-fastcgi php5-fpm Make sure you enable the module and restart Apache: a2enmod actions fastcgi alias
12.3 Additional PHP VersionsStarting with ISPConfig 3.0.5, it is possible to have multiple PHP versions on one server (selectable through ISPConfig) which can be run through FastCGI and PHP-FPM. To learn how to build additional PHP versions (PHP-FPM and FastCGI) and how to configure ISPConfig, please check this tutorial: How To Use Multiple PHP Versions (PHP-FPM & FastCGI) With ISPConfig 3 (Debian Wheezy).
13 Install MailmanSince version 3.0.4, ISPConfig also allows you to manage (create/modify/delete) Mailman mailing lists. If you want to make use of this feature, install Mailman as follows: apt-get install mailman Select at least one language, e.g.: Languages to support: <-- en (English) Before we can start Mailman, a first mailing list called mailman must be created: newlist mailman root@server1:~# newlist mailman Open /etc/aliases afterwards... vi /etc/aliases ... and add the following lines:
Run newaliases afterwards and restart Postfix: /etc/init.d/postfix restart Finally we must enable the Mailman Apache configuration: ln -s /etc/mailman/apache.conf /etc/apache2/conf.d/mailman.conf This defines the alias /cgi-bin/mailman/ for all Apache vhosts, which means you can access the Mailman admin interface for a list at http://<vhost>/cgi-bin/mailman/admin/<listname>, and the web page for users of a mailing list can be found at http://<vhost>/cgi-bin/mailman/listinfo/<listname>. Under http://<vhost>/pipermail you can find the mailing list archives. Restart Apache afterwards: /etc/init.d/apache2 restart Then start the Mailman daemon: /etc/init.d/mailman start
14 Install PureFTPd And QuotaPureFTPd and quota can be installed with the following command: apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool Edit the file /etc/default/pure-ftpd-common... vi /etc/default/pure-ftpd-common ... and make sure that the start mode is set to standalone and set VIRTUALCHROOT=true:
Now we configure PureFTPd to allow FTP and TLS sessions. FTP is a very insecure protocol because all passwords and all data are transferred in clear text. By using TLS, the whole communication can be encrypted, thus making FTP much more secure. If you want to allow FTP and TLS sessions, run echo 1 > /etc/pure-ftpd/conf/TLS In order to use TLS, we must create an SSL certificate. I create it in /etc/ssl/private/, therefore I create that directory first: mkdir -p /etc/ssl/private/ Afterwards, we can generate the SSL certificate as follows: openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem Country Name (2 letter code) [AU]: <-- Enter your Country Name (e.g., "DE"). Change the permissions of the SSL certificate: chmod 600 /etc/ssl/private/pure-ftpd.pem Then restart PureFTPd: /etc/init.d/pure-ftpd-mysql restart Edit /etc/fstab. Mine looks like this (I added ,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 to the partition with the mount point /): vi /etc/fstab
To enable quota, run these commands: mount -o remount / quotacheck -avugm
15 Install BIND DNS ServerBIND can be installed as follows: apt-get install bind9 dnsutils
16 Install Vlogger, Webalizer, And AWstatsVlogger, webalizer, and AWstats can be installed as follows: apt-get install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl Open /etc/cron.d/awstats afterwards... vi /etc/cron.d/awstats ... and comment out everything in that file:
17 Install JailkitJailkit is needed only if you want to chroot SSH users. It can be installed as follows (important: Jailkit must be installed before ISPConfig - it cannot be installed afterwards!): apt-get install build-essential autoconf automake1.9 libtool flex bison debhelper binutils-gold cd /tmp You can now install the Jailkit .deb package as follows: cd ..
18 Install fail2banThis 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
Then create the following two filter files: vi /etc/fail2ban/filter.d/pureftpd.conf
vi /etc/fail2ban/filter.d/dovecot-pop3imap.conf
Restart fail2ban afterwards: /etc/init.d/fail2ban restart
|
Recent comments
15 hours 10 min ago
1 day 8 hours ago
2 days 12 hours ago
2 days 17 hours ago
3 days 34 min ago
3 days 10 hours ago
3 days 15 hours ago
3 days 16 hours ago
4 days 1 hour ago
4 days 3 hours ago