Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- yum install nano
- # https://downloads.mariadb.org/mariadb/repositories/#mirror=Beritagar&distro=CentOS&distro_release=centos7-amd64--centos7&version=10.1
- nano /etc/yum.repos.d/MariaDB.repo
- [mariadb]
- name = MariaDB
- baseurl = http://yum.mariadb.org/10.1/centos7-amd64
- gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
- gpgcheck=1
- yum install MariaDB-server MariaDB-client
- systemctl start mariadb
- systemctl enable mariadb
- mysql_secure_installation
- yum install epel-release
- yum install nginx
- systemctl start nginx
- systemctl enable nginx
- firewall-cmd --zone=public --add-port=80/tcp --permanent
- firewall-cmd --zone=public --add-port=443/tcp --permanent
- firewall-cmd --reload
- yum install wget -y
- wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
- rpm -Uvh remi-release-7.rpm
- nano /etc/yum.repos.d/remi-php71.repo
- yum install php php-mysql php-fpm php-cli*
- systemctl start php-fpm
- systemctl enable php-fpm
- nano /etc/nginx/nginx.conf
- server {
- listen 80 default_server;
- listen [::]:80 default_server;
- server_name _;
- root /usr/share/nginx/html;
- # Load configuration files for the default server block.
- include /etc/nginx/default.d/*.conf;
- index index.php index.html index.htm;
- location / {
- try_files $uri $uri/ /index.php;
- }
- error_page 404 /404.html;
- location = /40x.html {
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- }
- location ~ .php$ {
- try_files $uri =404;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- fastcgi_buffer_size 128k;
- fastcgi_buffers 256 4k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- }
- location ~ /\.(ht|svn|git) {
- deny all;
- }
- }
- systemctl restart nginx
- nano /usr/share/nginx/html/index.php
- # masukkan <?php echo phpinfo();?>
- chown apache:apache /usr/share/nginx/html/index.php
- # akses di browser http://plx.akhfa.me/index.php
- nano /etc/nginx/conf.d/wordpress.conf
- server {
- listen 80;
- server_name notulensiku.com www.notulensiku.com;
- #charset koi8-r;
- #access_log /var/log/nginx/log/host.access.log main;
- root /usr/share/nginx/html/wordpress/;
- index index.php index.html index.htm;
- location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
- expires 30d;
- add_header Pragma public;
- add_header Cache-Control "public";
- }
- location / {
- try_files $uri $uri/ /index.php?q=$uri&$args;
- # access_log /var/log/nginx/postdata.log postdata;
- }
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
- #error_page 404 /404.html;
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
- #
- #location ~ \.php$ {
- # proxy_pass http://127.0.0.1;
- #}
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
- # location ~ ^/(wp-content\/uploads\/wfm3_data/\.wfm3_scan_data){
- location ~ /\. {
- return 404;
- }
- }
- systemctl restart nginx
- cd /usr/share/nginx/html
- wget https://wordpress.org/latest.zip
- yum install unzip -y
- unzip latest.zip
- chown -R apache:apache /usr/share/nginx/html/wordpress
- ======================================= end of tutorial ======================================================
- server {
- listen 80;
- server_name notulensiku.com www.notulensiku.com;
- return 301 https://$host$request_uri;
- }
- server {
- client_max_body_size 30M;
- listen 443 ssl http2;
- server_name notulensiku.com www.notulensiku.com;
- ssl_certificate /etc/nginx/ssl/notulensiku.com/notulensiku.crt;
- ssl_certificate_key /etc/nginx/ssl/notulensiku.com/notulensiku.key;
- #ssl_certificate /etc/letsencrypt/live/notulensiku.com/fullchain.pem;
- #ssl_certificate_key /etc/letsencrypt/live/notulensiku.com/privkey.pem;
- #charset koi8-r;
- #access_log /var/log/nginx/log/host.access.log main;
- root /var/www/blog.akhfa.me/public_html/;
- index index.php index.html index.htm;
- location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
- expires 30d;
- add_header Pragma public;
- add_header Cache-Control "public";
- }
- location / {
- limit_req zone=one burst=50 nodelay;
- try_files $uri $uri/ /index.php?q=$uri&$args;
- # access_log /var/log/nginx/postdata.log postdata;
- }
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml$ "/index.php?xml_sitemap=params=$2" last;
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.xml\.gz$ "/index.php?xml_sitemap=params=$2;zip=true" last;
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html$ "/index.php?xml_sitemap=params=$2;html=true" last;
- rewrite ^/sitemap(-+([a-zA-Z0-9_-]+))?\.html.gz$ "/index.php?xml_sitemap=params=$2;html=true;zip=true" last;
- #error_page 404 /404.html;
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
- #
- #location ~ \.php$ {
- # proxy_pass http://127.0.0.1;
- #}
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
- # location ~ ^/(wp-content\/uploads\/wfm3_data/\.wfm3_scan_data){
- location ~ /\. {
- return 404;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement