引言
昨天在阿里云上面申请了一个30天的试用服务器,我选择的是windows server 2012R2的,具体的说说怎么搭建这款服务器,以一张照片为例,目标是从浏览器能够访问到我们服务器的这张照片!
申请服务器
参考这篇博客(里面有申请试用的地址)如何申请免费的阿里云服务器
创建安全组实例
确定以后就是这样的:
在服务器上安装XAMMP
安装过程就不说了,我碰到的几个问题说一下
第一个问题
[Apache] Problem detected!
10:08:51 [Apache] Port 80 in use by “Unable to open process” with PID 4!
10:08:51 [Apache] Apache WILL NOT start without the configured ports free!
10:08:51 [Apache] You need to uninstall/disable/reconfigure the blocking application
10:08:51 [Apache] or reconfigure Apache and the Control Panel to listen on a different port
这里端口被占用参考该博客
第二个问题
[Tomcat] Attempting to start Tomcat app…
一直处于Attempt 状态,没有Runing!
解决方法:打开xammp/tomcat/
先关闭XAMMP
然后运行 catalina_start文件
接着运行 tomcat_server.install
再运行tomcat_server.uninstall
最后重启Xammp,start tomcat
如果还是不行,我建议你卸载XAMMP重新安装!
更改server.html的端口信息
Connector port=“8080” protocol=“HTTP/1.1”
connectionTimeout=“20000”
redirectPort=“8443” />
将8080改为80
Engine name=“Catalina” defaultHost=“localhost”>
Host name=“localhost” appBase=“webapps”
unpackWARs=“true” autoDeploy=“true”
将localhost改为你自己的公网ip最后在倒数第四行地上面加上一行代码
<Context path="/fileStore" docBase="你自己的文件夹(最好在tomcat/webapps/ROOT里面)" crossContext="true" trusted="true"></Context>
其中fileStore是你放照片的文件夹
最后最后:保存重启XAMMP!
在你的浏览器里面输入你的IP+/+文件名(带后缀)
如果有不懂的请联系我,日常在线