Intellij idea opens static pages in browser with different url formats - intellij-idea

Intellij idea has a nice "open in browser feature" that I use quite often for my static html files. Any html file can be opened in browser in two ways: 1. Idea has an internal web server that serves static content at http://localhost:63342/<relative path to content> . 2. Via file:///<absolute path> url.
After a recent update (14.0.2) the browser started to open pages as file:///<absolute path> although the internal web server is still present and all I need to do is edit the url. Very annoying. I searched a lot but still can't figure out how can I influence this behaviour so all my static pages would open in browser as http://localhost:63342/<relative path to content>

Specify the server connection settings:
In the Host text box, type localhost.
Use the Port spin box to specify the number of the port where the built-in web server runs. The port number should be set to 1024 or higher. By default this port is set to the default IntelliJ IDEA port through which IntelliJ IDEA accepts connections from services (63342).
Specify the folder that will be considered server document root. The folders that are under this document root in the project tree will be submitted to the PHP interpreter. The server document root folder will be accessed through HTTP at the above specified host:port.
In the Document root text box, specify the path to the relevant folder. This can be the project root or any other folder under it.
References
Idea Docs: Built-in Web Server

Related

Virtual Directories not working in ColdFusion Builder 2016

I'm trying to set up virtual directories through the built-in Apache Tomcat 8 server using the ColdFusion Builder 2016 interface, however to my surprise this simply does not work, yet according to the documentation it should.
The only thing that I've modified was the web root directly in the server.xml file.
That said the website runs correctly, except when trying to reference a resource from a virtual directory which simply returns HTTP Status 404.
Web Structure
ColdFusion Builder Interface
The process when using the interface is as simple as:
Creating a virtual host;
Clicking the "Virtual Directory" button and setting up the directories; and
Applying the changes and restart the local server.
Ultimately this should allow me to navigate to the files (CSS, JS, Images) directly through the web browser.
Could I be missing a specific setting in a configuration file due to manually changing the web root? If not what am I missing?

How to run app from root url (localhost:port/) instead of (localhost:port/path/index.html)

This is a problem that I have when I run/debug the app from Webstorm.
The run/debug configuration dialog doesn't give us much to work with, we can just specify the path of the index.html file there.
I wanna be able to set up a configuration similar to what yeoman's angular generator gives us out of the box.
WebStorm built-in web server serves the project from 'http://localhost:<built-in server port>/<project root>'. If you like to change the default web path on built-in web server, you have to re-configure the server by editing your system hosts file accordingly - see http://youtrack.jetbrains.com/issue/WEB-8988#comment=27-577559. But, as it's mentioned in this comment, there are currently some issues with serving dart apps on server configured this way.
Please follow WEB-14047 for updates

Need to change the apache default home page

I am new to apache.I installed apache in my windows, I am having my own html page with css.I want to set this page as my default apache home page and instead of typing http://localhost:8080, i have to type http://vignesh to view my home page.
How to do this..Guide me
I think your question is split into 2 things: The ability to use http://vignesh as opposed to http://localhost:8080, and the option to change the default home page.
In order to get the url that you want working, you need to modify a file in windows (assuming you're on windows 7) do the following:
Launch notepad (or any other text editor) with administrative privileges
Open the hosts file located at: C:\Windows\System32\drivers\etc
Add the following entry to it: 127.0.0.1 vignesh
In order to change the default page you need to change the apache configuration.
Open httpd.conf in your favorite text editor
Locate the property called DirectoryIndex. Change it to the page that you want.
I hope that was helpful.
When you type an address in a browser, the browser relies on the operating system to resolve it. Only once it has been resolved, a request is sent to the actual server (in this case, your apache installation).
Because of this, you can't alter how the "server" part is resolved through apache itself: it is your Windows system which handles that and, if appropriate (this is, if it resolves to localhost at the port where your apache is listening), forwards it to apache.
So, you need to alter how Windows, rather than apache, resolves that address. Fortunately, for your situation, it's relatively easy to tweak, if you know what to look for (and I am telling you here, so you know ;) ):
Open the file %SystemRoot%\system32\drivers\etc\hosts on a plain text editor, such as notepad (%SystemRoot% is window's base installation path, such as C:\Windows or C:\WinNT), and add a line like this at the end:
127.0.0.1 vignesh

Need to access remote files from Apache server

I am new to Apache.
I am running apache tomcat in windows and using JSP as the server side language.
I have a page containing links to the files (different machine) as below:
TheButterflyEffec(2004).avi
Superbad.avi
Why OnClick, saveAs is not working?
It is working if i save the page locally.
Do I need to configure anything in server.xml?
If the files are loaded on the machine running the apache then you need to look of two thinghs...
Put the files in a directory inside the apache root directory
In the <a href specify the file location with the ip address of it
(i.e. if your apache is on a machine with IP 192.XXX.XXX.XX then give the a href as follows
<
a
href='http://192.XXX.XXX.XX/folderWherefilesare/filename'>
filename < / a>
It's not working because the browser look for those files on the local visitor machine, not on the server.
You have to build "proxy" code with server side language like PHP that will get file name as parameter, e.g. Download.php?file=TheButterflyEffec(2004).avi then read the file from the server disk and send the file contents to the browser.
If you're using PHP indeed, here is an article describing what you can do:
http://www.boutell.com/newfaq/creating/forcedownload.html
Otherwise let us know what server side language you can use and retag your question according to this.

Link to file outside context root of weblogic

If I want to display an image in my webpage and its src is a file outside context root.
At the IDE, the image is shown to be loaded.
But when I test the web page, nothing displayed.
How can I config weblogic server to allow the image to be displayed. If not is there anyway to run around this problem.
Thanks a lot.
You can use the Virtual Directory Mapping feature (that you declare in the weblogic.xml):
Using the virtual directory mapping
feature, you can create one directory
to serve static files such as images
for multiple Web Applications. For
example, you would create a mapping
similar to the folowing:
<virtual-directory-mapping>
<local-path>c:/usr/gifs</local-path>
<url-pattern>/images/*</url-pattern>
</virtual-directory-mapping>
A request to
http://localhost:7001/mywebapp/images/test.gif
will cause your WebLogic Server
implementation to look for the
requested image at:
c:/usr/gifs/images/*.
This directory must be located in the
relative uri, such as
"/images/test.gif".