Skip to content

Instantly share code, notes, and snippets.

@Seawed
Forked from alksily/readme.md
Last active May 19, 2020 08:52
Show Gist options
  • Save Seawed/5c97e921952a2335ad54d6bd01973ec6 to your computer and use it in GitHub Desktop.
Save Seawed/5c97e921952a2335ad54d6bd01973ec6 to your computer and use it in GitHub Desktop.
Debian Nginx+PHP7+MySQL+other(Redis)

Only for self-dev

Made to fast-easy create server from vscale.io Create Ubuntu 16.04 64bit

Update:
apt-get update

Optional:
apt-get install mc htop build-essential

Install one command line:
apt-get install nginx-extras php7.0-cli php7.0-fpm php7.0-mysql php7.0-curl php7.0-gd php7.0-json php7.0-mcrypt php7.0-sybase php7.0-mbstring mysql-server mysql-client

Install redis(not in 7.0 pack) apt-get install tcl wget http://download.redis.io/releases/redis-2.8.19.tar.gz tar xzf redis-2.8.19.tar.gz cd redis-2.8.19 make

Add nginx vhost file:
mcedit /etc/nginx/conf.d/com.example.conf

server {
    listen 80 default_server;
    server_name example.com;

    charset utf-8;
    #access_log /var/log/nginx/log/host.access.log  main;
    root /path/to/htdocs/dir;

    location / {
        try_files $uri /index.php$is_args$args;
        autoindex on;
    }

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

Configure PHP by edit php.ini:
mcedit /etc/php/7.0/fpm/php.ini

Change short_open_tag from Off to On
Change post_max_size from 8M to 100M
Change upload_max_filesize from 2M to 100M

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