+++ to secure your transactions use the Bitcoin Mixer Service +++

 

There is a new version of this tutorial available for Debian 9 (Stretch).

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!

 

1 Requirements

To install such a system you will need the following:

 

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):

Falko Timme

About Falko Timme

Falko Timme is an experienced Linux administrator and founder of Timme Hosting, a leading nginx business hosting company in Germany. He is one of the most active authors on HowtoForge since 2005 and one of the core developers of ISPConfig since 2000. He has also contributed to the O'Reilly book "Linux System Administration".

Share this page:

Suggested articles

20 Comment(s)

Add comment

Comments

By: Unit

Hi,

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? 

By: Kubek

Check your error.log in log/ directory of your site.

By:

Disable "Own Error-Documents"

By: Bulk sms gateway

Thank you for posting this info.

By: meth

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 :) 

 

By: Bradley Gillap

Why not munit in this guide? Is it apache only?

By: sidbyron

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.

By: newtesla

Please, abandon ntpdate in future: it has already created problems.

By: Muhamad Abdulkadir

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

 

By: Thomas

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

By: till

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.

By: Phuong

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

By: urgen sherpa

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 ;) ?

By: sklep.kiwi

nice, thanks :-) We used this tutorial in our bookstore.

By: Thomas

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

By: till

The command adds some required capabilities to the container. The command is not required or valid for LXC.

By: Wolfgang Schulz

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

By: till

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

By: james

Parfait--- Perfect

@raspberry hack!

Thanks for the time you take to create this guide!

By: Leon

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 :)..