现在很多项目是php开发,php作为流行的开发语言,具有良好的性能 People often ask whether its possible to use PHP with Domino. Its 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 dont 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, were 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 wont have .nsf in the filename so there wont be a conflict. Here is the software and versions I used to test this out: Note: For these examples Im assuming youre running Apache and Domino on the same box, although theres nothing stopping you from running them seperately – just replace relevant references to “localhost” with the hostname of your Domino server. Note: You can skip this step if youre 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: 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. Note 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 youve never done it before. If you follow the Apache Install instructions and the PHP Install instructions you shouldnt have any trouble. Add the following lines to your httpd.conf: 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 youre using the default httpd.conf – you can just edit that one if you like 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 youll 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 (theyre in seperate sections): Start Apache and go to http://localhost/homepage.nsf and you should get the Domino sample homepage being served through Apache. Accessing Domino servers using PHPs support for COM on the Windows platform is nothing unique, so I wont 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 – its 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 didnt have any other interesting databases on it 🙂 Download nab.zip – ZIP file containing the nab.php file. I havent done too much experimenting with this integration, just mainly wanted to see if it works. It doesnt seem like there are any real limitations. One thing that might have been an issue that isnt is that authentication works. Note that if youre using files that are in the domino\html directory you will need to either move them into the Apache htdocs directory or point Apaches root to the Domino domino\html directory. Also itd be interesting to see what performance is like under “real” loads. I wouldnt 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 Ill share with everyone. Some things to consider and/or try:
这篇文章就是介绍如何使domino与php集成在一起Introduction
System Requirements
Setting up Domino
Setting up Apache / PHP
LoadModule proxy_module modules/mod_proxy.so AddModule mod_proxy.c
Using PHP with Domino
Limitations, TODO, etc
,
Ports -> Internet Ports -> Web
Change TCP/IP Port Number to any value but 80, for example 81. The rest of this page will assume youre going to be running Domino on port 81.