分享
 
 
 

Domino 与 Apache PHP 的集成

王朝php·作者佚名  2008-05-30
窄屏简体版  字體: |||超大  

现在很多项目是php开发,php作为流行的开发语言,具有良好的性能

这篇文章就是介绍如何使domino与php集成在一起

Introduction Setting up Domino Setting up Apache Using PHP with Domino Limitations, TODO, etc IntroductionPeople often ask whether it's possible to use PHP with Domino. It's not as long as Domino is the HTTP stack being used. In theory it would be possible with IIS as the HTTP stack and the PHP module for IIS, but this is a nicer solution (because you don't need IIS) using Apache as the HTTP stack.

This is achieved without any additional code or modules, just through proper configuration of Apache. In essence, we're using mod_rewrite to find URLs with .nsf in them and pass them through to mod_proxy to fetch them from Domino. This in effect gives you seamless integration between Apache and Domino, as content on an Apache server usually won't have .nsf in the filename so there won't be a conflict.

System RequirementsHere is the software and versions I used to test this out:

Domino 5.06a (This was the first Domino CD I found in my drawer) Apache 1.3.22 (Should work with any 1.3 version of Apache - might be different under 2.0) PHP 4.2.0 Note: For these examples I'm assuming you're running Apache and Domino on the same box, although there's nothing stopping you from running them seperately - just replace relevant references to "localhost" with the hostname of your Domino server.

Setting up DominoNote: You can skip this step if you're running Apache and Domino on seperate boxes.

Firstly we need to move Domino off port 80 for HTTP, so that Apache can take over port 80. To do this in the Server Document go to:

Ports - Internet Ports - Web

Change TCP/IP Port Number to any value but 80, for example 81. The rest of this page will assume you're going to be running Domino on port 81.

Restart the HTTP task - it should come back up on port 81. Try to get to it through the browser, go to the URL http://localhost:81/ - you should get whatever you have setup as the homepage.

Setting up Apache / PHPNote that the basic setup of Apache / PHP is not going to be discussed here. We will assume you have installed Apache, set it up (running on port 80 as normal), installed PHP and setup Apache so that it can run PHP pages. (Phew!) Sounds more complicated than it is, if you've never done it before. If you follow the Apache Install instructions and the PHP Install instructions you shouldn't have any trouble.

Add the following lines to your httpd.conf:

RewriteEngine on RewriteRule ^(.*).nsf(.*) http://localhost:81$1.nsf$2 [P]

What this does is rewrite any URL with a .nsf in it to an Apache proxy request for the same page on port 81 (where Domino is running)

Also add the following lines to ensure that mod_proxy is setup: Note: There will likely be a commented out mod_proxy section if you're using the default httpd.conf - you can just edit that one if you like

ProxyRequests On Order deny,allow Deny from all Allow from 127.0.0.1

This will make sure that Proxying is on and only the locally running Apache server is allowed to make Proxy requests.

Update 26 April 2002: I forgot to originally mention that you'll also need to make sure that the proxy module is being loaded - Near the top of the httpd.conf file there are two lines that need to be uncommented (they're in seperate sections):

LoadModule proxy_module modules/mod_proxy.soAddModule mod_proxy.c

Start Apache and go to http://localhost/homepage.nsf and you should get the Domino sample homepage being served through Apache.

Using PHP with DominoAccessing Domino servers using PHPs support for COM on the Windows platform is nothing unique, so I won't go into too much detail. One interesting thing though when integrating PHP with Domino is you can use PHP for displaying stuff, and then jump to a Domino generated page anytime you need to seamlessly. This is mainly what this example is about - it's a simple example to display a list of names in the NAB and let you edit the records. The display is done using PHP and the editing is standard Domino EditDocument functionality. I used the NAB as the example because I tried this integration stuff on a standalone server and I didn't have any other interesting databases on it :)

Download nab.zip - ZIP file containing the nab.php file.

Limitations, TODO, etcI haven't done too much experimenting with this integration, just mainly wanted to see if it works. It doesn't seem like there are any real limitations. One thing that might have been an issue that isn't is that authentication works. Note that if you're using files that are in the domino\html directory you will need to either move them into the Apache htdocs directory or point Apache's root to the Domino domino\html directory.

Also it'd be interesting to see what performance is like under "real" loads. I wouldn't think the proxying would add too much overhead. If anyone has easy access to some stress testing tools and gives it a go, let me know and I'll share with everyone.

Some things to consider and/or try:

SSL connections - how will this work given you'll need seperate certificates for Domino and Apache? I think what would work is that you have the proper certificate for the Apache server and a self-signed cert for Domino - that way when the Apache proxy requests the Domino page it doesn't matter that the certificate is self-signed because it will be Apache actually returning the page to the user (ie. seamlessly) Setting up Domino so that it only accepts connections from Apache - this would prevent someone going to port 81 and getting around Apache. If it's behind a firewall this won't be an issue. Using mod_rewrite to make pretty URLs for Domino content ala the functionality in Domino 6 You can play around with the mod_proxy settings to enable caching for Domino pages. Check out the manual page for mod_proxy for more info. ,

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有