2020年3月21日星期六

debian10 LNMP 手动初始安装



更新系统
apt-get install sudo
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
设置语言时区
dpkg-reconfigure locales
dpkg-reconfigure tzdata

sudo apt-get autoclean && sudo apt-get clean && sudo apt-get autoremove

安装V2ray
apt-get install curl
bash <(curl -L -s https://install.direct/go.sh)

安装nginx
sudo apt-get install nginx
配置检查
nginx -s reload
Nginx重启
/etc/init.d/nginx restart

nginx.pid" failed 修复:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
/usr/sbin/nginx -c /etc/nginx/nginx.conf


开启BBR及IPV4转发
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
echo "1" > /proc/sys/net/ipv4/ip_forward
sysctl -p
查看开启情况
sysctl net.ipv4.tcp_available_congestion_control

安装FRPS服务端并开机启动
systemctl enable frps.service
systemctl start frps.service
systemctl status frps.service

停止FRPS服务
systemctl stop frps

安装PHP7.3
sudo apt install  php7.3-fpm php7.3-curl php7.3-gd php7.3-intl php7.3-mbstring php7.3-mysql php7.3-imap php7.3-opcache php7.3-sqlite3 php7.3-xml php7.3-xmlrpc php7.3-zip php7.3-apcu php7.3-redis php7.3-imagick -y
重启PHP
systemctl restart php7.3-fpm
显示版本
php -v


安装mariadb数据库
apt install mariadb-server
sudo systemctl status mariadb
systemctl status mariadb
初始设置
mysql_secure_installation
命令行登录
mysql -uroot -p
输入密码成功登录后,建立一个新的用户,并给予最大的权限:
CREATE USER '用户名'@'%' IDENTIFIED BY '密码';
GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' WITH GRANT OPTION;

安装phpMyAdmin
cd /var/www/default
wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip
unzip phpMyAdmin-5.0.1-all-languages.zip -d phpMyAdmin

安装Cockpit管理面板
对于Debian 9,您必须启用backports仓库后安装:
echo 'deb http://deb.debian.org/debian stretch-backports main' > \
 /etc/apt/sources.list.d/backports.list
apt-get update
Debian 10直接安装
Install the package:
sudo apt-get install cockpit