Mule Server - application code to be deployed in standalone folder - deployment

Our Mule 3 server is installed at "/mule/instance0/" on our UNIX server and the application is deployed under "/mule/instance0/apps/" folder. We have been deploying a zip file into the "/mule/instance0/apps/" folder and application runs fine.
There is a new requirement to deploy the application zip file in a folder other than "/mule/instance0/apps" folder (say "/tmp"). We tried looking for the changes that need to be made and they were rather humongous. Does anybody know of a simple config change to pick the application code from a folder other than "/mule/instance0/apps" ?
Thanks,
Midhun

You can make apps directory a symbolic link to tmp: $cd $MULE_HOME; rm -rf apps; ln -s /tmp apps

Related

Extract ZIP file in specific folder on server using terminal?

I have a problem with my VPS server, more precisely with extracting a .zip file (5GB) through the file manager. I have limited support because it is a self-managed VPS. I need a command for a terminal to extract file "5.zip" to a specific server dir for ex: http:xxxxxxx.com/funny folder on my server. Can someone help me with this? Thanks.
You provide URL, not path to directory. But to extract zip file in particular directory you can use command:
cd /directory/funny
unzip /path/to/5.zip
Change /directory/funny with the real directory which your web service serve.

Openshift: How to access the file that is in the external file system?

I am using minishift for deploying my java apllication.
App deployed successfully, but this app need to read/write from some files that are on drive C on my Windows.
I can't just place this files inside container, files should only be in this folder on drive C.
Is there any ways to do it?
You will need to create what is known as host filesystem access/share. More information can be found at the following link https://docs.okd.io/latest/minishift/using/host-folders.html

Node.js app: "Disk quota exceeded" when installing npm module with lots of files

When adding https://www.npmjs.com/package/material-design-icons as a dependency to my Node application, cf push fails with Disk quota exceeded when running npm install. Since the complete application including node_modules has about 100 MB (way below the limit of 1 GB), I assume it might have to do with the fact that material-design-icons has about 86'000 files (for whatever reason).
Is there any workaround for this?
Another solution is to ignore the node_modules directory using the .cfignore file (the same concept as the .gitignore file). The files described in the .cfignore aren't uploaded to Cloud Foundry when you push your app.
You can find more about .cfignore here: https://docs.developer.swisscom.com/apps/deploy-apps/prepare-to-deploy.html#exclude
The solution is to delete the directory node_modules from your app directory before to push it. The description of the needed modules must be in the file package.json under dependencies. I tested a simple express app adding the material-design-icons module. Pushing the application without the content of the directory node_modules works, since in staging the modules are downloaded and added to the application.
The solution is to delete the directory node_modules from your app directory before to push it. The description of the needed modules must be in the file package.json under dependencies. I tested a simple express app adding the material-design-icons module. Pushing the application without the content of the directory node_modules works, since in staging the modules are downloaded and added to the application.
The solution with .cfignore should work. You might need to delete and re-push your app though, since Cloud Foundry caches some files and the container might be filled with these cached files. If you delete and re-push the app, you're getting a clean container from scratch which might solve your problem.
I have faced the same problem. I solved it by doing the following:
Using .cfignore
Specifying the update nodejs in package.json
Using the latest buildpack

Error while copying war file from workstation to client node?`

Hi I am using chef for deployment, I have created a war file on my chef workstation and copied it to my templates folder of cookbook
now I have written a simple recipe to copy it to my client here is the recipe
template "/opt/tomcat7/webapps/SampleProject.war" do
source "SampleProject.war"
end
Now if I run the recipe from my chef-workstation using knife ssh it is unable to copy the war file
knife ssh 'name:staging2.akosha.com' 'chef-client' -x root -P
but if I give some other file like *.txt it copies the file successfully.
I haven't seen a reference for that anywhere, but you shouldn't use the template resource for binaries - the same happened to me also. It seems that the erb-processing flips some bits.
Instead, use the cookbook_file resource, or better the remote_file, to avoid polluting your Chef server with large artifacts (which do not really belong there).

Is there a way to get the absolute path of the context root in tomcat?

I have a problem that, after a lot of reading and research, seems like tomcat is running another instance of itself and thus serving an old version of my updated app (or somehow has cached an older version of my webapp somewhere only serves that.)
I work on the app in eclipse on a windows machine and deploy it on a Linux server as a ROOT app (Renaming the war file to a ROOT.war).
What I'd like to know is if there's a way to locate the older version that tomcat is serving by getting tomcat to log an output of the context root of the servlet that's serving the older version of the app.
As it stands it the moment any files created by the updated app get created in the right directory but because the app instances are different it can't access the files shortly after they're created.
Any help/hints would be welcomed
To answer the question in the title, let your code basically do the following:
System.out.println(getServletContext().getRealPath("/"));
To solve the problem described in the question, shutdown Tomcat and delete everything in its /work directory, delete the expanded WAR in /webapps and remove the /Catalina subdirectory of /conf directory (if any) and then restart.