Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # INSTALL : nginx, perl, perl-fcgi, mariadb, OTRS with configuration
- # Use chmod u+x otrs-install to make script executable
- setenforce 0
- sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux
- yum update
- yum -y install wget epel-release
- yum install -y http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
- unalias cp
- adduser www-data
- # Install PERL
- yum install "perl(Crypt::Eksblowfish::Bcrypt)" "perl(DBD::Pg)" "perl(Encode::HanExtra)" "perl(JSON::XS)" "perl(Mail::IMAPClient)" "perl(Authen::NTLM)" "perl(ModPerl::Util)" "perl(Text::CSV_XS)" "perl(YAML::XS)" -y
- # Install NGINX, MARIADB
- yum install nginx libfcgi-perl mariadb-server -y
- echo 'OPTIONS="-u nginx -g nginx -a 127.0.0.1 -p 9001 -P /var/run/spawn-fcgi.pid -- /usr/sbin/fcgiwrap"' >> /etc/sysconfig/spawn-fcgi
- systemctl enable --now spawn-fcgi
- yes | cp index.cgi /usr/share/nginx/html/index.cgi
- yes | cp index.pl /usr/share/nginx/html/index.pl
- setsebool -P httpd_can_network_connect on
- systemctl enable --now nginx.service
- firewall-cmd --add-service=http --permanent
- firewall-cmd --add-service=https --permanent
- firewall-cmd --reload
- yes | cp -rf my.cnf /etc/my.cnf
- yes | cp -rf default.conf /etc/nginx/conf.d/default.conf
- systemctl enable --now mariadb.service
- mysql_secure_installation <<EOF
- y
- secret
- secret
- y
- y
- y
- y
- EOF
- # Install OTRS
- yum install -y http://ftp.otrs.org/pub/otrs//RPMS/rhel/7/otrs-6.0.23-01.noarch.rpm
- # Install PERL-FCGI
- wget http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper -O /usr/bin/fastcgi-wrapper.pl
- wget http://nginxlibrary.com/downloads/perl-fcgi/perl-fcgi -O /etc/init.d/perl-fcgi
- chmod +x /usr/bin/fastcgi-wrapper.pl
- chmod +x /etc/init.d/perl-fcgi
- chkconfig perl-fcgi on
- systemctl enable --now perl-fcgi
- # Finalize
- /etc/init.d/nginx start
- /etc/init.d/perl-fcgi start
- yes | cp otrs.data /etc/nginx/conf.d/otrs.data
- chmod o+rX -R /usr/share/nginx/html
- chmod o+rX -R /var/www
- chmod o+rwX -R /opt/otrs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement