600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > ubuntu20 系统 Apache+花生壳(内网穿透)服务项目上线

ubuntu20 系统 Apache+花生壳(内网穿透)服务项目上线

时间:2020-12-24 08:04:58

相关推荐

ubuntu20 系统 Apache+花生壳(内网穿透)服务项目上线

1.下载花生壳(内网穿透)客户端

wget "/hsk/linux/phddns_5.2.0_amd64.deb" -O phddns_5.2.0_amd64.deb

2.下载后,安装并启用花生壳

sudo dpkg -i xxx.debsudo phddns start/stop/restart

3.进入花生壳远程管理页面

浏览器输入远程管理地址

输入安装花生壳时生成的SN码及默认密码admin进入

4.安装Apache

sudo apt updatesudo apt install apache2

5.验证 Apache2 是否正在运行

sudo systemctl status apache2

运行成功

6.验证 Apache 安装

打开你的浏览器,输入服务器 IP 地址http://YOUR_IP_OR_DOMAIN/

安装成功

7.配置默认000-default.conf虚拟主机(也可创建多个)

sudo vim /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80># The ServerName directive sets the request scheme, hostname and port that# the server uses to identify itself. This is used when creating# redirection URLs. In the context of virtual hosts, the ServerName# specifies what hostname must appear in the request's Host: header to# match this virtual host. For the default virtual host (this file) this# value is not decisive as it is used as a last resort host regardless.# However, you must set it for any further virtual host explicitly.#ServerName html#ServerAlias www.htmlServerAdmin webmaster@内网穿透访问地址DocumentRoot /var/www/项目文件夹# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,# error, crit, alert, emerg.# It is also possible to configure the loglevel for particular# modules, e.g.#LogLevel info ssl:warn#<Directory /var/www/html>#Options -Indexes +FollowSymLinks#AllowOverride All#</Directory>ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined# For most configuration files from conf-available/, which are# enabled or disabled at a global level, it is possible to# include a line for only one particular virtual host. For example the# following line enables the CGI configuration for this host only# after it has been globally disabled with "a2disconf".#Include conf-available/serve-cgi-bin.conf</VirtualHost># vim: syntax=apache ts=4 sw=4 sts=4 sr noet

8.在apache2.conf最后一行添加ServerName

sudo vim /etc/apache2/sites-enabled/apache2.conf

ServerName 内网穿透访问地址:端口号

9.测试配置文件,是否有任何语法错误

sudo apachectl configtest

如果没有任何错误,你将会看到下面的输出

Syntax OK

10.重启 Apache 服务,使修改生效

sudo systemctl restart apache2

11.最终效果

在浏览器输入http://内网穿透访问地址/xxx.html

好了,就到这了,如果喜欢就点个赞吧!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。