How to include public_html sibling folder in a PhpStorm project? - deployment

I have the following site directory structure (on a shared hosting):
/home/username/
public_html/
index.html
resources/
config.php
I am trying to set up a new project using the remote deployment in PhpStorm. I'd like to have both public_html and resources folders accessible, since both contain PHP files. I am confused by what should be the Project Root. Logic suggests that my project root is the top level directory containing all my files, i.e. /home/username/.
However if I mark it such in PhpStorm, the next screen (Specify Web Path) automatically maps my web root folder to the project root.
As the result, if I run /home/username/public_html/index.html from PhpStorm, it tries browsing to https://webroot/public_html/index.html. This is wrong. The web root should be mapped to /home/username/public_html. Actually, the very question ("Web path for project root '/home/username'") is invalid, since there is no web path to folders above public_html, that's the whole point of putting resources there. How should I properly configure folders in PhpStorm?

Such setup is definitely possible -- its very common to have website root folder as a sub-folder of the actual project.
As far as I'm aware it is not possible to create such setup right from New Project Wizard -- it has to be done at later stage when project creation was completed.
You need to go into Settings/Preferences | Build, Execution, Deployment | Deployment and add new mapping. Here is an example:
Here my website root is located in web folder -- you will have to change that to yours public_html. This way when you use Open in Browser on file inside your web root folder it will be opened with correct URL.

Related

NetBeans, html5 project. What is the difference between Site Root Folder and Source Folder?

Always I store an all my front-end sources in Site Root Folder.
But today I update netbeans to 8.1 and I notice the Source Folder in the project properties.
What this folder for?
It is good explained in NetBeans Help -> Project Properties Window: Sources
Site Root Folder
The contents of this folder will be available through the web server on the production site. It contains the HTML, CSS and JS files that are publicly accessible/visible. This folder typically contains the index.html file.
Source Folder
The folder in the project that serves for server-side sources (typically node.js JS files). If the project is a JS library, JavaScript files should be placed in this folder (not in the Site Root Folder).
When you use Grunt or Gulp you should store sources and final site and different folders.

Deploying GWT in localhost and see that webpage

I am a new user in GWT and I want to deploy one of existed samples in my localhost. I could run the example by eclipse and get the result. But I need to deploy that example in my localhost (IIS). How can I do this?
Copy the contents of your project's war directory to your server's document root. You could create a folder there, mproject for example. Then load your project on a web browser: localhost/mproject to view.
Go into your project's war directory For EX:
C:\workspace\HelloWorld\war
Select all the files & folders available inside war directory.
Zip all the selected files & folders in a file called HelloWorld.zip.
Rename HelloWorld.zip to HelloWorld.war.
Deploy it to the server

404 -resource under sub-directory not found in eclipse

I am able to access a resource(say test.html) only when it is directly under WebContent in eclipse.If i place it in WEB-INF or WEB-INF/jsp the IDE shows error 404-requested resource is not available.
http://localhost:8080/MyApp/test.html (This works when test.html is under WebContent and not any of it's subdirectory)
When it is in WebContent/WEB-INF
Right click-run takes to the below URL which shows 404-resource not available
http://localhost:8080/MyApp/WEB-INF/test.html
How do i access it by placing "test.html" in WEB-INF or WEB-INF/jsp?
All configurations are default with no restrictions specified in web.xml and using Tomcat 7 as the web server
To prevent access to specific files. You cannot access /WEB-INF/ directory from outside the server itself. If you want to create subdirectory create them under
WebApp/
-index.jsp
-YourSubdirectory/
--test.jsp
test.jsp can be accessed via localhost:8080/MyApp/YourSubdirectory/test.jsp
Files at WEB-INF directory cannot be accessed directly from browser. This is the basic restriction.
However content of this directory could be accessed at application level. Web container provides such opportunity.
For example, if you using SpringMVC, you can map some URL to the file at WIB-INF directory and it will work correctly.

Problem with paths when deploying my web app

I am having big issues deploying my web app to Tomcat 5.5
My server side code must access files found under a directory parallel to my WEB-INF folder.
When on developement mode, a simple relative path (mydirectory/myfile) works prefectly.
When deployed, the sayed path does not work anymore I dont know why.
Is there a way to make it work without using any absolute path?
Here is my War directory
War
WEB-INF
Mydirectory
Myfile
Mywebbapp.html
Obtain your root folder relative to contextRoot by calling javax.servlet.ServletContext.getRealPath("/"). Then proceed with this path...
Using relative path will work, but you need to be aware of what the containers considers to be the root directory and base your relative path from there. If you specify your directory structure better, I can help you with the path - Basically try using the .. operator to move from the container root to the needed directory

jboss server root folder

how can i find which folder is the jboss root dir?
where can i find the root folder variable mentioned in a war file
IF you are looking for root folder that is right option. It would be
/opt/jboss/jboss-as
But if you want to access anything (xml, file) at root directory say using 'http://ip:port/abc.xml' url you want to open abc.xml or any file, put that file in
/opt/jboss/jboss-as/server/default/deploy/jboss-web.deployer/ROOT.war
The root folder of a JBoss AS installation is generally considered to be the ../jboss-as folder...
For example if your deploy folder would be
/opt/jboss/jboss-as/server/default/deploy
the root folder would be
/opt/jboss/jboss-as
I don't know what you mean by the variable mentioned in a .war file.
Somehow the maven-war-plugin , can solve this issue very easily. If web.xml context-root didn't work the plugin could move the application to the root of deployments on tomcat. Everything that isn't captured by a more specialized service is delegated to the application from web root /* to the web-app, :)
source : https://developers.openshift.com/servers/jbossas/deployment-options.html