Removing the Port Number from CollectionSpace URLs
Table of Contents
About
The below are notes, rather than official documentation.
They were originally done for Ubuntu, retried and refitted on Debian. They should translate pretty straightforwardly to other OSes.
This document explains how to remove the port numbers that are usually required for CollectionSpace. This is achieved by using the Apache HTTP Server's rewrite module. The end result is that a regular CollectionSpace URL:
|
can be prettified somewhat by removing the :8180
, like so:
|
Besides removing the port number from the URL, this can be used for handling cross domain issues (e.g. for acceptance testing with DOH), or rewrites of URLs for other purposes
Setting up Apache
Make sure you have apache2, php5, mod_rewrite, mod_proxy, proxy_http installed:
|
Then make sure these modules are enabled. How to do this depends on your OS, as a general rule these can be set under your httpd.conf using AddModule.
In Ubuntu and Debian, this is done like so:
|
Next, set up the rewrite rules. These can be set in several places. If you just have a single domain on your computer (ie. localhost), this should be settable in the standard /etc/httpd/conf/httpd.conf
file under eg. Fedora, and /etc/apache2/sites-enabled/000-default
under debian/ubuntu. Add the following in the Virtual Host directive, and change nightly.collectionspace.org
for whatever hostname.
|
The next step might not be necessary in all OS/setups - but it was under ubuntu and debian. In the same file, add:
|
As a final step in Ubuntu (this might not be necessary on your install), the proxy from needs to be enabled. This is done by fixing the /etc/apache2/mods-enabled/proxy.conf
file:
|
You should now be done. Restart your apache server:
|
Start up a browser, and marvel at the wonder: http://nightly.collectionspace.org/collectionspace/ui/html
If you receive 403 Forbidden error codes when loading your proxied url then make sure you add in a proxy block to your configuration (or virtual host) that explicitly allows proxying. For example:
|
Then reload the apache server configurations
|