TASTE-OF-IT

ISPConfig unter Debian installieren

ISPConfig Logo

ISPConfig Logo

deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free

deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free

deb http://deb.debian.org/debian/ buster-updates main contrib non-free
deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free
# apt update & apt upgrade
# apt-get -y install postfix postfix-mysql postfix-doc mariadb-client mariadb-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd sudo curl
# mysql_secure_installation
Enter current password for root (enter for none):
Change the root password? [Y/n] <-- y
New password: <-- Enter a new MariaDB root password
Re-enter new password: <-- Repeat the MariaDB root password
Remove anonymous users? [Y/n] <-- y
Disallow root login remotely? [Y/n] <-- y
Remove test database and access to it? [Y/n] <-- y
Reload privilege tables now? [Y/n] <-- y
# nano /etc/postfix/master.cf
submission inet n - - - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject

smtps inet n - - - smtpd
-o syslog_name=postfix/smtps
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
# systemctl restart postfix
echo "update mysql.user set plugin = 'mysql_native_password' where user='root';" | mysql -u root
# nano /etc/mysql/debian.cnf

[client]
host = localhost
user = root
password = <MySQL-PW-hier>
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = root
password = >MySQL-PW-hier>
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
mysql soft nofile 65535
mysql hard nofile 65535
# mkdir -p /etc/systemd/system/mysql.service.d/
# nano /etc/systemd/system/mysql.service.d/limits.conf

[Service]
LimitNOFILE=infinity

Dienste neustarten:

# systemctl daemon-reload && systemctl restart mariadb
# netstat -tap | grep mysql
tcp 0 0 localhost:mysql 0.0.0.0:* LISTEN 26294/mysqld
# apt-get -y install amavisd-new spamassassin clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full unrar lrzip 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 libdbd-mysql-perl postgrey
# systemctl stop spamassassin && systemctl disable spamassassin
# apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php7.3 php7.3-common php7.3-gd php7.3-mysql php7.3-imap php7.3-cli php7.3-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear mcrypt  imagemagick libruby libapache2-mod-python php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl memcached php-memcache php-imagick php-gettext php7.3-zip php7.3-mbstring memcached libapache2-mod-passenger php7.3-soap php7.3-fpm php7.3-opcache php-apcu libapache2-reload-perl
# a2enmod suexec rewrite ssl actions include dav_fs dav auth_digest cgi headers actions proxy_fcgi alias
# nano /etc/apache2/conf-available/httpoxy.conf

<IfModule mod_headers.c>
    RequestHeader unset Proxy early
</IfModule>

# a2enconf httpoxy
# systemctl restart apache2
# curl https://get.acme.sh | sh -s
Good, bash is found, so change the shebang to use bash as preferred.
OK
Install success!
# apt-get -y install pure-ftpd-common pure-ftpd-mysql quota quotatool
# openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048

# nano /etc/default/pure-ftpd-common
STANDALONE_OR_INETD=standalone
VIRTUALCHROOT=true
# 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]: <-- Land eintragen z.B. DE
State or Province Name (full name) [Some-State]: <-- Bundesland eintragen
Locality Name (eg, city) []: <-- Stadt eintragen
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- Firmenname eintragen
Organizational Unit Name (eg, section) []: <-- Abteilung eintragen
Common Name (eg, YOUR name) []: <-- FQDN eintragen
Email Address []: <-- die Mailadresse des Systems eintragen

# chmod 600 /etc/ssl/private/pure-ftpd.pem
# systemctl restart pure-ftpd-mysql
# nano /etc/fstab
UUID=45576b38-39e8-4994-b8c1-ea4870e2e614 / ext4 errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0 1

# mount -o remount /
# quotacheck -avugm
# quotaon -avug
# apt-get -y install bind9 dnsutils
# apt install haveged
# apt-get install webalizer awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl
# nano /etc/cron.d/awstats

#MAILTO=root
#*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh

# Generate static reports:
#10 03 * * * www-data [ -x /usr/share/awstats/tools/buildstatic.sh ] && /usr/share/awstats/tools/buildstatic.sh
# apt-get -y install build-essential autoconf automake libtool flex bison debhelper binutils
# cd /tmp
# wget http://olivier.sessink.nl/jailkit/jailkit-2.20.tar.gz
# tar xvfz jailkit-2.20.tar.gz
# cd jailkit-2.20
# echo 5 > debian/compat./debian/rules binary
# cd ..
# dpkg -i jailkit_2.20-1_*.deb
# rm -rf jailkit-2.20*
# apt-get -y install fail2ban
# nano /etc/fail2ban/jail.local

[pure-ftpd]
enabled = true
port = ftp
filter = pure-ftpd
logpath = /var/log/syslog
maxretry = 3

[dovecot]
enabled = true
filter = dovecot
logpath = /var/log/mail.log
maxretry = 5

[postfix-sasl]
enabled = true
port = smtp
filter = postfix[mode=auth]
logpath = /var/log/mail.log
maxretry = 3
# systemctl restart fail2ban
# apt-get -y install ufw
# mkdir /usr/share/phpmyadmin
# mkdir /etc/phpmyadmin
# mkdir -p /var/lib/phpmyadmin/tmp
# chown -R www-data:www-data /var/lib/phpmyadmin
# touch /etc/phpmyadmin/htpasswd.setup

# cd /tmp
# wget https://files.phpmyadmin.net/phpMyAdmin/5.0.4/phpMyAdmin-5.0.4-all-languages.tar.gz

# tar xfz phpMyAdmin-5.0.4-all-languages.tar.gz
# mv phpMyAdmin-5.0.4-all-languages/* /usr/share/phpmyadmin/
# rm phpMyAdmin-5.0.4-all-languages.tar.gz
# rm -rf phpMyAdmin-5.0.4-all-languages
# cp /usr/share/phpmyadmin/config.sample.inc.php  /usr/share/phpmyadmin/config.inc.php

$cfg['blowfish_secret'] = 'bD3e6wva9fnd93jVsb7SDgeiBCd452Dh'; /* Eigenes BLOWFISH PW mit 32 Zeichen erstellen*/
# Zeile hinzufügen:
$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';
# nano /etc/apache2/conf-available/phpmyadmin.conf
# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
 Options FollowSymLinks
 DirectoryIndex index.php

 <IfModule mod_php7.c>
 AddType application/x-httpd-php .php

 php_flag magic_quotes_gpc Off
 php_flag track_vars On
 php_flag register_globals Off
 php_value include_path .
 </IfModule>

</Directory>

# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
 <IfModule mod_authn_file.c>
 AuthType Basic
 AuthName "phpMyAdmin Setup"
 AuthUserFile /etc/phpmyadmin/htpasswd.setup
 </IfModule>
 Require valid-user
</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
 Order Deny,Allow
 Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
 Order Deny,Allow
 Deny from All
</Directory>

# a2enconf phpmyadmin
# systemctl restart apache2
# mysql -u root -p

MariaDB [(none)]> CREATE DATABASE phpmyadmin;
MariaDB [(none)]> CREATE USER 'pma'@'localhost' IDENTIFIED BY 'DeinPassword';

MariaDB [(none)]> GRANT ALL PRIVILEGES ON phpmyadmin.* TO 'pma'@'localhost' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
# mysql -u root -p phpmyadmin < /usr/share/phpmyadmin/sql/create_tables.sql
# nano /usr/share/phpmyadmin/config.inc.php
# so anpassen:

/* User used to manipulate with storage */
$cfg['Servers'][$i]['controlhost'] = 'localhost';
$cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'PHPMyAdmin-Passwort';

/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
# echo "CREATE DATABASE roundcube;" | mysql --defaults-file=/etc/mysql/debian.cnf

# apt-get -y install roundcube roundcube-core roundcube-mysql roundcube-plugins
Configure database for roundcube with dbconfig.common? <-- yes
MySQL application password for roundcube: <-- press enter
# nano /etc/roundcube/config.inc.php

$config['default_host'] = 'localhost';
$config['smtp_server'] = 'localhost';
# nano /etc/apache2/conf-enabled/roundcube.conf

# direkt an den Anfang der Datei - darf nicht mail als Alias verwendet werden
Alias /roundcube /var/lib/roundcube
Alias /webmail /var/lib/roundcube

# systemctl reload apache2
# cd /tmp
# wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
# tar xfz ISPConfig-3-stable.tar.gz
# cd ispconfig3_install/install/

# php -q install.php

Select language (en,de) [en]: <-- Hit Enter
Installation mode (standard,expert) [standard]: <-- Hit Enter
Full qualified hostname (FQDN) of the server, eg websrv01.domain.tld [websrv01.example.com]: <-- Hit Enter
MySQL server hostname [localhost]: <-- Hit Enter
MySQL server port [3306]: <-- Hit Enter
MySQL root username [root]: <-- Hit Enter
MySQL root password []: <-- MySQL root Passwort
MySQL database to create [dbispconfig]: <-- Hit Enter
MySQL charset [utf8]: <-- Hit Enter
Configuring Postgrey
Configuring Postfix
Generating a 4096 bit RSA private key
.......................................................................++
........................................................................................................................................++
writing new private key to 'smtpd.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]: <-- Landercode DE
State or Province Name (full name) [Some-State]: <-- Bundesland
Locality Name (eg, city) []: <-- Stadtname
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- Firmenname
Organizational Unit Name (eg, section) []: <-- Abteilung
Common Name (e.g. server FQDN or YOUR name) []: <-- websrv01.domain.tld
Email Address []: <-- Hit Enter
Configuring Mailman
Configuring Dovecot
Configuring Spamassassin
Configuring Amavisd
Configuring Getmail
Configuring BIND
Configuring Jailkit
Configuring Pureftpd
Configuring Apache
Configuring vlogger
[INFO] service Metronome XMPP Server not detected
Configuring Ubuntu Firewall
Configuring Fail2ban
[INFO] service OpenVZ not detected
Configuring Apps vhost
Installing ISPConfig
ISPConfig Port [8080]:
Admin password [admin]: <-- Admin Passwort für ISPConfig Panel eingeben
Do you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]: <-- Hit Enter
Generating RSA private key, 4096 bit long modulus
.......................++
................................................................................................................................++
e is 65537 (0x10001)
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]: <-- 2 Zeichen für das Land DE
State or Province Name (full name) [Some-State]: <-- Bundesland
Locality Name (eg, city) []: <-- Stadtname
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- Firmenname
Organizational Unit Name (eg, section) []: <-- Hit Enter
Common Name (e.g. server FQDN or YOUR name) []: <-- websrv01.domain.tld
Email Address []: <-- Hit Enter
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: <-- Hit Enter
An optional company name []: <-- Hit Enter
writing RSA key

Configuring DBServer
Installing ISPConfig crontab
no crontab for root
no crontab for getmail
Detect IP addresses
Restarting services ...
Installation completed.

Thats it .. Have Fun

Die mobile Version verlassen