Bootstrap

使用Github或Gitlab的Webhooks实现代码自动更新部署(Ubuntu20.04)

1、安装ssh服务
root@Ubuntu:~# apt-get install openssh-server

2、部署php
root@Ubuntu:~# add-apt-repository ppa:ondrej/php
root@Ubuntu:~# apt-get update
root@Ubuntu:~# apt-get install php-fpm php-mysql php-curl php-json php-zip php-dev  # php-dev可选
root@Ubuntu:~# /etc/init.d/php7.4-fpm start

3、部署nginx
root@Ubuntu:~# apt-get install nginx

4、配置nginx支持php
root@Ubuntu:~# vim /etc/nginx/sites-enabled/default

location ~ \.php$ {
        include snippets/fastcgi-php.conf;
    
    #    # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    #    # With php-cgi (or other tcp sockets):
    #    fastcgi_pass 127.0.0.1:9000;
    }

location /webhook {
;