栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

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

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

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

        wget "https://down.oray.com/hsk/linux/phddns_5.2.0_amd64.deb" -O phddns_5.2.0_amd64.deb

 

2.下载后,安装并启用花生壳    
 sudo dpkg -i xxx.deb

 sudo phddns start/stop/restart

 

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

        浏览器输入远程管理地址http://b.oray.com

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

 

4.安装Apache
sudo apt update

sudo 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

	# 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.html
	ServerAdmin 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
	#
        #Options -Indexes +FollowSymLinks
        #AllowOverride All
	 #
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${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


# 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

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

 

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/941965.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号