en:user_advanced:server
Differences
This shows you the differences between two versions of the page.
en:user_advanced:server [2014/04/13 23:52] – external edit 127.0.0.1 | en:user_advanced:server [2016/11/16 20:39] (current) – removed kjdon | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Advanced Server ====== | ||
- | |||
- | <TABAREA tabs=" | ||
- | <TAB> | ||
- | ===== Apache Tomcat ===== | ||
- | Tomcat is a servlet container, and Greenstone3 runs as a servlet inside it. | ||
- | The file '' | ||
- | A Tomcat Context represents a web application. The Context for Greenstone3 is given by the file | ||
- | $GSDL3SRCHOME/ | ||
- | This tells Tomcat where to find the files for the application including its web.xml file (in the $GSDL3HOME folder, ie the web folder in your greenstone3 installation) , and what URL (/ | ||
- | Anything inside the Context directory is accessible via Tomcat . For example, the index.html | ||
- | file that lives in $GSDL3HOME can be accessed through the URL | ||
- | | ||
- | localhost: | ||
- | |||
- | ==== Starting and Stopping Tomcat ==== | ||
- | |||
- | Greenstone provides a little server program which will start the Tomcat server and open the library in a browser. See the [[en: | ||
- | Alternatively, | ||
- | |||
- | To start tomcat: | ||
- | < | ||
- | OR: | ||
- | < | ||
- | To stop tomcat: | ||
- | < | ||
- | OR: | ||
- | < | ||
- | To stop and then immediately start up again in one step, use restart: | ||
- | < | ||
- | |||
- | |||
- | ==== Changing Tomcat Port Number ==== | ||
- | Greenstone sets up Tomcat to run on port 8383 by default. To change this, you can edit the tomcat.port property in build.properties. If you do this before installing Greenstone, then running ’ant install’ will use the new port number. If you want to change it later on, shutdown tomcat, run ’ant configure’, | ||
- | Alternatively, | ||
- | |||
- | ==== Changing Tomcat settings ==== | ||
- | Don't edit the configuration files in Tomcat directly. Edit the versions in $GSDL3SRCHOME/ | ||
- | web.xml (copied to $GSDL3SRCHOME/ | ||
- | |||
- | 'ant configure-tomcat' | ||
- | |||
- | Note: Tomcat must be shutdown and restarted any time you make changes in the following | ||
- | for those changes to take effect: | ||
- | |||
- | * '' | ||
- | * '' | ||
- | * any classes or jar files used by the servlets | ||
- | |||
- | We have disabled following symlinks for the greenstone servlet. | ||
- | To enable it, edit $GSDL3SRCHOME/ | ||
- | set ’allowLinking’ to true. Restart Tomcat. | ||
- | |||
- | By default, Tomcat allows directory listings. To disable this, change the ’listings’ | ||
- | | ||
- | ($GSDL3SRCHOME/ | ||
- | |||
- | We have set the greenstone context to be reloadable. | ||
- | This means that if a class or resource file in $GSDL3HOME/ | ||
- | the servlet will be reloaded. This is useful for development, | ||
- | production mode: set the ’reloadable’ attribute to false in $GSDL3SRCHOME/ | ||
- | |||
- | ==== Changing collections or services ==== | ||
- | On startup, the servlet loads in its site, collections and services. | ||
- | If the site or collection configuration files are changed, these changes will not take | ||
- | effect until the site/ | ||
- | | ||
- | |||
- | ==== Tomcat Session Handling ==== | ||
- | |||
- | Tomcat uses a Manager to handle HTTP session information. The Manager is specified in a < | ||
- | |||
- | Session information is stored between normal stop and starts in $GSDL3SRCHOME/ | ||
- | |||
- | To manually clear saved session info, stop Tomcat and delete the SESSIONS.ser file. | ||
- | |||
- | |||
- | |||
- | ==== Proxying Tomcat with Apache ==== | ||
- | Instead of incorporating servlet support into your existing web server, | ||
- | an easy alternative is to proxy Tomcat. The http:// | ||
- | uses Apache to proxy Tomcat. '' | ||
- | the Virtualhost description for the www.greenstone.org server. | ||
- | |||
- | < | ||
- | < | ||
- | ServerName www.greenstone.org | ||
- | ... | ||
- | ProxyPass / | ||
- | ProxyPassReverse / | ||
- | </ | ||
- | </ | ||
- | |||
- | In our example, the Greenstone3 servlet can be accessed at | ||
- | http:// | ||
- | http:// | ||
- | |||
- | === Running Tomcat behind a proxy === | ||
- | Almost everything works fine when Tomcat is running behind a proxy. | ||
- | The only time this causes trouble is if the servlet itself needs to | ||
- | make external HTTP connections. We do this in the infomine demo collection for example. | ||
- | One of the service classes sends HTTP requests to the infomine database at riverside. | ||
- | Since this is going through the proxy, a username and password is needed. It is not | ||
- | sufficient to prompt the user for a password because they are unlikely to have a | ||
- | password for the particular proxy that Tomcat is using. What we have done at present | ||
- | is to put a proxy element in the '' | ||
- | username and password for the proxy server. Unfortunately, | ||
- | And the file is viewable via the servlet. So we need a better solution. | ||
- | |||
- | |||
- | ==== Deploying a Soap Server on localsite ==== | ||
- | |||
- | |||
- | Make sure tomcat has **stopped**. | ||
- | |||
- | In your greenstone3 home folder, $GSDLHOME: | ||
- | < | ||
- | Then, deploy | ||
- | (as written in the [[http:// | ||
- | < | ||
- | Check that it works, by **starting** tomcat again and going to: | ||
- | < | ||
- | Make sure that the page appears. You can also look at the wsdl file for the gs3 web service that's been exposed: | ||
- | < | ||
- | You can also deploy other sites, see the [[http:// | ||
- | |||
- | |||
- | </ | ||
- | <!-- ################################################################################ | ||
- | ###################################################################################### | ||
- | #################################################################################### | ||
- | <TAB> | ||
- | ===== Setting up an Apache Webserver===== | ||
- | Setting up an Apache web server to work with Greenstone 2. | ||
- | |||
- | ==== Installing the Apache web server on Linux and MacOS (Leopard)==== | ||
- | A walkthrough for Linux on how to set up Apache' | ||
- | |||
- | Notes: | ||
- | * commands to be typed in a Linux x-term prompt are indicated with $ | ||
- | * **Downloading and verifying** | ||
- | |||
- | |||
- | Download the current httpd tar.gz file from http:// | ||
- | e.g. You can go to the mirror site http:// | ||
- | |||
- | |||
- | |||
- | To verify you have an uncorrupted copy of the downloaded file < | ||
- | |||
- | |||
- | For example: | ||
- | * the KEYS file from http:// | ||
- | * the httpd2.2.8.tar.gz.asc from http:// | ||
- | |||
- | |||
- | |||
- | Now, to verify your download, open an x-term and do as described at http:// | ||
- | |||
- | |||
- | For example: | ||
- | < | ||
- | $ gpg --verify <httpd version file name> | ||
- | </ | ||
- | |||
- | * **Extracting** | ||
- | |||
- | |||
- | If you've verified it, extract the contents of the download where you want it: | ||
- | < | ||
- | |||
- | * **Installing by compiling** | ||
- | |||
- | |||
- | Now the folder httpd2.2.8 is created. CD into this folder. Inside this folder, there' | ||
- | First choose the directory where you want to install your apache web server. In the following, **PREFIX** is the **full** path to where it will reside. | ||
- | < | ||
- | $ make | ||
- | $ make install | ||
- | </ | ||
- | For example, PREFIX might be / | ||
- | < | ||
- | |||
- | |||
- | $ make | ||
- | |||
- | |||
- | $ make install | ||
- | </ | ||
- | |||
- | * **Configuring the server and port** | ||
- | |||
- | |||
- | Go into your PREFIX folder again (the " | ||
- | * Add your host server' | ||
- | < | ||
- | * Add the port you want your web server to be listening at in the Listen section. Choose a port number that is not in already in use.: | ||
- | < | ||
- | |||
- | * **Running (starting) and stopping the server** | ||
- | |||
- | |||
- | To run, type the following in the exterm: | ||
- | < | ||
- | To stop it: | ||
- | < | ||
- | If you need to stop then start it up again, you can do both steps in one go: | ||
- | < | ||
- | Running start, stop and restart also works if you're in the PREFIX/bin folder by: | ||
- | < | ||
- | ./apachectl stop | ||
- | ./apachectl restart | ||
- | </ | ||
- | |||
- | For instance, we might do the following to start it using our example prefix: | ||
- | < | ||
- | |||
- | * **Testing that the web server runs** | ||
- | |||
- | |||
- | Open a browser at http:// | ||
- | |||
- | * **Some reading on your part:** | ||
- | |||
- | |||
- | If you installed a Binary distribution of Greenstone 2 (GS2), then the installation wizard would have displayed some information with script code on how to set up the web server for GS2: | ||
- | (In the following, $GSDLHOME is the full path to your greenstone installation folder, usually **gsdl**.) To use the Greenstone Web Library you will need to have a webserver installed (you' | ||
- | webservers too if that is your preference. | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | To refer back to this information later you can find it in the file $GSDLHOME/ | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | Greenstone has been set up to expect $GSDLHOME/ | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | For the Apache webserver this means adding the following directives to your httpd.conf configuration file: | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | < | ||
- | < | ||
- | | ||
- | | ||
- | </ | ||
- | | ||
- | Alias /gsdl " | ||
- | < | ||
- | | ||
- | | ||
- | Order allow,deny | ||
- | Allow from all | ||
- | </ | ||
- | </ | ||
- | Once your webserver is configured in this way you can access Greenstone by pointing your web browser at http:// | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | For more information on installing and configuring a webserver see the Greenstone Installer' | ||
- | |||
- | The above is given in the Greenstone 2 installation wizard. | ||
- | We're going to use it now: | ||
- | |||
- | * **Setting up the apache web server for Greenstone 2** | ||
- | |||
- | |||
- | Open up the httpd.conf file again. It's in your web server installation' | ||
- | < | ||
- | < | ||
- | | ||
- | | ||
- | </ | ||
- | | ||
- | Alias /gsdl " | ||
- | < | ||
- | | ||
- | | ||
- | Order allow,deny | ||
- | Allow from all | ||
- | </ | ||
- | </ | ||
- | |||
- | * If you haven' | ||
- | * Change: | ||
- | < | ||
- | to the full path of $GSDLHOME (you can put it in quotes, try this especially if your path contains spaces): | ||
- | < | ||
- | * **Uncomment: | ||
- | (Make sure that the prefix is the same as the alias registered with your web server.) | ||
- | < | ||
- | * And adjust: " | ||
- | (Make sure that the prefix is the same as the alias registered with your web server.) | ||
- | < | ||
- | |||
- | * **Viewing pages served by Greenstone 2 in your browser** | ||
- | |||
- | |||
- | Open the browser again at http:// | ||
- | |||
- | |||
- | And now you can hopefully see the main page for Greenstone 2. | ||
- | |||
- | |||
- | |||
- | ==== Installing the Apache web server on Windows ==== | ||
- | A walkthrough for Windows on how to set up Apache' | ||
- | |||
- | |||
- | * Download the [[http:// | ||
- | * Double click on the downloaded file--for instance, this may be called apache_2.2.9-win32-x86-no_ssl-r2.msi--and go through the installation wizard. Choose " | ||
- | * To start the server, open a DOS prompt and move into the Apache Software Foundation\Apache2.2\bin directory. Once there, type | ||
- | < | ||
- | To stop it, the Apache HTTP Server [[http:// | ||
- | < | ||
- | However, this didn't work for me. You may need to type **ctrl-c** in the same prompt from where you ran httpd.exe instead. See [[http:// | ||
- | * Check the server is running by visiting localhost: | ||
- | * Edit the file " | ||
- | |||
- | * Make it listen at port 8080 if this is not already set, by finding the " | ||
- | < | ||
- | * Set the server name to be the name of your host machine by searching for the " | ||
- | < | ||
- | For example, if you're going to test the remote Greenstone server from the same machine--that is, locally--then you can set this value to " | ||
- | < | ||
- | * At the end of the httpd.conf file, paste the following and replace $GSDLHOME with the full path to your greenstone 2 installation. Take care to use **forward slashes** this time, and leave the **quote-marks** intact where you find them in the following: | ||
- | < | ||
- | # Setting up the Apache webserver to work with Greenstone2 | ||
- | ScriptAlias / | ||
- | < | ||
- | | ||
- | | ||
- | </ | ||
- | | ||
- | Alias /gsdl " | ||
- | < | ||
- | | ||
- | | ||
- | Order allow,deny | ||
- | Allow from all | ||
- | </ | ||
- | </ | ||
- | Instead of " | ||
- | |||
- | |||
- | |||
- | * Edit the file gsdlsite.cfg located in your $GSDLHOME\cgi-bin as follows: | ||
- | |||
- | * Change the GSDLHOME placeholder in the file to be the full path to your Greenstone2 installation. Use Windows style file separators this time (**backslashes**). For example C:\gsdl. | ||
- | * Uncomment the " | ||
- | < | ||
- | Make sure the prefix is set to the same value as the alias you chose. | ||
- | * You may also need to adjust the " | ||
- | < | ||
- | Once again, make sure to use the script alias you'd chosen above. | ||
- | |||
- | |||
- | If the images do not display in the next step, then come back here and change this back to the way it was before. | ||
- | |||
- | |||
- | * Visit http:// | ||
- | * On Windows, there is a local library server which often runs automatically when running the Greenstone Librarian Interface, GLI. To avoid this from interfering with the custom web server you have associated with Greenstone (the Apache web server just configured), | ||
- | |||
- | Make sure server.exe is not running. Go into your Greenstone2 installation directory. In there you will find either one or both of the following files: | ||
- | # gsdlsite.cfg | ||
- | # glisite.cfg | ||
- | |||
- | If the glisite.cfg file is missing, make a copy of the gsdlsite.cfg file and rename the *copy* as glisite.cfg. | ||
- | |||
- | Open glisite.cfg, | ||
- | < | ||
- | autoenter=0 | ||
- | start_browser=0 | ||
- | </ | ||
- | The above will prevent the local library server (server.exe) from being launched every time you launch GLI. | ||
- | |||
- | |||
- | You will also want to set the greenstone library path in GLI to connect to the correct web server when previewing collections. You do this in GLI, by going to File > Preferences > Connection tab and setting the value of the Greenstone Web Path field to http:// | ||
- | (or http:// | ||
- | |||
- | * **VERY IMPORTANT** | ||
- | If you are using Lucene as indexer you must add the following line to your httpd.conf file: | ||
- | < | ||
- | Apache needs to know the temp folder to run Lucene queries. Otherway, you will have no results. | ||
- | |||
- | ===== IIS ===== | ||
- | |||
- | If you would like to run Greenstone with IIS, instead of Apache, these notes may be useful. | ||
- | |||
- | After installing the web library version of Greenstone, configure IIS by following these steps: | ||
- | - Visit // | ||
- | - Run the IIS configuration program (Control Panel -> Administrative Tools -> Internet Information Services) | ||
- | - Double-click on the local computer, then Web Sites. Right-click on Default Web Site, choose New -> Virtual Directory. Set the Alias to " | ||
- | - Open the new " | ||
- | - IIS 6: Copy the gsdlsite.cfg file from the Greenstone " | ||
- | - IIS 6: expand Local Computer, click "Web Service Extension", | ||
- | - Close the IIS configuration program. | ||
- | - Make the Greenstone " | ||
- | |||
- | < | ||
- | |||
- | cacls " | ||
- | |||
- | cacls " | ||
- | |||
- | cacls " | ||
- | |||
- | </ | ||
- | |||
- | If error.txt not there, add and empty file called error.txt and change permissions as described. | ||
- | |||
- | You should now be able to access your Greenstone library at http:// | ||
- | |||
- | * Additional notes for 2.82, thanks to Diego Spano and Sridhara B | ||
- | * Make sure in cgi-bin you have gsdlsite.cfg not gsdlsite.cfg.in. It may be better to rename the file in IIS: | ||
- | |||
- | - Go to IIS | ||
- | - Default website | ||
- | - click on cgi-bin virtual directory. | ||
- | - In the right side cgi-bin files are found and rename gsdlsite.cfg.in to gsdlsite.cfg. | ||
- | |||
- | Then edit the values like the following: (this assumes installation into C: | ||
- | < | ||
- | gsdlhome | ||
- | httpprefix | ||
- | httpweb | ||
- | gwcgi / | ||
- | </ | ||
- | |||
- | </ | ||
- | </ |
en/user_advanced/server.1397433132.txt.gz · Last modified: 2016/11/16 20:39 (external edit)