宝塔面板一键安装万能代码
if [ -f /usr/bin/curl ];then curl -sSO https://download.bt.cn/install/install_panel.sh;else wget -O install_panel.sh https://download.bt.cn/install/install_panel.sh;fi;bash install_panel.sh ed8484bec
nginx
安装nginx
apt install nginx
重置配置
nginx -s reload
当提示以下错误:
nginx: [emerg] unknown "connection_upgrade" variable
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed
解决方法,在nginx配置文件http标签下({}符号内添加)添加如下几行:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
修改ssh配置文件并设置root密码
切换到root账户
sudo -i
编辑sshd配置文件
vim /etc/ssh/sshd_config
按键盘【i】进入编辑,将以下NO改为YES,按【Esc】退出编辑,再输入 :wq 保存并退出
PermitRootLogin NO
PasswordAuthentication NO
重启sshd服务
service sshd restart
为root账户设置密码
passwd
nginx提示错误问题
nginx启动或者重启又或者宝塔创建网站时提示信息如下:
nginx: [emerg] unknown "connection_upgrade" variable
nginx: configuration file /www/server/nginx/conf/nginx.conf test failed
解决方法
在nginx配置文件http标签下添加如下几行:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
编辑.bashrc
vim /root/.bashrc
重置SSH密码
sudo passwd <用户名>