How To Shorten an LWA URL

Description

When using Loftware Web Access, a default URL is used to access the LWA application. The default URL is "http://www.<hostname>.com:8080/loftwarewebaccess". The URL may be too long for some users and you may wish to change it to a shorter URL.

There are two processes to shorten the URL.

  • The first process removes the need to use a port (remove ":8080" from the URL)
  • The second process removes the need to specify a path (remove "/loftwarewebaccess" from the URL)

You can choose to follow one or both steps to remove the part of the URL that you require.

It is highly recommended that backups be created of all files mentioned in this article.

How to Remove the Port from the URL

This step will remove the ":8080" from the LWA URL. Web browsers expect the HTTP protocol to use port 80. If any other port is used, then you must specify the port in your URL. If you do not have another web server running on your LWA server that is listening on TCP port 80, then you can use these steps to set LWA's listening port to 80. Once these steps are followed, the URL for LWA will be http://www.example.com/loftwarewebaccess. 

  1. Navigate to your Tomcat's home location (for example, C:\Program Files\Apache Software Foundation\Tomcat 6.0).
  2. Go into the conf directory.
  3. Edit the server.xml file.  
  4. Find port="8080" in the document, as it appears below. Change "8080" to "80".

    Copy
    server.xml
    <pre class="syntaxhighlighter-pre" xml:space="preserve"><Connector port="8080" protocol="HTTP/1.1"   connectionTimeout="20000"   redirectPort="8443"   useBodyEncodingForURI="true"   URIEncoding="UTF-8"/></pre>
  5. Restart the Apache Tomcat service.

At this point, you should now be able to access LWA using the URL http://www.<hostname>.com/loftwarewebaccess.

How to Remove the Path from the URL

The location of the LWA application is always at /loftwarewebaccess, relative to the web root of the Apache Tomcat server. This is a requirement for the system to function properly. The only way to remove the path from the LWA URL is to create a redirect. With a redirect, the user will enter an initial URL, but the browser will be redirected to the /loftwarewebaccess path.  

  1. Navigate to your Tomcat's home location (for example, C:\Program Files\Apache Software Foundation\Tomcat 6.0).
  2. Go into your webapps/ROOT folder.
  3. Rename or delete index.html and index.jsp.
  4. Create a new index.html file.
  5. Put the contents below into your new index.html file.

    Copy
    <pre class="syntaxhighlighter-pre" xml:space="preserve"><?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">    <head>    <title>Redirect</title>    <script type="text/javascript">        //<![CDATA[
            window.location.replace("./loftwarewebaccess");
            //]]>    </script></head><body>redirecting
    </body></html></pre>
  6. Stop the Apache Tomcat service.
  7. Rename or delete the work directory in your Tomcat's home location (for example C:\Program Files\Apache Software Foundation\Tomcat 6.0\work).
  8. Start the Apache Tomcat service.

At this point, you should now be able to access LWA using the URL http://www.<hostname>.com. If you did not use the first process to remove the port, then you would access LWA with the URL http://www.<hostname>.com:8080.