How to install ISPConfig 3 on your Debian VPS

How to install ISPConfig 3 on your Debian VPS

In this tutorial we will explain to you how to install ISPConfig 3, a free web hosting control panel on Debian VPS.

WHAT IS ISPCONFIG3?

ISPConfig 3 is an open source hosting control panel for Linux which is capable of managing multiple servers from one control panel. ISPConfig is licensed under the BSD license.

Single and Multiserver Management. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. It is very easy to use and comes with a bunch of features by default to allow you to host and manage your websites with ease on your VPS.

To start with the installation you will need to log in to your VPS as ROOT via SSH. Once you are in the first thing you need to do is to downloads the package lists from the repositories and “update” them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs. To do that just type:

apt-get update

The next step/command will actually update all the software on your VPS. So, type:

apt-get upgrade

In this tutorial we will use ispconfig.vpsineu.com domain name as an example. So, we will start by making sure that our hostname is configured correctly. Let’s assume that ispconfig.vpsineu.com is pointed to the 111.111.111.111 IP address, we need to verify that our hostname is setup correctly. To do that we should look at our hosts file:

nano /etc/hosts

and the file should look something as:

127.0.0.1           localhost localdomain  ispconfig.vpsineu.com

and since we want to make our domain name to use a public IP address we should modify the file so it should look like:

127.0.0.1           localhost
111.111.111.111     ispconfig.vpsineu.com

once it is done save and close the file.

The changes should be effective immediately, but just in case if for some reason they are not you can make the system to use the new changes with:

hostname -F /etc/hostname

Before starting with the setup the first thing we need to do is disable AppArmor, which is incompatible with ISPConfig. First, we should stop the service:

service apparmor stop

once it is stooped we will need to tell the system to not start the application at boot:

update-rc.d -f apparmor remove

We can also safely delete the whole application:

apt-get remove apparmor

Next, we will need to change the Debian default system shell from dash to bash because ISPConfig leverages additional functionality that is provided specifically by bash:

dpkg-reconfigure dash

and the following screen will appear:

How to install ISPConfig 3 on your Debian VPS

Make sure at the prompt to select “No” since you need to have the utility reconfigure the system shell pointer to use bash instead of dash.

Once we are done with the basic installation and our basic system is ready to go we can continue installing some of the services that ISPConfig can manage and some software that supports ISPConfig.

We will be installing basic LAMP (Linux, Apache, MySQL, PHP) components, mail software, anti-virus scanning software for our mail, and other packages.

To do this just follow this tutorial.

Or you can install everything with just one command:

 apt-get install apache2 mysql-server libapache2-mod-auth-mysql php5-mysql php5 php5-mysql php5-common php5-cli

Once everything is installed you can start with the tools and service configuration.

We will need to do some modification in postfix. To install Postfix please follow this tutorial.

Once the Postfix service is installed edit the file:

nano /etc/postfix/master.cf

If nano is not installed you can install it with:

apt-get install nano

Once the file is edited we will need to uncomment some of the lines:

submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
. . .
smtps     inet  n       -       -       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes

and we will also need to add some additional options at the bottom so at the end the file contents will look as:

submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       -       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING

Save the file and restart the postfix service:

service postfix restart

Next we will need to setup MySQL to listen on all interfaces, not just localhost. To do that edit:

nano /etc/mysql/my.cnf

and comment out the line

bind-address = 127.0.0.1:

so at the end the [mysqld] section in the my.cnf should look like:

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address           = 127.0.0.1

Restart the MySQL service for the changes to take effects:

service mysql restart

Now we will antivirus and anti spam protections. We will install amavisd-new, SpamAssassin, and ClamAV. To do that run:

apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl

Since ISPConfig 3 control panel uses amavisd to load SpamAssassin filter library, it is safe to stop the SpamAssassin service to free up some resources. To do that run:

service spamassassin stop 
update-rc.d -f spamassassin remove

We will also need to run and start clamav:

freshclam
service clamav-daemon start

INSTALL PHP5, PHPMYADMIN, FCGI, SUEXEC, PEAR, AND MCRYPT

apt-get install apache2 apache2-doc apache2-utils 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-python php5-curl php5-intl php5-memcache php5-memcached php5-ming php5-ps php5-pspell php5-recode php5-sqlite php5-tidy php5-xmlrpc php5-xsl memcached

During the installation we will see the following:

How to install ISPConfig 3 on your Debian VPS

Select “apache2” and press “OK” and on the next screen (see the picture beyond) select “No” and press “OK

How to install ISPConfig 3 on your Debian VPS

Once the installation is done you will need to enable the Apache modules: suexec, rewrite, ssl, actions, and include (plus dav, dav_fs, and auth_digest if you want to use WebDAV). To do that run:

a2enmod suexec rewrite ssl actions include cgi
a2enmod dav_fs dav auth_digest

Restart the Apache service for the changes to take effects:

service apache2 restart

INSTALLL MAILMAN

To install mailman just run:

apt-get install mailman

During the installation you will be asked to select any language, so select “English

How to install ISPConfig 3 on your Debian VPS

And on the next screen click “OK

How to install ISPConfig 3 on your Debian VPS

Now we can start mailman with a new list creation:

newlist mailman

You will need to enter an email address and a password which will be associated with the list. Once you enter them the script will produce a loon list of email aliases. You will need to add them to /etc/aliases

nano /etc/aliases

and add:

postmaster:     root
mailman:              "|/var/lib/mailman/mail/mailman post mailman"
mailman-admin:        "|/var/lib/mailman/mail/mailman admin mailman"
mailman-bounces:      "|/var/lib/mailman/mail/mailman bounces mailman"
mailman-confirm:      "|/var/lib/mailman/mail/mailman confirm mailman"
mailman-join:         "|/var/lib/mailman/mail/mailman join mailman"
mailman-leave:        "|/var/lib/mailman/mail/mailman leave mailman"
mailman-owner:        "|/var/lib/mailman/mail/mailman owner mailman"
mailman-request:      "|/var/lib/mailman/mail/mailman request mailman"
mailman-subscribe:    "|/var/lib/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe:  "|/var/lib/mailman/mail/mailman unsubscribe mailman"

Save and close the file. After that you will need to exec the newaliases command for the changes to take effects:

newaliases

Don’t forget to restart the mailman service for the changes to take effects:

service mailman start

We will also need to restart the postfix service:

service postfix restart

INSTALL PUREFTPD AND QUOTA

apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool

Once the installation is done we will need to edit the FTP’s server configuration:

nano /etc/default/pure-ftpd-common

and change VIRTUALCHROOT to true

VIRTUALCHROOT=true

and since we all know that FTP is by default unsecured we need to edit:

nano /etc/pure-ftpd/conf/TLS

and add:

1

after that save and close the file.

Now we will need to create a new self signed SSL:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem

once the creation is done we will need to lock the file:

chmod 600 /etc/ssl/private/pure-ftpd.pem

and again, restart the FTP service so the new changes can take effects:

service pure-ftpd-mysql restart

That’s it. Now we have FTP encryption.


Now we are finally ready to install the actual ISPConfig software. to start with the installation execute the following commands:

cd ~
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xzvf ISPConfig*
cd ispconfig3_install/install/
php -q install.php

Once the installation start you will be asked to select the control panel language.

How to install ISPConfig 3 on your Debian VPS

If you want to use English just press “ENTER


after that you will be asked to choose the installation method. It is always safe to choose “standard

How to install ISPConfig 3 on your Debian VPS

…so press “ENTER” again.


For the Full qualified hostname (FQDN) of the server, eg server1.domain.tld enter your VPS primary domain name (in our case that is ispconfig.vpsineu.com).

How to install ISPConfig 3 on your Debian VPS


and for the MySQL server hostname leave it as it is (localhost), so just press “ENTER” again

How to install ISPConfig 3 on your Debian VPS


For MySQL root username and password enter the root username and password that you put during the MySQL installation.

How to install ISPConfig 3 on your Debian VPS


and for “MySQL database to create” you can put any name you want. It is also safe to just press “ENTER” and use the default name:

How to install ISPConfig 3 on your Debian VPS


on the next screen for “MySQL charset [utf8]” press “ENTER” again

How to install ISPConfig 3 on your Debian VPS


Now the installation will start. As a first step a new self signed SSL will be created and you will be asked to enter a bunch of information. You can safely press “ENTER” on each one of them.

How to install ISPConfig 3 on your Debian VPS


For “ISPConfig Port [8080]:” you can also use the default one, so again, just press “ENTER

How to install ISPConfig 3 on your Debian VPS


and when you are asked “Do you want a secure (SSL) connection to the ISPConfig web interface” press “y

How to install ISPConfig 3 on your Debian VPS


after that a new self signed SSL will be created so again, just press “ENTER” on all the questions and the installation will continue:

How to install ISPConfig 3 on your Debian VPS


That’s it. Once the installation is done you can log in to your new control panel at:

https://your_ip_address:8080

The default username and password is admin:

username: admin
password: admin

How to install ISPConfig 3 on your Debian VPS


If you’re one of our Linux VPS Hosting customers we can help you install and configure ISPConfig 3 on your virtual server for you free of charge. Just contact us and some of our experts will complete your request immediately.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>