linux resin 基本站点配置

进入配置文件目录:
[root@linuxidc resin-4.0.36]# cd /usr/local/resin/conf/
查看都有哪些配置文件:
[root@linuxidc conf]# ls
app-default.xml      health.xml  licenses          resin.xml
cluster-default.xml  keys        resin.properties
配置1:改变端口8080为80:
编辑配置文件:
[root@linuxidc conf]# vim resin.properties
修改app.http :8080为app.http :80
重启:
[root@linuxidc conf]# /etc/init.d/resin stop
Stopping resin: .
[root@linuxidc conf]# /etc/init.d/resin start
Starting resin: .
查看端口:
[root@linuxidc conf]# netstat -lnp |grep java
tcp        0      0 127.0.0.1:6600              0.0.0.0:*                  LISTEN      4387/java
tcp        0      0 127.0.0.1:6800              0.0.0.0:*                  LISTEN      4432/java
tcp        0      0 :::80                      :::*                        LISTEN      4432/java
unix  2      [ ACC ]    STREAM    LISTENING    16890  4387/java          /tmp/.java_pid4387.tmp
在浏览器中输入:192.168.11.160(可以加上:80,也可以不加,默认就是80)进行测试。
配置2:配置虚拟主机
创建网站根目录:
[root@linuxidc conf]# mkdir /data/resinweb
编辑配置文件:
[root@linuxidc conf]# vim resin.xml
在cluster模块中增加一台虚拟主机内容如下:
<host id="www.linuxidc.com" root-directory=".">
<web-app id="/" root-directory="/data/resinweb"/>
</host>
重启:
[root@linuxidc conf]# /etc/init.d/resin stop
Stopping resin: .
[root@linuxidc conf]# /etc/init.d/resin start
Starting resin: .
在根目录下写点东西:
[root@linuxidc conf]# vim /data/resinweb/1.jsp
<html>
<body>
<center>
Now time is: <%=new java.util.Date()%>
</center>
</body>
</html>
测试一下jsp解析:
[root@linuxidc conf]# curl -xlocalhost:80 www.linuxidc.com/1.jsp
<html>
<body>
<center>
Now time is: Sun Mar 12 03:51:05 CST 2017
</center>
</body>
</html>

如果解析出Date()函数显示时间则表示我们配置的虚拟主机成功了。
原文地址:https://www.cnblogs.com/zuochanzi/p/8999527.html