搭建webssh和nginx反向代理
2024-10-21 09:11:53
0、前置条件,centos主机安装了python3和nginx
1、安装webssh
pip3 install webssh
2、添加自定义服务
systemctl cat webssh
# /usr/lib/systemd/system/webssh.service
[Unit]
Description=WebSSH terminal interface
After=network.target [Service]
ExecStart=/bin/bash -c "/usr/local/share/python3/bin/wssh --address='127.0.0.1' --port=6666"
#ExecStart=/usr/local/share/python3/bin/wssh [Install]
WantedBy=multi-user.target
查看服务状态
systemctl daemon-reload
systemctl restart webssh
systemctl status webssh
3、nginx添加反向代理(/etc/nginx/conf.d)
conf.d]# cat webssh.conf
server {
listen 8888;
root /var/www/html; location / {
proxy_pass http://127.0.0.1:6666;
proxy_http_version 1.1;
proxy_read_timeout 300;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
} }
index.html路径
/usr/local/share/python3/lib/python3.10/site-packages/webssh/templates
解决报错libssl.so.1.1: cannot open shared object file: No such file or directory
#从官网下载
# wget https://www.openssl.org/source/openssl-1.1.1e.tar.gz #腾讯云提供的镜像
wget https://mirrors.cloud.tencent.com/openssl/source/openssl-1.1.1e.tar.gz tar -xvf openssl-1.1.1e.tar.gz
./config shared --openssldir=/usr/local/openssl --prefix=/usr/local/openssl
make && make install echo "/usr/local/lib64/" >> /etc/ld.so.conf
ldconfig #验证版本
openssl version
最新文章
- 用vue2 +vue-router2 + es6 +webpack 高仿饿了么app(干货满满)
- Webstorm常用的快捷键
- 搭建java环境
- HTTPS的一些疑问解答
- Thread 总结
- CSS媒体查询(@media)
- border-radius 样式表CSS3圆角属性
- appium-UI automator viewer 无[ resource-id ]项
- 360抢票 网站维护中 &;&; 你的登录被踢了!
- HDU_2030——统计文本中汉字的个数
- 设置edittext的hint位置
- MFC 可以设置背景色、字体、字体颜色、透明背景的 Static 静态文本控件
- Codeforces Round #246 (Div. 2) D. Prefixes and Suffixes(后缀数组orKMP)
- PHP 魔术方法 __call 与 __callStatic 方法
- 02-线性结构4 Pop Sequence
- Webservice接口的调用
- Python学习-使用opencv-python提取手掌和手心及部分掌纹
- centos 6.5安装并配置mysql
- 基于one2team框架的Highcharts图表图片导出方案
- Spark-RDD之Partition源码分析