部署在线网站

1、注册账号

https://www.ngrok.cc/

2、开通一个隧道账号

记录一下隧道ID 33adb03ff15e3705

3、下载客户端,最下面

https://www.ngrok.cc/

windows64下载  

http://pan.baidu.com/s/1o8HQHxo

4、解压双击,输入33adb03ff15e3705按回车即可

注意:使用使用80端口可以省略不写。

比如 localhost:8080/TestDemo/index.jsp

在server.xml中设置端口为80的时候即

localhost/TestDemo/index.jsp

当然设置其他端口也可以,不过不能省略,Ip地址也可以为其他内网IP地址。

比如192.168.1.100:9999

5、使用Tomcat作为本地服务器

<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">

	<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener" />
	<Listener className="org.apache.catalina.core.JasperListener" />
	<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
	<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
	<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />


	<GlobalNamingResources>

		<Resource auth="Container" description="User database that can be updated and saved"
			factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase"
			pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase" />
	</GlobalNamingResources>


	<Service name="Catalina">



		<Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1"
			redirectPort="8443" />

		<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />



		<Engine defaultHost="localhost" name="Catalina">


			<Realm className="org.apache.catalina.realm.LockOutRealm">

				<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
					resourceName="UserDatabase" />
			</Realm>

			<Host appBase="webapps" autoDeploy="true" name="localhost"
				unpackWARs="true">


				<Valve className="org.apache.catalina.valves.AccessLogValve"
					directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log."
					suffix=".txt" />

				<Context docBase="ZhouDemo" path="" reloadable="true" source="org.eclipse.jst.jee.server:ZhouDemo" />
			</Host>
		</Engine>
	</Service>
</Server>

其中改变之后两个地方 

<Connector connectionTimeout="20000" port="80" protocol="HTTP/1.1" redirectPort="8443" />

原来默认是8080,后改为80

<Context docBase="ZhouDemo" path="" reloadable="true" source="org.eclipse.jst.jee.server:ZhouDemo" />

将path设置为空字符串。

就可将localhost:8080/TestDemo/index.jsp访问形式转成为

localhost/index.jsp

6、经过隧道访问地址

http://zwx.viphk.ngrok.org/

还可以使用买来的域名,替换设置。

最后域名为

http://chixi.online/

网站模板

http://pan.baidu.com/s/1eRZ1Hrc

 

设置初始页面

<welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

 

转载于:https://my.oschina.net/u/3015461/blog/1143109

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值