Carga inicial
This commit is contained in:
99
utils/cloud-init-sei.yaml
Normal file
99
utils/cloud-init-sei.yaml
Normal file
@@ -0,0 +1,99 @@
|
||||
#cloud-config
|
||||
|
||||
yum_repos:
|
||||
epel:
|
||||
name: Extra Packages for Enterprise Linux
|
||||
baseurl: https://yum$ociregion.$ocidomain/repo/OracleLinux/OL9/developer/EPEL/$basearch/
|
||||
enabled: true
|
||||
gpgcheck: true
|
||||
|
||||
timezone: America/Sao_Paulo
|
||||
|
||||
package_update: true
|
||||
package_upgrade: true
|
||||
|
||||
write_files:
|
||||
- path: /tmp/robots.txt
|
||||
owner: 'root:root'
|
||||
permissions: '0644'
|
||||
defer: true
|
||||
content: |
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
|
||||
- path: /tmp/sei.conf
|
||||
owner: 'root:root'
|
||||
permissions: '0644'
|
||||
defer: true
|
||||
content: |
|
||||
Alias "/infra_css" "/opt/infra/infra_css"
|
||||
Alias "/infra_js" "/opt/infra/infra_js"
|
||||
<Directory />
|
||||
AllowOverride None
|
||||
Require all denied
|
||||
</Directory>
|
||||
<Directory ~ "(/opt/sei/web|/opt/infra/infra_css|/opt/infra/infra_js)">
|
||||
AllowOverride None
|
||||
Options None
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
runcmd:
|
||||
- sudo systemctl disable firewalld.service --now
|
||||
- sudo setenforce 0
|
||||
- sudo dnf install httpd mod_ssl @php:8.2 php-bcmath.x86_64 php-gd.x86_64 php-soap.x86_64 php-pecl-zip.x86_64 php-pear gcc curl-devel php-devel zlib-devel pcre-devel php-intl.x86_64 java-1.8.0-openjdk php-opcache.x86_64 glibc-langpack-pt langpacks-pt php-mysqlnd.x86_64 -y
|
||||
- sudo pecl install igbinary memcache uploadprogress
|
||||
- echo "extension=memcache" | sudo tee -a /etc/php.d/20-memcache.ini
|
||||
- echo "extension=igbinary" | sudo tee -a /etc/php.d/20-igbinary.ini
|
||||
- echo "extension=uploadprogress" | sudo tee -a /etc/php.d/20-uploadprogress.ini
|
||||
- sudo sed -i '124c\DocumentRoot "/opt/sei/web"' /etc/httpd/conf/httpd.conf
|
||||
- sudo sed -i '136c\<Directory "/opt/sei/web">' /etc/httpd/conf/httpd.conf
|
||||
- sudo dnf install -y https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.almalinux9.x86_64.rpm
|
||||
- sudo ln -sf /usr/local/bin/wkhtmltopdf /usr/bin/
|
||||
- sudo localectl set-locale LANG=pt_BR.ISO-8859-1
|
||||
- sudo sed -i '1342c\session.gc_maxlifetime = 28800' /etc/php.ini
|
||||
- sudo sed -i '198c\short_open_tag = On' /etc/php.ini
|
||||
- sudo sed -i '426c\max_input_vars = 1000' /etc/php.ini
|
||||
- sudo sed -i '561c\html_errors = off' /etc/php.ini
|
||||
- sudo sed -i '703c\post_max_size = 201M' /etc/php.ini
|
||||
- sudo sed -i '855c\upload_max_filesize = 200M' /etc/php.ini
|
||||
- sudo sed -i '1276c\session.cookie_secure = 1' /etc/php.ini
|
||||
- sudo sed -i '722c\default_charset = "ISO-8859-1"' /etc/php.ini
|
||||
- sudo sed -i '47c\Listen 0.0.0.0:80' /etc/httpd/conf/httpd.conf
|
||||
- sudo sed -i '115c\pm.max_children = 92' /etc/php-fpm.d/www.conf
|
||||
- sudo sed -i '120c\pm.start_servers = 8' /etc/php-fpm.d/www.conf
|
||||
- sudo sed -i '125c\pm.min_spare_servers = 4' /etc/php-fpm.d/www.conf
|
||||
- sudo sed -i '130c\pm.max_spare_servers = 35' /etc/php-fpm.d/www.conf
|
||||
- sudo sed -i '141c\pm.max_requests = 500' /etc/php-fpm.d/www.conf
|
||||
- sudo sed -i '745c\include_path = "/opt/infra/infra_php"' /etc/php.ini
|
||||
- sudo sed -i '22c\SELINUX=disabled' /etc/selinux/config
|
||||
- sudo sed -i "11c\opcache.opcache.memory_consumption=256" /etc/php.d/10-opcache.ini
|
||||
- sudo sed -i "14c\opcache.opcache.interned_strings_buffer=16" /etc/php.d/10-opcache.ini
|
||||
- sudo sed -i "18c\opcache.opcache.max_accelerated_files=50000" /etc/php.d/10-opcache.ini
|
||||
- sudo sed -i "31c\opcache.validate_timestamps=0" /etc/php.d/10-opcache.ini
|
||||
- sudo sed -i "36c\opcache.revalidate_freq=0" /etc/php.d/10-opcache.ini
|
||||
- mkdir -p /sei-nfs/dados
|
||||
- mkdir -p /run/php-fpm
|
||||
- echo "opcache.jit = 1254" | sudo tee -a /etc/php.d/10-opcache.ini
|
||||
- echo "opcache.jit_buffer_size = 256M" | sudo tee -a /etc/php.d/10-opcache.ini
|
||||
- sudo echo -e "#Desabilitar output buffer e alterar timeout\n<Proxy fcgi://localhost>\n ProxySet enablereuse=off flushpackets=auto timeout=610 keepalive=on\n</Proxy>\n#forcar envio de Content-Length quando não informado\nSetEnv proxy-sendcl 1" >> /etc/httpd/conf/httpd.conf
|
||||
- sudo mkdir -p /opt/infra/infra_php
|
||||
- sudo mkdir -p /opt/sei/web
|
||||
- sudo mkdir -p /sei-nfs/dados
|
||||
- sudo cp /tmp/robots.txt /opt/sei/robots.txt
|
||||
- sudo cp /tmp/sei.conf /etc/httpd/conf.d/sei.conf
|
||||
- sudo chown -R root:apache /opt/infra
|
||||
- sudo chown -R root:apache /opt/sei
|
||||
- sudo chown -R root:apache /var/www
|
||||
- sudo openssl req -x509 -nodes -newkey rsa:4096 -keyout /etc/pki/tls/private/localhost.key -out /etc/pki/tls/certs/localhost.crt -days 3650 -subj '/CN=localhost'
|
||||
- sudo rm -f /etc/httpd/conf.d/{userdir.conf,welcome.conf}
|
||||
- sudo systemctl enable php-fpm.service --now
|
||||
- sudo systemctl enable httpd.service --now
|
||||
- sudo systemctl restart php-fpm.service
|
||||
- sudo systemctl restart httpd.service
|
||||
- sudo nmcli conn modify enp0s5 ipv6.method disabled
|
||||
- sudo systemctl restart NetworkManager
|
||||
- echo "00 01 * * * root rm -rf /opt/sei/temp/*" | sudo crontab
|
||||
- sudo systemctl reload crond.service
|
||||
|
||||
final_message: "SEI Instance ready after $UPTIME seconds"
|
||||
Reference in New Issue
Block a user