You can uninstall and reinstall lams, making sure the server url you enter at install time does not use port 8080. This won't work if your other app uses other ports that jboss also needs, but is the neat way to go about it.
The other way is to edit the config for your current installation to change the port, but the link inside c:\lams\index.html won't work anymore unless you update that too.
To edit your current config, open C:\lams\jboss-4.0.2\server\default\conf\jboss-service.xml in Wordpad, and uncomment the following block (it's commented out by default):
<mbean code="org.jboss.services.binding.ServiceBindingManager"
name="jboss.system:service=ServiceBindingManager">
<attribute name="ServerName">ports-01</attribute>
<attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
<attribute name="StoreFactoryClassName">
org.jboss.services.binding.XMLServicesStoreFactory
</attribute>
</mbean>
In addition to this, follow Fiona's steps above to update the url in the database to be 'http://localhost:8180/lams' instead of the url with 8080.
Then start LAMS. The URL should now use port 8180 instead of 8080.
Posted by Jun-Dir Liew