Forums Liferay

change port and url

Subscribe to change port and url 6 post(s), 2 voice(s)

 
Avatar tachion2k 5 post(s)

Hi,

I’ve installed Liferay and it’s working, but I would like to change the port from 8080 to 80 and the URL so that I don’t have to type /liferay at the end. How would I do this?

Thank you

 
Avatar beltran Administrator 371 post(s)

Hi,

If you want to change the tomcat port during the installation to 80, yo need to install as root on Linux or OS X. By default tomcat is installed at 8080. Only if the port is not occupied, you can change it during the installation. In addition to this, you can launch the installer with —tomcat_server_port=80 option provided you are the root user on an Unix systems

If you want to change it once installed, you have to replace

<connector port="8080">

with

<connector port="80">

into the apache-tomcat/conf/server.xml file.

To remove /liferay at the end of the URL you can follow these steps:

1. Remove apache-tomcat/webapps/ROOT folder and rename apache-tomcat/webapps/liferay to apache-tomcat/webapps/ROOT

2. Replace

<context docbase="liferay" crosscontext="true" path="/liferay">

with

<context docbase="ROOT" crosscontext="true" path="/">

into apache-tomcat/webapps/ROOT/META-INF/context.xml

Finally you have to modify apache-tomcat/webapps/ROOT/WEB-INF/classes/portal-ext.properties and replace:

portal.ctx=/liferay

with

portal.ctx=/

I hope it helps, post if you have any problem.

Kind regards

 
Avatar tachion2k 5 post(s)

Thanks for the quick reply. I have made the changes and restarted the server. The port looks like it’s working, but now I get this message:

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.ArrayIndexOutOfBoundsException: 0 com.liferay.portal.util.PortalInstances._getDefaultCompanyId(PortalInstances.java:215) com.liferay.portal.util.PortalInstances._getCompanyId(PortalInstances.java:169) com.liferay.portal.util.PortalInstances.getCompanyId(PortalInstances.java:79) com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:107) com.liferay.portal.servlet.filters.sessionid.SessionIdFilter.doFilter(SessionIdFilter.java:85)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.


Apache Tomcat/5.5.25

Thanks

 
Avatar beltran Administrator 371 post(s)

Hi,

Can you post the apache-tomcat/logs/catalina.out file or send to beltran@bitnami.org?

 
Avatar tachion2k 5 post(s)

I just emailed the file to you.

Thanks

 
Avatar beltran Administrator 371 post(s)

Hi,

I updated the post, I forgot to change the path into the apache-tomcat/webapps/ROOT/META-INF/context.xml file.

I hope it helps.

Forums Liferay