Advertisement
Guest User

Centos 7 Nginx Perl perl-fcgi + OTRS

a guest
Oct 14th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.02 KB | None | 0 0
  1. #!/bin/bash
  2. # INSTALL : nginx, perl, perl-fcgi, mariadb, OTRS with configuration
  3. # Use chmod u+x otrs-install to make script executable
  4.  
  5. setenforce 0
  6. sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux
  7.  
  8. yum update
  9. yum -y install wget epel-release
  10. yum install -y http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
  11.  
  12. unalias cp
  13. adduser www-data
  14.  
  15. # Install PERL
  16.  
  17. 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
  18.  
  19. # Install NGINX, MARIADB
  20.  
  21. yum install nginx libfcgi-perl  mariadb-server -y
  22. 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
  23. systemctl enable --now spawn-fcgi
  24. yes | cp index.cgi /usr/share/nginx/html/index.cgi
  25. yes | cp index.pl /usr/share/nginx/html/index.pl
  26. setsebool -P httpd_can_network_connect on
  27.  
  28. systemctl enable --now nginx.service
  29. firewall-cmd --add-service=http --permanent
  30. firewall-cmd --add-service=https --permanent
  31. firewall-cmd --reload
  32.  
  33. yes | cp -rf my.cnf /etc/my.cnf
  34. yes | cp -rf default.conf /etc/nginx/conf.d/default.conf
  35. systemctl enable --now mariadb.service
  36. mysql_secure_installation <<EOF
  37.  
  38. y
  39. secret
  40. secret
  41. y
  42. y
  43. y
  44. y
  45. EOF
  46.  
  47. # Install OTRS
  48.  
  49. yum install -y http://ftp.otrs.org/pub/otrs//RPMS/rhel/7/otrs-6.0.23-01.noarch.rpm
  50.  
  51. # Install PERL-FCGI
  52.  
  53. wget http://nginxlibrary.com/downloads/perl-fcgi/fastcgi-wrapper -O /usr/bin/fastcgi-wrapper.pl
  54. wget http://nginxlibrary.com/downloads/perl-fcgi/perl-fcgi -O /etc/init.d/perl-fcgi
  55. chmod +x /usr/bin/fastcgi-wrapper.pl
  56. chmod +x /etc/init.d/perl-fcgi
  57. chkconfig perl-fcgi on
  58. systemctl enable --now perl-fcgi
  59.  
  60. # Finalize
  61.  
  62. /etc/init.d/nginx start
  63. /etc/init.d/perl-fcgi start
  64.  
  65. yes | cp otrs.data /etc/nginx/conf.d/otrs.data
  66. chmod o+rX -R /usr/share/nginx/html
  67. chmod o+rX -R /var/www
  68. chmod o+rwX -R /opt/otrs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement