Bash scripting/ISPconfig install script: Difference between revisions
From Mana zināšanu grāmata
Jauna lapa: <div class="mw-parser-output"> </div> <div class="mw-parser-output"><div style="background:#eee;border:1px solid #ccc;padding:5px 10px;">#!/bin/bash<br/> ## Install ISPConfig 3.x... |
m 1 revision imported |
||
(No difference)
| |||
Latest revision as of 10:41, 16 April 2026
#!/bin/bash
## Install ISPConfig 3.x on CentOS 7 64Bits
## http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html
## https://www.howtoforge.com/tutorial/perfect-server-centos-7-2-apache-mysql-php-pureftpd-postfix-dovecot-and-ispconfig/2/
## http://nareshv.blogspot.com.br/2014/02/configure-hhvm-with-apache-fastcgi-on.html
## ISPConfig3 3.x + Apache2 + CentOS 7 64Bits
## VM HD 50GB, swap 2GB, / 19GB, /var/www all
## Filesystem ext4
## Run as root
## Install ISPConfig 3.x on CentOS 7 64Bits
## http://devdocs.magento.com/guides/v2.0/install-gde/prereq/php-centos.html
## https://www.howtoforge.com/tutorial/perfect-server-centos-7-2-apache-mysql-php-pureftpd-postfix-dovecot-and-ispconfig/2/
## http://nareshv.blogspot.com.br/2014/02/configure-hhvm-with-apache-fastcgi-on.html
## ISPConfig3 3.x + Apache2 + CentOS 7 64Bits
## VM HD 50GB, swap 2GB, / 19GB, /var/www all
## Filesystem ext4
## Run as root
yum -y install net-tools wget quota
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
## Reebot you server after command
sed -i 's|SELINUX=enforcing|SELINUX=disabled|' /etc/selinux/config
sed -i 's|SELINUX=enforcing|SELINUX=disabled|' /etc/selinux/config
cd /tmp/
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
yum -y install epel-release wget net-tools
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://centos7.iuscommunity.org/ius-release.rpm
rpm -Uvh ius-release*.rpm
yum -y update
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
yum -y install epel-release wget net-tools
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget https://centos7.iuscommunity.org/ius-release.rpm
rpm -Uvh ius-release*.rpm
yum -y update
yum -y groupinstall 'Development Tools'
## Packages Web Server
yum -y install httpd24u httpd24u-mod_ssl httpd24u-mod_proxy_html httpd24u-devel mariadb-server
yum -y install php56u php56u-mysql php56u-mbstring
yum -y install php56u php56u-devel php56u-gd php56u-imap php56u-ldap php56u-mysql php56u-odbc php56u-pear php56u-xml
yum -y install php56u-xmlrpc php56u-pecl-apc php56u-mbstring php56u-mcrypt php56u-mssql php56u-snmp php56u-soap
yum -y install curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel mod_fcgid php56u-cli
yum -y install php56u-fpm php56u-tidy curl pure-ftpd openssl bind bind-utils haveged ntp
yum -y install httpd24u httpd24u-mod_ssl httpd24u-mod_proxy_html httpd24u-devel mariadb-server
yum -y install php56u php56u-mysql php56u-mbstring
yum -y install php56u php56u-devel php56u-gd php56u-imap php56u-ldap php56u-mysql php56u-odbc php56u-pear php56u-xml
yum -y install php56u-xmlrpc php56u-pecl-apc php56u-mbstring php56u-mcrypt php56u-mssql php56u-snmp php56u-soap
yum -y install curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel mod_fcgid php56u-cli
yum -y install php56u-fpm php56u-tidy curl pure-ftpd openssl bind bind-utils haveged ntp
yum -y install awstats perl-DateTime-Format-HTTP perl-DateTime-Format-Builder
yum -y install libpng-devel gd-devel wget net-tools
yum -y install libpng-devel gd-devel wget net-tools
## Packages Mail Server
yum -y install dovecot dovecot-mysql dovecot-pigeonhole postfix getmail
yum -y install amavisd-new spamassassin clamav-server clamav-data clamav-update
yum -y install clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib
yum -y install clamav-server-systemd unzip bzip2 perl-DBD-mysql
yum -y install dovecot dovecot-mysql dovecot-pigeonhole postfix getmail
yum -y install amavisd-new spamassassin clamav-server clamav-data clamav-update
yum -y install clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib
yum -y install clamav-server-systemd unzip bzip2 perl-DBD-mysql
## Install HHVM 3.15.3
wget http://mirrors.linuxeye.com/hhvm-repo/7/x86_64/hhvm-3.15.3-1.el7.centos.x86_64.rpm
yum -y install hhvm-3.15.3-1.el7.centos.x86_64.rpm
ln -s /usr/local/bin/hhvm /usr/bin/hhvm
wget http://mirrors.linuxeye.com/hhvm-repo/7/x86_64/hhvm-3.15.3-1.el7.centos.x86_64.rpm
yum -y install hhvm-3.15.3-1.el7.centos.x86_64.rpm
ln -s /usr/local/bin/hhvm /usr/bin/hhvm
### Compile mod_fastcgi from github
cd /tmp/
wget https://github.com/klutometis/mod_fastcgi/archive/master.zip
unzip master.zip
cd mod_fastcgi-master
cp Makefile.AP2 Makefile
sed -i 's|/usr/local/apache2|/usr/lib64/httpd|' Makefile
make && make install
cd /tmp/
wget https://github.com/klutometis/mod_fastcgi/archive/master.zip
unzip master.zip
cd mod_fastcgi-master
cp Makefile.AP2 Makefile
sed -i 's|/usr/local/apache2|/usr/lib64/httpd|' Makefile
make && make install
echo "LoadModule fastcgi_module modules/mod_fastcgi.so" > /etc/httpd/conf.d/fastcgi.conf
echo 'RequestHeader unset Proxy early' > /etc/httpd/conf.d/httpoxy.conf
echo 'RequestHeader unset Proxy early' > /etc/httpd/conf.d/httpoxy.conf
cd /tmp
wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.23-08-src.tgz
tar xvfz webalizer-2.23-08-src.tgz
cd webalizer-2.23-08 && ./configure
make && make install
wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.23-08-src.tgz
tar xvfz webalizer-2.23-08-src.tgz
cd webalizer-2.23-08 && ./configure
make && make install
sed -i 's|;cgi.fix_pathinfo=1|cgi.fix_pathinfo=1|' /etc/php.ini
sed -i "s|;date.timezone =|date.timezone = 'America\/Sao_Paulo'|" /etc/php.ini
sed -i 's|Example|#Example|' /etc/freshclam.conf
sed -i "s|;date.timezone =|date.timezone = 'America\/Sao_Paulo'|" /etc/php.ini
sed -i 's|Example|#Example|' /etc/freshclam.conf
touch /etc/dovecot/dovecot-sql.conf
ln -s /etc/dovecot/dovecot-sql.conf /etc/dovecot-sql.conf
ln -s /etc/dovecot/dovecot-sql.conf /etc/dovecot-sql.conf
mkdir -p /etc/ssl/private/
openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
chmod 600 /etc/ssl/private/pure-ftpd.pem
openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
chmod 600 /etc/ssl/private/pure-ftpd.pem
cp /etc/named.conf /etc/named.conf_bak
touch /etc/named.conf.local
touch /etc/named.conf.local
echo '//
// named.conf
// named.conf
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
allow-recursion {"none";};
recursion no;
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.conf.local";' > /etc/named.conf
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
allow-recursion {"none";};
recursion no;
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.conf.local";' > /etc/named.conf
sa-update -D
freshclam
freshclam
systemctl enable amavisd.service
systemctl start amavisd.service
systemctl start clamd@amavisd.service
systemctl start amavisd.service
systemctl start clamd@amavisd.service
systemctl enable mariadb.service
systemctl start mariadb.service
systemctl start mariadb.service
systemctl stop sendmail.service
systemctl disable sendmail.service
systemctl enable postfix.service
systemctl restart postfix.service
systemctl disable sendmail.service
systemctl enable postfix.service
systemctl restart postfix.service
systemctl start php-fpm.service
systemctl enable php-fpm.service
systemctl enable httpd.service
systemctl enable php-fpm.service
systemctl enable httpd.service
systemctl enable dovecot
systemctl start dovecot
systemctl start dovecot
systemctl enable named.service
systemctl start named.service
systemctl start named.service
systemctl restart httpd.service
## Set passwords for the MySQL root account
mysql_secure_installation
mysql_secure_installation
## Download ISPConfig 3.1.X
cd /tmp
get_isp=https://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
wget -c ${get_isp}
tar xvfz $(basename ${get_isp})
cd ispconfig3_install/install && php -q install.php
cd /tmp
get_isp=https://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
wget -c ${get_isp}
tar xvfz $(basename ${get_isp})
cd ispconfig3_install/install && php -q install.php
