时间:2023-05-31 15:39:02 | 来源:网站运营
时间:2023-05-31 15:39:02 来源:网站运营
树莓派搭建web站点,并内网穿透发布到公网:sudo apt-get install apache2 -ysudo service apache2 restartcd /var/www/html/sudo rm *sudo wget https://www.cpolar.com/static/downloads/meditation-app-master.tar.gzsudo tar xzf meditation-app-master.tar.gzsudo mv meditation-app-master/* .sudo rm -rf meditation-app-master meditation-app-master.tar.gz重新在浏览器打开,并刷新站点:http://localhostcurl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bashcurl -sL https://git.io/cpolar | sudo bashcpolar version如果正常显示,则安装成功cpolar authtoken xxxxxxxxxxxxxxxxxxcpolar http -region=cn_vip 80上图显示,cpolar将内网站点,发布到了一个随机域名网址:https://711d7522.vip.cpolar.cnCTRL+C键,退出cpolardev9,地区选择VIP China地区cpolar http -subdomain=dev9 -region=cn_vip 80如果显示正常,则说明我们已经配置好了。nano /usr/local/etc/cpolar/cpolar.yml如图:authtoken: xxxxxxxxxxxx #认证tokentunnels: ssh: #隧道名称,表示ssh,名称可以自定义 addr: 22 #端口号为22 proto: tcp #协议tcp region: cn_vip #地区,cn_vip,可选:us,hk,cn,cn_vip website: #隧道名称,用户可以自定义,但多隧道时,不可重复 addr: 8080 #本地Web站点端口 proto: http #协议http region: cn_vip #地区,cn_vip,可选:us,hk,cn,cn_vip本例中,我们需要修改如下内容:8080端口修改为80 subdomain: "你的二级子域名"yaml格式的,缩进敏感,而且不能有TAB键。CTRL+X,退出,提示你是否保存,回答Y,确认保存文件路径,回车cpolar start-all如上图显示,则为正常,按CTRL+C退出sudo systemctl enable cpolarsudo systemctl start cpolarsudo systemctl status cpolar如图说明,启动状态成功sudo reboot重启后,检查cpolar隧道是否仍在线。登录cpolar官网后台-->状态下一篇:在树莓派上搭建WordPress博客网站,并内网穿透发布到公网
关键词:发布,树莓