debian_manual.md
apt update
apt upgrade
apt install nginx
apt install mariadb-server
mysql_secure_installation
根据提示操作即可。
mariadb
之后会显示
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 74
Server version: 10.3.15-MariaDB-1 Debian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
接下来输入命令
CREATE DATABASE [这里替换为数据库名] ;
GRANT ALL ON [这里替换为数据库名].* TO '[这里替换为用户名]'@'localhost' IDENTIFIED BY '[这里替换为密码]' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT
apt install php php-fpm php-mysql php-gd php-zip php-opcache php-curl php-mbstring php-intl php-dom php-bcmath php-redis php-fileinfo
apt install redis
nano /etc/php/7.4/fpm/php.ini,ctrl+w 搜索 putenv,proc_open,pcntl_signal,pcntl_alarm 在disable_functions 一行 有就去掉。
之后 /etc/init.d/php7.4-fpm reloadcd /var/www/dujiaoka
apt install git
git clone https://github.com/assimon/dujiaoka.git
chmod 777 -R /var/www/dujiaoka
domain.com/home/wwwroot/dujiaoka/usr/local/nginx/conf/vhostnano /etc/nginx/sites-enabled/dujiaoka
你可以参考我的配置文件
server
{
listen 80;
listen [::]:80;
server_name domain.com ;
return 301 https://$server_name$request_uri;
}
server
{
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name domain.com ;
index index.html index.htm index.php default.html default.htm default.php;
root /var/www/dujiaoka/public;
ssl_certificate /etc/nginx/sslcert/cert.crt;
ssl_certificate_key /etc/nginx/sslcert/key.key;
# openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
#ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
location ~ [^/]\.php(/|$)
{
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
include snippets/fastcgi-php.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
在 /etc/nginx/sslcert/ 上传你的https证书 之后 nginx -t 没有报错就重启nginx /etc/init.d/nginx restart
cd /var/www/dujiaoka
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
adduser user
su user
composer install
composer update
su
访问你的域名,进行安装
dujiaoka你设置的密码无需填写https://domain.com##编辑配置文件
编辑 /var/www/dujiaoka/.env
APP_DEBUG=true 改为 APP_DEBUG=falseADMIN_HTTPS=true0 error ,刷新页面即可先安装
apt install supervisor
创建配置文件
nano /etc/supervisor/conf.d/dujiaoka.conf
写入配置文件
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/wwwroot/dujiaoka/artisan queue:work
autostart=true
autorestart=true
user=www
numprocs=1
redirect_stderr=true
stdout_logfile=/home/wwwlogs/worker.log
启动
supervisorctl reread
supervisorctl update
supervisorctl start laravel-worker:*
https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mariadb-php-lemp-stack-on-debian-10 https://github.com/assimon/dujiaoka/wiki/2.x_linux_install