Question

I have installed WSO2 Carbon 3.2.2 and would like to host some static files that I can access from a browser (specifically, a variety of HTML and JavaScript files that make up a working website). I want to be able to access the files from http://localhost:9763/<MY_FILES>. With Carbon 3.0.0 this was as simple as putting the files in <CARBON_HOME>/webapps/. Carbon 3.2.2 does not have the <CARBON_HOME>/webapps/ directory, and adding it doesn't help.

I noticed that (after installing certain features) there is another webapps directory located <CARBON_HOME>/repository/deployment/server/webapps/, but that appears to be specifically for deploying war files.

I've tried putting my files everywhere I can think of, but I've had no luck.

Is there a feature that I have to install? Is there a special location to put these files? Is this still a supported feature?

Was it helpful?

Solution

This is never been an advertised feature of Carbon nor it has been recommended. Hence you can't expect to have backward compatibility for a "non feature".

The right thing to in a production environment is to use a web server (Apache, nginx etc...) to serve static files because web servers are optimized to do that. Then proxy the connections to Carbon via the web server. For example, by using mod_proxy for Apache.

You can still use the Application Server (or after installing AppServer features into any Carbon server) to create a .war file and have your static site there. Then again if it's a static site using Application Server is an overkill.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top