nano /etc/iptables.up.rules
*nat :PREROUTING ACCEPT [2164:136969] :POSTROUTING ACCEPT [58:3659] :OUTPUT ACCEPT [0:0] # Nat -A POSTROUTING -o vmbr0 -j MASQUERADE # ISPConfig Web Panel -A PREROUTING -d *.*.*182/32 -p tcp -m tcp --dport 8080 -j DNAT --to-destination 192.168.8.3:8080 -A PREROUTING -d *.*.*.182/32 -p tcp -m tcp --dport 8081 -j DNAT --to-destination 192.168.8.3:8081 # app01. ssh server -A PREROUTING -d *.*.*.182/32 -p tcp -m tcp --dport 22 -j DNAT --to-destination 192.168.8.4:22 COMMIT
nano /etc/ssh/sshd_config
Port 2222
nano /etc/hosts
192.168.8.1 gw.local 192.168.8.2 front01.local 192.168.8.3 isp.local 192.168.8.4 app01.local 192.168.8.5 db01.local
ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime
yum install wget nano wget ntpdate -y
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm rm *.rpm -f
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt cd /tmp wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm && rpm -ivh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
sed -i 's/enabled = 1/enabled = 0/g' /etc/yum.repos.d/rpmforge.repo
wget -q -O - http://www.atomicorp.com/installers/atomic | sh
yum install nano mc screen sudo nscd htop ntp zip unzip pigz iotop sysstat lsof strace atop multitail -y yum --enablerepo=rpmforge install htop -y
yum remove -y sendmail httpd sshd samba bind openssh -y
yum update -y
yum remove mysql* mysql-*
yum install mariadb-server mariadb-devel mariadb-client -y
yum install -y cronie cronie-anacron crontabs sysstat -y
/etc/init.d/crond start && chkconfig crond on
nano /etc/my.cnf
[mysqld] skip-name-resolve default_storage_engine=InnoDB innodb_file_per_table = 1 # network connect_timeout = 60 wait_timeout = 28800 max_connections = 200 max_allowed_packet = 512M max_connect_errors = 1000 # performance query_cache_size = 32M tmp_table_size = 32M max_heap_table_size = 32M thread_cache_size = 16 table_open_cache = 600 innodb_flush_log_at_trx_commit = 2 innodb_flush_method = O_DIRECT transaction-isolation = READ-COMMITTED log_error = /var/log/mysql/mysql-error.log #slow_query_log_file = /var/log/mysql/mysql-slow.log
chkconfig --levels 235 mysqld on && /etc/init.d/mysqld start
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 BOOTPROTO=static ONBOOT=yes IPADDR=xxx237 NETMASK=255.255.255.0 GATEWAY=xxx1
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.8.1 NETWORK=192.168.8.0
/etc/init.d/iptables save
vi /etc/sysconfig/iptables
-A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.8.2:80 -A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 443 -j DNAT --to-destination 192.168.8.2:443 -A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 25 -j DNAT --to-destination 192.168.8.5:25 -A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 110 -j DNAT --to-destination 192.168.8.5:110 -A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 145 -j DNAT --to-destination 192.168.8.5:145 -A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 995 -j DNAT --to-destination 192.168.8.5:995 -A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 465 -j DNAT --to-destination 192.168.8.5:465 -A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 587 -j DNAT --to-destination 192.168.8.5:587 -A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 143 -j DNAT --to-destination 192.168.8.5:143 -A PREROUTING -d *.*.*.237/32 -p tcp -m tcp --dport 993 -j DNAT --to-destination 192.168.8.5:993 -A POSTROUTING -o eth0 -j MASQUERADE
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf sysctl -p
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.8.2 NETWORK=192.168.8.0 GATEWAY=192.168.8.1
/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.8.3 NETWORK=192.168.8.0 GATEWAY=192.168.8.100
yum install php-mysql php nginx php-fpm postfix patch -y
rm -f /etc/nginx/conf.d/default.conf rm -f /etc/nginx/conf.d/virtual.conf rm -f /etc/nginx/conf.d/ssl.conf
chkconfig --levels 235 php-fpm on && /etc/init.d/php-fpm start chkconfig --levels 235 nginx on && /etc/init.d/nginx start
mysql
CREATE USER 'root'@'192.168.8.%' IDENTIFIED BY 'c2HZqsMmiBKa'; GRANT ALL PRIVILEGES ON * . * TO 'root'@'192.168.8.%' IDENTIFIED BY 'c2HZqsMmiBKa' WITH GRANT OPTION; flush privileges;
yum install phpmyadmin -y
ln -s /usr/share/phpMyAdmin/ /usr/share/phpmyadmin
nano /etc/phpMyAdmin/config.inc.php
$cfg['blowfish_secret'] = '46a30e4ed1cf83.14522379'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ $cfg['Servers'][$i]['host'] = 'db01.local'; // MySQL hostname or IP address $cfg['Servers'][$i]['port'] = '3306'; // MySQL port - leave blank for default port $cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?
cd /usr/src/ 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
>> Initial configuration
Operating System: Redhat or compatible, unknown version.
If so, be careful.
Default values are in [brackets] and can be accepted with.
Tap in "quit" (without the quotes) to stop the installer.
Select language (en, de) [ en ]:
Installation mode (standard, expert) [standard]: expert
Full qualified hostname (FQDN) of the server, eg server1.domain.tld [ isp.local ]:
MySQL server hostname [ localhost ]:
MySQL root username [ root ]:
MySQL root password []:
MySQL database to create [ dbispconfig ]:
MySQL charset [ utf8 ]:
The next two questions are about the internal ISPConfig database user and password.
It is recommended to accept the defaults which are 'ispconfig' as username and random password.
If you use the password
ISPConfig mysql database username [ ispconfig ]:
ISPConfig mysql database password [ 1850fcffe2fc0b1ca2707c3e27c5eec4 ]:
Shall this server join an existing ISPConfig multiserver setup (y, n) [ n ]:
Apache and nginx detected. Select server to use for ISPConfig: (apache, nginx) [apache]: nginx
Adding ISPConfig server record to database.
Configure Mail (y, n) [y]: n
Configure Jailkit (y, n) [y]: n
Configure FTP Server (y, n) [y]: y
Configuring Pureftpd
Configure DNS Server (y, n) [y]: n
Hint: If this is the ISPConfig interface, select the 'y' in the 'Configure nginx Server' option.
Configure nginx Server (y, n) [y]: y
Configuring nginx
Configuring Apps vhost
Configure Firewall Server (y, n) [y]: y
Configuring Bastille Firewall
Install ISPConfig Web Interface (y, n) [y]: y
Installing ISPConfig
ISPConfig Port [ 8080 ]:
Enable SSL for the ISPConfig web interface (y, n) [y]: y
Generating RSA private key, 4096 bit long modulus
.................................................. .............. ++
.................................................. .................................................. ................... ++
e is 65537 (0x10001)
You are included
into your certificate request.
What is a Distinguished Name or a DN?
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) [XX]: Ru
State or Province Name (full name) []: Moscow
Locality Name (eg, city) [Default City]: Moscow
Organization Name (eg, company) [Default Company Ltd]: isp.local
Organizational Unit Name (eg, section) []: IT
Common Name (eg, your server or your server’s hostname) []: isp.local
Email Address []:
Please enter the following extra attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
writing RSA key
Configuring DBServer
Installing ISPConfig crontab
no crontab for root
Reloading php-fpm: [OK]
Reloading nginx: [OK]
Installation completed.
https://__ip:8080/
cd /usr/local/ispconfig/server/scripts wget http://www.ispconfig.org/downloads/ispconfig_patch chmod 700 ispconfig_patch chown root:root ispconfig_patch ln -s /usr/local/ispconfig/server/scripts/ispconfig_patch /usr/local/bin/ispconfig_patch
Patches for ISPConfig 3.0.5.3
Patch ID: 3053_langedit
Date: 2013-09-25
Description: This patch solves a UTF-8 encoding issue in the language file editor.
Patch ID: 3053_langimport
Description: This patch adds a language to the language file importer.
Patch ID: 3053_backupdownload
Description: This is a patch backups website.
Patch ID: 3053_apsdelete
Description: deletes APS instances.
Patch ID: 3053_ftpuser
Description: This patch fixes FS # 3089 - FTP User Options - ERROR You have no permission for this domain.
Patch ID: 3053_phpversion
Description for your website. Php select user interface is “default”.
Patch ID: 3053_sysini
Description: This patch fixes FS # 3086 - SQL query warning about sys_ini access in multiserver setups.
Patch ID: 3053_dashboard
Description: This patch fixes on the dashboard.
nano /etc/nginx/sites-enabled/000-ispconfig.vhost
location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/lib/php5-fpm/ispconfig.sock; fastcgi_param HTTPS on; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $request_filename; } location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; } } location /phpMyAdmin { rewrite ^/* /phpmyadmin last; }
/etc/init.d/nginx reload
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.8.4 NETWORK=192.168.8.0 GATEWAY=192.168.8.100
yum install mod_rpaf memcached ntp httpd php php-mysql php-mbstring php-mcrypt rpm-build openssl-devel cyrus-sasl-devel pkgconfig zlib-devel pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel openldap-servers libtool gdbm-devel pam-devel gamin-devel mod_ssl php-fpm php-cli php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-pecl-apc php-magpierss php-snmp php-tidy spawn-fcgi openssl perl-TimeDate httpd-devel ruby ruby-devel webalizer perl-DateTime-Format-HTTP perl-DateTime-Format-Builder perl-TimeDate libevent-devel php-pecl-memcache mod_fcgid subversion git php-soap -y yum install --enablerepo=rpmforge mod_fastcgi mod_suphp -y
chkconfig --levels 235 php-fpm on && /etc/init.d/php-fpm start chkconfig --levels 235 httpd on && /etc/init.d/httpd start chkconfig --levels 235 memcached on && /etc/init.d/memcached start
yum groupinstall 'Development Tools' -y
sed -i "s/^error_reporting =.*/error_reporting = E_ALL \& \~E_NOTICE/g" /etc/php.ini sed -i "s/^;cgi.fix_pathinfo =.*/cgi.fix_pathinfo = 1/g" /etc/php.ini sed -i "s/^;date.timezone =.*/date.timezone = Europe\/Moscow/g" /etc/php.ini sed -i "s/^max_execution_time =.*/max_execution_time = 600/g" /etc/php.ini sed -i "s/^max_input_time =.*/max_input_time = 600/g" /etc/php.ini sed -i "s/^memory_limit =.*/memory_limit = 512M/g" /etc/php.ini sed -i "s/^post_max_size =.*/post_max_size = 500M/g" /etc/php.ini sed -i "s/^upload_max_filesize =.*/upload_max_filesize = 2000M/g" /etc/php.ini sed -i "s/^max_file_uploads =.*/max_file_uploads = 200/g" /etc/php.ini sed -i "s/^short_open_tag =.*/short_open_tag = On/g" /etc/php.ini sed -i "s/^upload_max_filesize =.*/upload_max_filesize = 500M/g" /etc/php.ini sed -i "s/;realpath_cache_size =.*/realpath_cache_size = 4096k/g" /etc/php.ini
yum install php-devel php-pear pecl install Xdebug
nano /etc/php.d/xdebug.ini
[xdebug] zend_extension="/usr/lib64/php/modules/xdebug.so" xdebug.remote_enable = 1
php -v
No log handling enabled - turning on stderr logging Created directory: /var/lib/net-snmp/mib_indexes PHP 5.4.24 (cli) (built: Jan 13 2014 12:36:47) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Retha
cd /usr/src/ && wget wget http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz tar xzvf ZendGuardLoader-7* -C /usr/local/ chmod -R 755 /usr/local/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/ mv /usr/local/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/ /usr/local/Zend
nano /etc/php.d/zend.ini
zend_extension=/usr/local/Zend/php-5.4.x/ZendGuardLoader.so
php -v
PHP 5.4.24 (cli) (built: Jan 13 2014 12:36:47) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies
sed -i "s/^apc.enabled=.*/apc.enabled=1/g" /etc/php.d/apc.ini sed -i "s/^apc.shm_size=.*/apc.shm_size=256M/g" /etc/php.d/apc.ini sed -i "s/;apc.num_files_hint=.*/apc.num_files_hint=20000/g" /etc/php.d/apc.ini sed -i "s/;apc.user_entries_hint=.*/apc.user_entries_hint=20000/g" /etc/php.d/apc.ini sed -i "s/;apc.ttl=.*/apc.ttl=86400/g" /etc/php.d/apc.ini sed -i "s/;apc.user_ttl=.*/apc.user_ttl=7200/g" /etc/php.d/apc.ini sed -i "s/;apc.gc_ttl=.*/apc.gc_ttl=86400/g" /etc/php.d/apc.ini sed -i "s/;apc.cache_by_default=.*/apc.cache_by_default=1/g" /etc/php.d/apc.ini sed -i "s/;apc.max_file_size=.*/apc.max_file_size=10M/g" /etc/php.d/apc.ini
mkdir -p /root/backup/etc mv /etc/httpd/conf.d/suphp.conf /root/backup/ && nano /etc/httpd/conf.d/suphp.conf
LoadModule suphp_module modules/mod_suphp.so suPHP_Engine on suPHP_ConfigPath /etc/suphp.conf
mv /etc/suphp.conf /root/backup/etcsuphp.conf && nano /etc/suphp.conf
[global] ;Path to logfile logfile=/var/log/httpd/suphp.log ;Loglevel loglevel=info ;User Apache is running as webserver_user=apache ;Path all scripts have to be in docroot=/ ;Path to chroot() to before executing script ;chroot=/mychroot ; Security options allow_file_group_writeable=true allow_file_others_writeable=false allow_directory_group_writeable=true allow_directory_others_writeable=false ;Check wheter script is within DOCUMENT_ROOT check_vhost_docroot=true ;Send minor error messages to browser errors_to_browser=false ;PATH environment variable env_path=/bin:/usr/bin ;Umask to set, specify in octal notation umask=0077 ; Minimum UID min_uid=100 ; Minimum GID min_gid=100 [handlers] ;Handler for php-scripts x-httpd-suphp="php:/usr/bin/php-cgi" ;Handler for CGI-scripts x-suphp-cgi="execute:!self"
nano /etc/httpd/conf.d/mod_rpaf.conf
<IfModule mod_rpaf.c> RPAF_Enable On RPAF_ProxyIPs 127.0.0.1 192.168.8.2 *.*.*.237 RPAF_Header X-Forwarded-For RPAF_SetHostName On RPAF_SetHTTPS On RPAF_SetPort On </IfModule>
nano /etc/httpd/conf.d/fastcgi.conf
sed -i "s/^FastCgiWrapper .*/FastCgiWrapper Off/g" /etc/httpd/conf.d/fastcgi.conf
cd /usr/src/ 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
>> Initial configuration
Operating System: Redhat or compatible, unknown version.
If so, be careful.
Default values are in [brackets] and can be accepted with.
Tap in "quit" (without the quotes) to stop the installer.
Select language (en, de) [ en ]:
Installation mode (standard, expert) [standard]: expert
Full qualified hostname (FQDN) of the server, eg server1.domain.tld [ app01.local ]:
MySQL server hostname [ localhost ]:
MySQL root username [ root ]:
MySQL root password []:
MySQL database to create [ dbispconfig ]:
MySQL charset [ utf8 ]:
The next two questions are about the internal ISPConfig database user and password.
It is recommended to accept the defaults which are 'ispconfig' as username and random password.
If you use the password
ISPConfig mysql database username [ ispconfig ]:
ISPConfig mysql database password [ 8b8295ae2a50a39a1a00da65df0bee72 ]:
Shall this server join an existing ISPConfig multiserver setup (y, n) [n]: y
MySQL master server hostname []: isp.local
MySQL master server root username [ root ]:
MySQL master server root password []: c2HZqsMmiBKa
MySQL master server database name [ dbispconfig ]:
Adding ISPConfig server record to database.
Configure Mail (y, n) [y]: n
Configure Jailkit (y, n) [y]: n
Configure FTP Server (y, n) [y]: y
Configuring Pureftpd
Stopping pure-ftpd: [OK]
Starting pure-ftpd: [OK]
Configure DNS Server (y, n) [y]: n
Hint: If this is the ISPConfig interface, select the 'y' in the 'Configure Apache Server' option.
Configure Apache Server (y, n) [y]: y
Configuring apache
Configuring Vlogger
Configuring Apps vhost
Configure Firewall Server (y, n) [y]: y
Configuring Bastille Firewall
Install ISPConfig Web Interface (y, n) [n]: n
Configuring DBServer
Installing ISPConfig crontab
no crontab for root
Stopping httpd: [OK]
[Thu Jan 23 13:46:44 2014] [warn] NameVirtualHost *: 80 has no VirtualHosts
[Thu Jan 23 13:46:44 2014] [warn] NameVirtualHost *: 443 has no VirtualHosts
[Thu Jan 23 13:46:44 2014] [warn] NameVirtualHost *: 80 has no VirtualHosts
Starting httpd: [OK]
Installation completed.
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.8.5 NETWORK=192.168.8.0 GATEWAY=192.168.8.100
yum install php-mysql php -y
chkconfig httpd off && /etc/init.d/httpd stop
cd /usr/src/ 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
>> Initial configuration
Operating System: Redhat or compatible, unknown version.
If so, be careful.
Default values are in [brackets] and can be accepted with.
Tap in "quit" (without the quotes) to stop the installer.
Select language (en, de) [en]: en
Installation mode (standard, expert) [standard]: expert
Full qualified hostname (FQDN) of the server, eg server1.domain.tld [ db01.local ]:
MySQL server hostname [ localhost ]:
MySQL root username [ root ]:
MySQL root password []:
MySQL database to create [ dbispconfig ]:
MySQL charset [ utf8 ]:
The next two questions are about the internal ISPConfig database user and password.
It is recommended to accept the defaults which are 'ispconfig' as username and random password.
If you use the password
ISPConfig mysql database username [ ispconfig ]:
ISPConfig mysql database password [ 06cd6c11370b50a83eb0a3d3907a3581 ]:
Shall this server join an existing ISPConfig multiserver setup (y, n) [n]: y
MySQL master server hostname []: isp.local
MySQL master server root username [ root ]:
MySQL master server root password []: c2HZqsMmiBKa
MySQL master server database name [ dbispconfig ]:
Adding ISPConfig server record to database.
Configure Mail (y, n) [y]: n
Configure Jailkit (y, n) [y]: n
Configure FTP Server (y, n) [y]: n
Configure DNS Server (y, n) [y]: n
Hint: If this is the ISPConfig interface, select the 'y' in the 'Configure Apache Server' option.
Configure Apache Server (y, n) [y]: n
Configure Firewall Server (y, n) [y]: y
Configuring Bastille Firewall
Install ISPConfig Web Interface (y, n) [n]: n
Configuring DBServer
Installing ISPConfig crontab
no crontab for root
Stopping httpd: [FAILED]
Starting httpd: [OK]
Installation completed.
tail -f -n 1000 /var/log/ispconfig/ispconfig.log
<?php // , INFO_ALL phpinfo(); // . // phpinfo(8) . phpinfo(INFO_MODULES); ?>
Source: https://habr.com/ru/post/209934/