en:user_advanced:gs3_server
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:user_advanced:gs3_server [2025/06/27 01:15] – kjdon | en:user_advanced:gs3_server [2025/06/27 03:00] (current) – [Proxying Tomcat with Apache] kjdon | ||
|---|---|---|---|
| Line 24: | Line 24: | ||
| To start tomcat: | To start tomcat: | ||
| - | < | + | < | 
| OR: | OR: | ||
| - | < | + | < | 
| + | $ source ./ | ||
| + | $ ant start</ | ||
| To stop tomcat: | To stop tomcat: | ||
| - | < | + | < | 
| OR: | OR: | ||
| < | < | ||
| To stop and then immediately start up again in one step, use restart: | To stop and then immediately start up again in one step, use restart: | ||
| + | < | ||
| + | OR: | ||
| < | < | ||
| ===== Changing Tomcat Port Number ===== | ===== 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.  | + | Greenstone sets up Tomcat to run on port 8383 by default. To change this, you can edit the tomcat.port property in build.properties.  | 
| - | Alternatively, | + | |
| + | Alternatively, | ||
| ===== Changing Tomcat settings ===== | ===== Changing Tomcat settings ===== | ||
| - | Don't edit the configuration files in Tomcat directly. Edit the versions in $GSDL3SRCHOME/ | + | Don't edit the configuration files in Tomcat directly. Edit the versions in $GSDL3SRCHOME/ | 
| - | web.xml (copied to $GSDL3SRCHOME/ | + |   * greenstone3.xml.in (copied to $GSDL3SRCHOME/ | 
| + |   * server_tomcat8.xml.in (copied to $GSDL3SRCHOME/ | ||
| + |   * web8.xml.in (copied to $GSDL3SRCHOME/ | ||
| + |   * root_context.xml.in (copied to $GSDL3SRCHOME/ | ||
| - | 'ant configure-tomcat' will copy these files to their correct places, replacing variable placeholders with their correct values. This is done each time Tomcat is restarted  | + | 'ant configure' | 
| Note: Tomcat must be shutdown and restarted any time you make changes in the following | Note: Tomcat must be shutdown and restarted any time you make changes in the following | ||
| Line 49: | Line 58: | ||
|   * '' |   * '' | ||
| - |   * '' | + |    | 
| + |    | ||
|   * any classes or jar files used by the servlets  |   * any classes or jar files used by the servlets  | ||
| We have disabled following symlinks for the greenstone servlet.  | We have disabled following symlinks for the greenstone servlet.  | ||
| - | To enable it, edit $GSDL3SRCHOME/ | + | To enable it, edit $GSDL3SRCHOME/ | 
| - | set ’allowLinking’ to true. Restart Tomcat. | + | set ’tomcat.user.allowLinking’ to true. Restart Tomcat. | 
| - | By default,  | + | Tomcat  | 
| - |   | + |   | 
| - | ($GSDL3SRCHOME/ | + | |
| We have set the greenstone context to be reloadable.  | We have set the greenstone context to be reloadable.  | ||
| This means that if a class or resource file in $GSDL3HOME/ | This means that if a class or resource file in $GSDL3HOME/ | ||
|  the servlet will be reloaded. This is useful for development, |  the servlet will be reloaded. This is useful for development, | ||
| - | production mode: set the ’reloadable’ attribute to false in $GSDL3SRCHOME/ | + | production mode: set the ’reloadable’ attribute to false in $GSDL3SRCHOME/ | 
| + | |||
| + | If you are seeing lots of errors in packages/ | ||
| + | < | ||
| + | to the cache for web application [/ | ||
| + | insufficient free space available after evicting expired cache entries</ | ||
| + | |||
| + | ==== Using Greenstone inside a frame ==== | ||
| + | |||
| + | Greenstone' | ||
| + | From April 2024, we use a newer version of Tomcat (8.5.99) instead of 8.5.51. This has the ability to set partitioned for cookies. | ||
| + | This feature is available in Greenstone 3.12 and later. | ||
| + | Edit resources/ | ||
| + | < | ||
| + | <!-- if greenstone is to be run in an iframe, need to use the --> | ||
| + | <!-- sameSiteCookies=none version of the CookieProcessor --> | ||
| + |   < | ||
| + |   < | ||
| + | </ | ||
| + | |||
| + | ==== Turn off localhost access logs ==== | ||
| + | |||
| + | By default, one of the enabled forms of logging in Apache Tomcat is the Local Host Access Log. This log tracks every connection made to the server. This can add up to a lot of logs that can quickly overwhelm the hard drive space of your server. | ||
| + | |||
| + | To disable this, edit resources/ | ||
| + | |||
| + | Look for the ''< | ||
| ===== Changing collections or services ===== | ===== Changing collections or services ===== | ||
| Line 75: | Line 110: | ||
| Tomcat uses a Manager to handle HTTP session information. The Manager is specified in a < | 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/ | + | 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. | To manually clear saved session info, stop Tomcat and delete the SESSIONS.ser file. | ||
| Line 91: | Line 126: | ||
| ServerName www.greenstone.org | ServerName www.greenstone.org | ||
| ... | ... | ||
| - | ProxyPass / | + | |
| - | ProxyPassReverse / | + | Redirect / | 
| + | ProxyPass / | ||
| + | ProxyPass / | ||
| + | ProxyPassReverse / | ||
| + | < | ||
| + |           ProxyPassReverseCookiePath / | ||
| + | </ | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | Restart Apache for these changes to take effect. | ||
| In our example, the Greenstone3 servlet can be accessed at | In our example, the Greenstone3 servlet can be accessed at | ||
| Line 100: | Line 143: | ||
| http:// | http:// | ||
| - | You will also need to tell Greenstone itself about the new web address. Edit | + | You will also need to tell Greenstone itself about the new web address. Edit **build.properties**. | 
| - | **web/ | + | Set the revproxy fields: | 
| < | < | ||
| - | < | + | revproxy.protocol=https | 
| + | revproxy.domain=www.greenstone.org | ||
| + | ## | ||
| + | ## | ||
| </ | </ | ||
| - | + | You will also need to edit **resources/ | |
| - | Set up the tomcat.port and shutdown port in your '' | + | Uncomment  | 
| - | + | ||
| - | Also edit these files ton contain  | + | |
| < | < | ||
| - | ./resources/web/global.properties.in | + | < | 
| - | ./resources/web/global.properties | + |    < | 
| + |    < | ||
| + | </ | ||
| </ | </ | ||
| - | to change  | ||
| - | < | ||
| - | to | ||
| - | < | ||
| - | 	# | ||
| - | tomcat.context=urban-narrative-greenstone3 | ||
| - | </ | ||
| - | |||
| - | Don't forget to run (from GS3 folder): | ||
| - | < | ||
| - | ant configure-web | ||
| - | </ | ||
| - | to regenerate the global.properties file in the actual web folder. | ||
| - | |||
| - | Finally, to get everything running: | ||
| - | </ | ||
| - | ./ | ||
| - | ant start | ||
| - | < | ||
| - | Then | ||
| - | < | ||
| - | In the same x-term, ssh -L back into the machine running the GS3 server: | ||
| - | < | ||
| - | On any browser, visit: | + | You will need to restart Tomcat for these settings to take effect. | 
| - | < | + | |
| === Running Tomcat behind a proxy === | === Running Tomcat behind a proxy === | ||
| Almost everything works fine when Tomcat is running behind a proxy.  | Almost everything works fine when Tomcat is running behind a proxy.  | ||
en/user_advanced/gs3_server.1750986953.txt.gz · Last modified: 2025/06/27 01:15 by kjdon
                
                