windows环境下Resin和apache的配置
resin 可以在 http://www.caucho.com/download/index.xtp 免费下载和使用。 下载resin 时选择archive versi 中的 windows.zip的普通安装包resin-2.1.0.zip。 把该zip包解压到任何目录下面,如d:resin 1.进入d:resinbinhttpd.exe开启resin服务 (注意:要想让resin服务和系统一起启动就要在cmd下做设置) a:运行中输入cmd b:切换到d:resinbin目录下执行httpd -install c:管理工具→服务中把resin web server服务打开 2.测试:http://ip:8080 apache服务的安装 1.下载apache_2.0.54-win32-x86-no_ssl.msi 2.执行所下载的文件 3.在所需填的空中输入 localhost localhost me@localhost 4.安装目录选择d盘 5.其余都安默认安装 6.启动apache 服务,如不能启动。可以用 apache.exe -k install -n "服务名" 这样加载成服务, (此命令在d:apache2bin目录下执行)以后就可以用 net start '服务名' 来启动服务了。 直到可以启动apache 为止才能做下一步 resin和apache配合使用 其实就是对其配置文件进行修改 1.resin的配置文件 以下就按以上安装的讲解 a:d:resinconfresin.c b:<http-server> <!-- - the root file directory of the server. apache users will change - this to /usr/local/apache/htdocs and iis users will change it - to d:inetpubwwwroot --> <doc-dir>d:apache2htdocs</doc-dir> 可以看出就要是把<doc-dir> </doc-dir>之间的目录改为apache的安装路径 保存退出 2.对aapache的配置文件更改 a:d:apache2confhttpd.c 第一种方式: 在添加模块的地方加入: loadmodule caucho_module "d:/resin/libexec/apache-2.0/mod_caucho.dll" 然后在httpd.c <ifmodule mod_caucho.c> cauchoc "d:/resin/conf/resin.c # for security, deployment sites may want to # comment the following out. <location /caucho-status> sethandler caucho-status </locati </ifmodule> 第二种方式: 切换到resin目录下的bin目录,运行setup,选中apache,按下apply,然后会自动在apache的 httpd.c 注:后面这种安装方式比较简单 要想让apache和resin共用一个端口必须更改apache的配置文件httpd.c 其中namevirtualhost *:80 这一行默认是被注释掉了,只需要把注释去掉就可以了. 3.重启服务:管理工具→服务(最好先重启apache,否则可能提示apache服务无法启动) 4.做一个简单的jsp文件test.jsp(我们用resin站点的例子) 该文件放在:apache/htdocs/test.jsp 内容如下: <%@ page language=javascript %> 2 + 2 = <%= 2 + 2 %> 在浏览器中输入:http://localhost/test.jsp,应该出现下面结果: 2+2=4 windows环境下resin和apache的配置 resin 可以在 http://www.caucho.com/download/index.xtp 免费下载和使用。 下载resin 时选择archive versi 中的 windows.zip的普通安装包resin-2.1.0.zip。 把该zip包解压到任何目录下面,如d:resin 1.进入d:resinbinhttpd.exe开启resin服务 (注意:要想让resin服务和系统一起启动就要在cmd下做设置) a:运行中输入cmd b:切换到d:resinbin目录下执行httpd -install c:管理工具→服务中把resin web server服务打开 2.测试:http://ip:8080 apache服务的安装 1.下载apache_2.0.54-win32-x86-no_ssl.msi 2.执行所下载的文件 3.在所需填的空中输入 localhost localhost me@localhost 4.安装目录选择d盘 5.其余都安默认安装 6.启动apache 服务,如不能启动。可以用 apache.exe -k install -n "服务名" 这样加载成服务, (此命令在d:apache2bin目录下执行)以后就可以用 net start '服务名' 来启动服务了。 直到可以启动apache 为止才能做下一步 resin和apache配合使用 其实就是对其配置文件进行修改 1.resin的配置文件 以下就按以上安装的讲解 a:d:resinconfresin.c b:<http-server> <!-- - the root file directory of the server. apache users will change - this to /usr/local/apache/htdocs and iis users will change it - to d:inetpubwwwroot --> <doc-dir>d:apache2htdocs</doc-dir> 可以看出就要是把<doc-dir> </doc-dir>之间的目录改为apache的安装路径 保存退出 2.对aapache的配置文件更改 a:d:apache2confhttpd.c 第一种方式: 在添加模块的地方加入: loadmodule caucho_module "d:/resin/libexec/apache-2.0/mod_caucho.dll" 然后在httpd.c <ifmodule mod_caucho.c> cauchoc "d:/resin/conf/resin.c # for security, deployment sites may want to # comment the following out. <location /caucho-status> sethandler caucho-status </locati </ifmodule> 第二种方式: 切换到resin目录下的bin目录,运行setup,选中apache,按下apply,然后会自动在apache的 httpd.c 注:后面这种安装方式比较简单 3.重启服务:管理工具→服务(最好先重启apache,否则可能提示apache服务无法启动) 4.做一个简单的jsp文件test.jsp(我们用resin站点的例子) 该文件放在:apache/htdocs/test.jsp 内容如下: <%@ page language=javascript %> 2 + 2 = <%= 2 + 2 %> 在浏览器中输入:http://localhost/test.jsp,应该出现下面结果: 2+2=4 本文出自 51CTO.COM技术博客 |


sruiqing
博客统计信息
热门文章
最新评论
友情链接