1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/aipaw-wookteam

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
SERVER.md 3.6 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
kuaifan Отправлено 07.09.2021 08:22 be15bcc

Install

中文文档

Setup (Server)

Fork the repo if you are outside collaborator https://gitee.com/aipaw/wookteam.

1. Clone the project to your local or server

# using ssh
git clone git@gitee.com:aipaw/wookteam.git
# or you can use https
git clone https://gitee.com/aipaw/wookteam.git

# enter directory
cd wookteam

# copy .env
cp .env.example .env

2. Modify.env

Database...

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=wookteam
DB_USERNAME=root
DB_PASSWORD=123456
......
LARAVELS_LISTEN_IP=127.0.0.1
LARAVELS_LISTEN_PORT=5200

3. Setup application

git checkout master # use dev branch for local development
git pull origin master # use dev branch for local development

composer install
php artisan key:generate
php artisan migrate --seed

4. Run Laravels (WebSocket)

Please confirm your environment and installationSwoole

php bin/laravels start

It is recommended to supervise the main process through Supervisord, the premise is without option -d and to set swoole.daemonize to false.

[program:wookteam-test]
directory=/wwwroot/wookteam.com
command=/usr/local/bin/php bin/laravels start -i
numprocs=1
autostart=true
autorestart=true
startretries=3
user=www
redirect_stderr=true
stdout_logfile=/var/log/supervisor/%(program_name)s.log

5. Deployment To Nginx

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}
upstream swoole {
    # Connect IP:Port
    server 127.0.0.1:5200 weight=5 max_fails=3 fail_timeout=30s;
    keepalive 16;
}
server {
    listen 80;
    
    # Don't forget to bind the host
    server_name wookteam.com;
    root /wwwroot/wookteam.com/public;

    autoindex off;
    index index.html index.htm index.php;

    charset utf-8;

    location / {
        try_files $uri @laravels;
    }

    location =/ws {
        proxy_http_version 1.1;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Real-PORT $remote_port;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header Scheme $scheme;
        proxy_set_header Server-Protocol $server_protocol;
        proxy_set_header Server-Name $server_name;
        proxy_set_header Server-Addr $server_addr;
        proxy_set_header Server-Port $server_port;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        # "swoole" is the upstream
        proxy_pass http://swoole;
    }

    location @laravels {
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Real-PORT $remote_port;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header Scheme $scheme;
        proxy_set_header Server-Protocol $server_protocol;
        proxy_set_header Server-Name $server_name;
        proxy_set_header Server-Addr $server_addr;
        proxy_set_header Server-Port $server_port;
        # "swoole" is the upstream
        proxy_pass http://swoole;
    }
}

Default Account

  • admin/123456
  • system/123456

Upgrade

Note: Please backup your data before upgrading!

  • Go to the directory and run the following commands in turn:
git fetch --all
git reset --hard origin/master
git pull

composer update
php artisan migrate
php bin/laravels start # If use Supervisord restart Supervisord

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/aipaw-wookteam.git
git@api.gitlife.ru:oschina-mirror/aipaw-wookteam.git
oschina-mirror
aipaw-wookteam
aipaw-wookteam
master