I have a laravel application, and a war file. Both run like expected, but separately.
Laravel in vagrant/homestead and the war file with tomcat.
My objective is to run the war file within the laravel application. I haven't found anyone doing something like this.
I tried extracting the content of the war file but I get some errors, from missing files that I can't find anywhere.
Has anyone a clue on how to do this / an example I can follow?
Thank you!
Edit: The answer below follows the tag's descriptions for war files as
Web Application Archive - Is Jar file used to distribute JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries and static Web pages (HTML and related files) that together constitute a Web application.
But, according to the comments, it seems that PHP can be packaged in WAR files as well. With that aspect, my answer won't be helpful (sorry), but I'll leave it here in case someone actually later on finds this question for a mixed Java/PHP environment:
According to the tag descriptions:
laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern and based on Symfony.
and
tomcat is an open source Servlet Container
E.g. tomcat is more an application server, while Laravel is a library. Good luck running something (written in Java) within a PHP environment. (e.g. it won't work)
What you can do is to run tomcat, and serve its files from the same webserver that you serve your Laravel application from (e.g. Apache httpd, nginx). You'll have to lookup "reverse proxy" for it, e.g. "mount" a certain part of the URL hierarchy from Tomcat to your Webserver.
But to run any Java code and JSPs within a PHP environment? No.
Related
Hi I am quite new to advance frontend technologies and I have simple question.
scenario
I would like to use next.js and its feature: server side rendering.
I would like also to have my js, css and html files stored in outside of host machine where next.js is running. I want to have my files in azure blob storage. It is neccessary because I would like to have many SPA pages and single wwwroot directory is not enough for me.
Problem
By default next.js get its files from pages directory at host machine.
Is it possible to tell next.js to get files from other file system etc. In this scenario it would be azure storage. I could not find any example or extension point to do that.
I'm looking for a package which would help me in exporting my project as a war file. However I don't see any relevant package in npmjs.com or anywhere else.
What I've tried so far:
Explored npmjs.com for this package, and found none.
Explored github and found none there as well.
One SO solution suggested to make use of the jar command which
unfortunately doesn't exist in my environment, I can't download and
use it too due to restrictions.
Did anyone come across such module (or) any other solutions with respect to this? Can some one help?
If I'm not wrong, a WAR file is specific to a Java environment. If you are using nodeJS and Javascript, you are not using Java and the WAR format is not appropriate for your code...
What do you want to achieve with a war file more than something else?
In computing, a WAR file (short for Web ARchive) could be a JAR file
used to distribute a collection of JavaServer Pages, servlets, Java
classes, XML files, tag libraries and static Web pages (HTML and
related files) that together constitute a Web application.
Wikipedia
EDIT: The only solution I see would be to create a Java Application that would eventually require and execute your nodeJS code... But this seems Hacky as hell. You can read this response about how to execute NodeJS code into a Java environment: Calling a node.js script from inside java
So I feel like this is a simple question that has just been evading me so hopefully I can get some help here. I have developed a nodejs webapp, the directory structure can be seen in the screenshot below. Eventually, this app will implement a mongodb and house a hefty size of audio files.
I am using the inMotion Premier Support hosting plan (pretty basic) and when taking a look at the server through fileZilla I see there is a public_html directory.
Do I put the whole contents of my webapp (everything in the screenshot) in the public_html directory? I assumed that only the files that should be publicly accessible should go in there (only the contents of my apps public directory). If that's the case where would I place the files that would be considered server-side (everything on the same level as app.js).
Also my hosting service isn't dedicated or even virtual so I don't have access to the whole server just a certain number of directories.
Any help is appreciated
I am currently working on a webapp.
What you want is a VPS on inMotion, not a FTP server. The public_html directory in these web hosting services is where you usually put static html files. If you want to deploy node.js web apps, look at getting a server through VPS.
I am studying Aurelia following the starter kit. In detail, I have selected the option of TypeScript and I complie them in Visual studio 2015. At present, the example applications work well on the local web server, IIS. Now I want to test it on an internet web server where I usually put my static html files and some php and ruby pages. Probably, the server is an apache managed by some IT company.
As I am very new to this field, I just plan to put the top folder of the local file system together with its all sub folders into somewhere in the web file system of the internet server.
Then the question is, will it work normally? I feel other options are too complexed for me to achieve at present. Or is there other simple alternative way?
I read a similar question here, but the anwer instruction is to difficult for me.
This article http://aurelia.io/docs.html#/aurelia/framework/1.0.0-beta.1.2.4/doc/article/bundling-your-app-for-deploy teaches how to bundle your app for deployment. In short, it will transform your app in a couple files (usually 1 .html and 2 .js).
To bundle your app, run gulp export. It will create an "export" folder inside the application folder. Then, just copy and paste those files in the server and the app will work normally.
Maybe it's a stupid question but i am a newbie using node js, and I think that it can be used just with js files, I dont know, I installed node js on my windows and i started the web server but i dont know how to run the files, I have always worked with apache, I saw there is a folder called scrips in the node js installation folder
but i dont know how to run the files, I have always worked with apache.
In NodeJS, it's either you write the web server (it's like writing Apache itself), or use a framework that does it for you (it's like adding in something like Apache). Suggesting you check out Express. It's something almost close to CodeIgniter (writing points of entry).
Can i run a php file or a html file in a node js web server?
NodeJS is for JS. Your server files are all in JS. As for HTML, checkout Express (mentioned above), or if you just want to serve plain HTML (or static files), you may want to check out Connect Static