There is a new version of this tutorial available for Debian 9 (Stretch).
This tutorial exists for these OS versions
- Debian 9 (Stretch)
- Debian 8 (Jessie)
- Debian 7 (Wheezy)
- Debian 6 (Squeeze)
On this page
The Perfect Server - Debian Wheezy (nginx, BIND, Dovecot, ISPConfig 3)
Version 1.0
Author: Falko Timme
Follow me on Twitter
This tutorial shows how to prepare a Debian Wheezy server (with nginx, BIND, Dovecot) for the installation of ISPConfig 3, and how to install ISPConfig 3. ISPConfig 3 is a webhosting control panel that allows you to configure the following services through a web browser: Apache or nginx web server, Postfix mail server, Courier or Dovecot IMAP/POP3 server, MySQL, BIND or MyDNS nameserver, PureFTPd, SpamAssassin, ClamAV, and many more. This setup covers nginx (instead of Apache), BIND (instead of MyDNS), and Dovecot (instead of Courier).
If you want to use nginx instead of Apache with ISPConfig, please note that your nginx version must be at least 0.8.21, and you must install PHP-FPM as well. For CGI/Perl support, you must use fcgiwrap. This is all covered by this tutorial.
Please note that you cannot use this tutorial for Debian Squeeze because Squeeze comes with an older nginx version (0.7.67.) and does not have a PHP-FPM package!
Please note that this setup does not work for ISPConfig 2! It is valid for ISPConfig 3 only!
I do not issue any guarantee that this will work for you!
ISPConfig 3 Manual
In order to learn how to use ISPConfig 3, I strongly recommend to download the ISPConfig 3 Manual.
On more than 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.
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/.
1 Requirements
To install such a system you will need the following:
- the Debian Wheezy network installation CD, available here: http://cdimage.debian.org/debian-cd/7.0.0/i386/iso-cd/debian-7.0.0-i386-netinst.iso (i386) or http://cdimage.debian.org/debian-cd/7.0.0/amd64/iso-cd/debian-7.0.0-amd64-netinst.iso (x86_64)
- a fast Internet connection.
2 Preliminary Note
In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100 and the gateway 192.168.0.1. These settings might differ for you, so you have to replace them where appropriate.
3 The Base System
Insert your Debian Wheezy network installation CD into your system and boot from it. Select Install (this will start the text installer - if you prefer a graphical installer, select Graphical install):
Choose your language:
Then select your location:
If you've selected an uncommon combination of language and location (like English as the language and Germany as the location, as in my case), the installer might tell you that there is no locale defined for this combination; in this case you have to select the locale manually. I select en_US.UTF-8 here:
Choose a keyboard layout:
The installer checks the installation CD, your hardware, and configures the network with DHCP if there is a DHCP server in the network:
Enter the hostname. In this example, my system is called server1.example.com, so I enter server1:
Enter your domain name. In this example, this is example.com:
Afterwards, give the root user a password:
Confirm that password to avoid typos:
Create a normal user account, for example the user Administrator with the user name administrator (don't use the user name admin as it is a reserved name on Debian Wheezy):
Sub pages
Suggested articles
20 Comment(s)
Comments
thank you for the tutorial. I just installed nginx & ISPConfig on my server, but I get an 500 Internal Error after uploading wordpress files and the .sql database in mysql.
I also tried to delete .htaccess, but it didn't help. The 500 Error appears on index, but I have no problem to access the admin backend of wordpress at domain/wp-admin...
Can someone please tell me what could fix it?
Check your error.log in log/ directory of your site.
Disable "Own Error-Documents"
Thank you for posting this info.
If you want to use it using vagrant or install everything in your own server using puppet you can try https://github.com/meth/puppet-ispconfig/
All contributions are welcomed :)
Why not munit in this guide? Is it apache only?
Hi,
This is the correct code for NGINX directives in Debian and ISPConfig.
First this is the code for http access without SSL:
#Configuration of phpMyAdmin
location /phpmyadmin/ {
root /var/www/apps;
index index.php index.html index.htm;
location ~ ^/(.+\.php)$ {
try_files $uri =404;
root /var/www/apps;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
location ~* ^/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /var/www/apps;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
#Finish configuration of phpMyAdmin
Second This is for phpmyadmin with SSL certificate:
#Configuration de phpMyAdmin
location /phpmyadmin/ {
root /var/www/apps;
index index.php index.html index.htm;
location ~ ^/(.+\.php)$ {
try_files $uri =404;
root /var/www/apps;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param HTTPS $https; # <-- add this line
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
}
location ~* ^/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /var/www/apps;
}
location ~* ^/{
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
#Finish Configuration phpMyAdmin
This configuration is for people that setup the phpmyadmin on directory /var/www/apps and want to get load for each site without create a new site.
Kind Regards.
Please, abandon ntpdate in future: it has already created problems.
Perfect tutorial, except that I found "502 Bad Gateway" when I opened http://server1.example.com:8081/webmail
To solve this problem, do this:
vi /etc/php5/fpm/pool.d/www.conf
and then change:
; listen.owner = www-data; listen.group = www-data
to:
listen.owner = www-datalisten.group = www-data
Hello and many thanks for your great tut(s)!
Just one question, don't know if I missed it: What's the servers names?
Mail: subdomain.domain.tld
Web: www.domain.tld
Thank you!
Thomas
The server name is the hostname of the server, in this tutorial we use server1.example.com. The hostname should always be a subdomain, so you should use e.g. server1.yorowndomain.tld
The website domain is the one that you enter when you create a website in ispconfig. this can be any domain or subdomain that points in dns to the IP address of this server. It is not related to the hostname.
My server: 8 CPU cores - 6 GB of RAM
I got too many 504 error.
Log looks like:
[error] 12753#0: *6193 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xxx.xxx.xxx.xxx
In nginx.conf
...
fastcgi_read_timeout 300;
...
Please help
My current debian wheezy ISPconfig3 have Apache2 server. Is it possible to change webserver to NGINX as webserver and remove apache2 without breaking down my server ;) ?
nice, thanks :-) We used this tutorial in our bookstore.
Hello!
Can you please explain what is changed to the container when executing the command as documented in "21 Additional Notes"?
Is this also valid for LXC?
If yes, what's the equivalent for LXC?
THX
The command adds some required capabilities to the container. The command is not required or valid for LXC.
Hi,
very good tutorial. I have an issue with installation of IonCube. I installed it, and wrote the "zend_extension" line in my php.ini. The php-Info show me the zend Extension Banner, but my page don't work: "Site error: the file ****/****/***/index.php requires the ionCube PHP Loader ioncube_loader_lin_5.6.so to be installed by the website operator. I restarted both nginx server and php-fpm a few times.
Anyone an idea how to make this working?
Sincerly
Debian has more than one php.ni. You have to add the line in the files /etc/php5/apache2/php.ini, /etc/php5/cgi/php.ini and /etc/php5/fpm/php.ini
Parfait--- Perfect
@raspberry hack!
Thanks for the time you take to create this guide!
one of the things that don't tell you in this tutorial, is that once you created a username for mysql, or ftp, to look very carefull, that could not be the same as the one added, eg: adding username test for mysql becomes c1test. Other than this small detail, I think the tutorial could be improved here and there... but it's a good tutorial non the less :)..