Skip to content

Instantly share code, notes, and snippets.

@kenshero
Last active March 11, 2016 16:45
Show Gist options
  • Save kenshero/f20d9972acef24fbdccf to your computer and use it in GitHub Desktop.
Save kenshero/f20d9972acef24fbdccf to your computer and use it in GitHub Desktop.
mid term Devops
sudo apt-get update
sudo apt-get install nginx
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0-fpm
sudo apt-get install php7.0-mysql
sudo apt-get install mysql-server
sudo service mysql restart
@kenshero
Copy link
Author

configure nginx

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /var/www/html;
    index index.php index.html index.htm;

    server_name server_domain_name_or_IP;

    location / {
        try_files $uri $uri/ =404;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

@kenshero
Copy link
Author

แยก server

CREATE USER 'wordpressuser'@'web_server_IP' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'web_server_ip';
FLUSH PRIVILEGES;

sudo apt-get install mysql-client
mysql -u wordpressuser -h database_server_IP -p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment