If I launch with localhost, everything is fine and I can debug. If I launch with otherHostName, I land on a "404 Not Found - WebStorm 7.0.2" page.
I did add otherHostName in the host file.
So you are using built-in web server.
In this URL "web" is the PROJECT NAME (that's how IDE identifies what project to use when serving files).
In this URL PROJECT NAME is the host name.
Thank you very much for your answer. A temporary solution would be to name the project the same than the origin I want to send to the server e.g. otherHostName.
What I d'ont understand, Is why http://otherHostName:63342/PROJECT_NAME/index.html is not working, since in my host file, otherHostName is pointing to 127.0.0.1 (same as localhost). Hopefuly you got a solution for that also!! Thanks again.
EDIT: I just tried http://web:63342/index.html and it does not work.
When IDE sees something different than "localhost" as domain name, it applies different URL structure (the olready mentioned http://localhost:63342/PROJECT_NAME/index.html vs http://PROJECT_NAME:63342/index.html -- as you can see there is NO "PROJECT_NAME" ("web" in your case) in the path). It should be http://otherHostName:63342/index.html in such case -- and this assumes that "otherhostName" IS the project name.
This assumes that your project name is "web" -- correct?
It works perfectly fine here -- tried that on multiple occasions in the past (assuming that you have pointed "web" to 127.0.0.1 in your hosts file or local DNS server).
To avoid confusion, better show your real host names/project names.
Ahh ok! This explains why I've had so much problems trying to do it with a virtualhost.
Yes, this is correct. So I have to point web to 127.0.0.1 in hosts file?
Sorry for the confusion, "web" is my real project name, it was by default when I checkout from SVN.
If I point "web" to 127.0.0.1 in my hosts it work!
But I don't understand why otherHostName is not working since it's also pointing to 127.0.0.1 in my hosts...I know it's not the name of the project, but even if "web" is the name of my project, both otherHostName and "web" are pointing to 127.0.0.1.
Once again: built-in web server needs to know *what project to use* to serve files from (same as proper webserver (Apache/nginx/IIS/etc) uses host name for that)..
Ok! I get it! Thank you very much for your precious help.
I'm having another problem with this. The project name is "test" and the URL in the debug config is http://test:63342/index.html. The Debugger port is 63342 and "test" is pointing to 127.0.0.1 in the hosts file. Now it doesn't work when I try to debug. I think the problem comes from the Chrom plug-in, when I put "test" in the host input, it kind of disables the plugin and when I try to debug, I get this message: Please ensure that JetBrains IDE Support extension is installed and enabled in Chrome.
What exactly do I have to enter in the host input? It seems like everything I enter in the host input except localhost disabled the plugin. Also I tried with localhost, but I still does not work.
I know I could use localhost:63342/test, but I really need to use a custom hostname.
Ok so I found the solution. I need to point 127.0.0.1 to "test", not the opposite.
Please can you provide your hosts file contents?