Liferay - serve static content

How can I serve static content in liferay? I have a directory structure with htmls, css, etc., And I would like to serve it with a type address http://localhost:8080/myStaticContent/index.html, etc.

I do not want to use a front-end HTTP server such as apache.

+3
source share
3 answers

I did this by deploying .war with only static content. The path is the liferay url / war_name URL.

So, if I have a war with a file like this:

myproj.war
+-- myDir
     +-- myFile.html

Url will look like http://localhost:8080/myproj/myDir/myFile.html

+3
source

I assume Liferay uses JBoss or Tomcat in this case. Try the following:

  • server.xml <Context> , jBoss, server.xml :

[jboss-home]/server/[config-name]/deploy/jboss-web.deployer/server.xml

<Context path="/myStaticContent" 
    docBase="/absolute/path/to/static/content" debug="0" reloadable="true"/>

"Host" :

<Host name="localhost" .....> <!-- add it here --> </Host>
  • , docBase ( "/absolute/path/to/static/content" ), WEB-INF bare-bones.
+1

: , , - , - , . , )


liferays cdn (cdn = " " ). - - , , "". , - .

, , cdn , , , webapplication (, ). , .

, /, (, , dns) conbination apache/tomcat, apache, , , tomcat.

0

Source: https://habr.com/ru/post/1715058/


All Articles