linux resin 基本站点配置

本文介绍如何使用Resin应用服务器配置端口及虚拟主机。主要内容包括将默认端口8080更改为80,并通过重启服务确认更改;此外还详细说明了如何设置虚拟主机,包括创建网站根目录、编辑配置文件添加虚拟主机信息等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

进入配置文件目录:
[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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值