IntelliJ markdown: how to open localhost links in browser? - intellij-idea

When I click localhost links in the markdown editor of IntelliJ Ultimate 2020.3 nothing happens: i.e. I'd expect the link to be opened in the browser
Links localhost links that end with .html work (i.e. the link is opened in the browser)
here is a test-markdown file to illustrate the issue:
IntelliJ Ultimate 2020.3 (build 30.Nov.2020)
Following links do not work (i.e. the browser is not opened)
* http://127.0.0.1/
* http://127.0.0.1:8080/
* http://127.0.0.1:8080/ngsw/state
* http://localhost:8080/
* http://localhost/
* http://localhost:8080/ngsw/state
Following links work:
* http://127.0.0.1/index.html
* http://127.0.0.1:8080/index.html
* http://localhost:8080/index.html
* http://www.google.com
Is this a bug or some kind of security setting, that can be changed?

Related

localhost opens folder structure instead of main page - WAMP

my localhost wamp page was working fine but due to some reason it opens the /index of page.
I need to get the main home page back. I have seen some solutions to the previous answers but all my settings are exactly as advised.
"LoadModule autoindex_module modules/mod_autoindex.so" is uncommented in the httpd.conf file.
Any help on this would be amazing.
Apache version is 2.4.41
OS: Windows 10
Cheers!

Apache is working but wont connect to localhost ..why?

Just installed xampp and started all services including Apache but still somehow cannot connect to my localhost server still when i write the address 127.0.0.1 it shows that message that it works.
Someone with an idea whats happening
Are you using Windows or Linux (eg., Ubuntu, Debian, Fedora, etc.)?
If you are using Windows 7/8/10, it should work without this steps, but do the following if not working with these Operating Systems:
1) Press Win+R
2) Type notepad, and then press Ctrl+Shift+Enter
3) Click on File, click Open, go to C:\Windows\System32\drivers\etc and click on the hosts file.
4) Add the following (if not exists) at the end of the file or the start of the file:
127.0.0.1 localhost
5) Click Save, and it should work without any restart.
If you are using Linux, do the following:
1) Open the Terminal, type nano /etc/hosts
2) Add the following (if not exists):
127.0.0.1 localhost
3) Now, press Ctrl+X, and press Enter
The above should solve your problem, but if not, please let me know.

configure Apache reverse proxy to work with CKAN dataset preview

I tried to configure Apache's reverse proxy on a running CKAN instance; most pages work, with a few exceptions (notably data preview and user login).
What I did: I’ve set up a CKAN instance using docker, at http://my.intranetwebsite.fr:8082
I’ve deployed it into : http://cybis.univ-grenoble-alpes.fr:8082
(port 80 is already used).
Tests shows that everything worked well on port 8082.
I now want to have this web page accessible on port 80. We use apache’s reverse proxy for several services on this website, so I’ve added this to /etc/apache2/apache2.conf
<Location /data>
ProxyPass http://localhost:8082 retry=0
ProxyPassReverse http://localhost:8082
SetOutputFilter proxy-html
ProxyHTMLURLMap http://localhost:8082
</Location>
RewriteRule ^/data$ /data/ [R]
And I've changed the parameters in production.ini:
ckan.root_path = /data/{{LANG}}
ckan.site_url = http://cybis.univ-grenoble-alpes.fr
And restarted apache on the host, and restarted the container.
Everything works fine on :80/data except the login, and a strange behaviour for the data explorer: it gets an iframe with the home page of the ckan in place of the explorer.
Thank you for any help
If you use ckan.root_path then think you may well have to change the paths in who.ini too, e.g. login_form_url = /data/user/login.
For the Data Explorer, maybe someone else can suggest. One of his example URLs is here: http://cybis.univ-grenoble-alpes.fr/data/dataset/militarized-interstate-disputes-v4-3/resource/55ed7ecb-841b-47c0-80cd-65fa80a04401 and shows a 404 error in the iframe where the preview should be.

Wampserver did not work on localhost

I just installed Wampserver. after installing it, the icon color is green and say the server is online. then I tried localhost on my browser. it showed "the site can't be reach" but when I entered http://127.0.0.1/ it works and displays Wampserver homepage. Why it did not work when I entered "localhost"? it only can enter http://127.0.0.1/ . Is there something that I must change in the settings? when I tried to change the port be port 80, it showed "CLI stop working".
localhost does not exists automatically. Its actually a domain name you have to create on your PC. You do this by adding it to your HOSTS file.
Edit the file C:\windows\system32\drivers\etc\hosts
Add these lines to it
localhost 127.0.0.1
localhost ::1
You also need the ::1 version as well as that is IPV6, and lots of browsers will attempt to use the IPV6 network in preference to the IPV4 (127.0.0.1)
You will have to be an Administrator to edit this file as it is protected by windows.
Or open your editor by right clicking on it, and selecting the "Run as Administrator" menu option.

Apache configuration: automatic renaming of "file:///C:/xampp/htdocs/" to "localhost" in url when opening a local html file

I'm new to web development so bear with me. I might be missing something despite all my searches.
When I open an html file (of course from a directory served by Apache), it opens in a browser but the url is:
file:///C:/xampp/htdocs/path/to/file.html
This way it does not get served by Apache, so for that to work I have to rename the host-part of the path to the host's name. So if the host-path is
C:/xampp/htdocs/
then I have to rename that part of the url to the hostname, in this case "file:///C:/xampp/htdocs/path/to/file.html" must be renamed to "localhost/path/to/file.html" if Apache is to serve the page.
I've tried adding a virtual host that includes the "file:///" in its path but that crashes Apache (and xampp).
Question: Is there a way to avoid this manual renaming of urls when opening local html files to be served by Apache?
I know it's been a while since this thread had any activity, but I've created a Chrome extension exactly for this scenario.
The name is Localhost Automate, and it redirects the developer to http://localhost according to a predefined folder.
https://chrome.google.com/webstore/detail/localhost-automate/pplnfonehjimoddpmnhldhkgojhkjcfh
And there's also the github repo; https://github.com/Ardethian/localhost_automate
Made a little "url2hostname" extension to chrome that saves me the 1.42 seconds of url clicking and renaming every time i open a local html file in chrome. I'll write it down for consistency and repetition.
I have a virtual host set up for a dropbox directory. So in httpd-vhosts.conf:
<VirtualHost *>
DocumentRoot "C:\Users\hns\Dropbox\Webb"
ServerName localhost
<Directory "C:\Users\hns\Dropbox\Webb>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory> </VirtualHost>
So in "C:\Users\hns\Dropbox\Webb" is where I keep lots of webpages that I just want to test locally (and they must be served by apache to work properly). When I open them in chrome the url gets messed up like "file:///C:/Users/hns/Dropbox/Webb/f/index.html" for example. So in this case I have to select the "file:///C:/Users/hns/Dropbox/Webb"-part of the url and rename that to the servername so it becomes: "http://locahost/f/index.html".
So when I've opened a local html file and click the chrome extension it just replaces the path and protocol in the url and goes to the resulting url (which is then loaded correctly):
chrome.browserAction.onClicked.addListener(function() {
chrome.tabs.query({'active': true, 'currentWindow': true}, function (tabs) {
var currentURL = tabs[0].url;
newURL = currentURL.replace("file:///C:/Users/hns/Dropbox/Webb", "http://localhost");
chrome.tabs.update(tabs[0].id, {url: newURL});
})
});
Hey, at least I learned something :)
EDIT:
The real problem was not Apache but Chrome and cross origin:
Due to the "same origin policy", sometimes sites content cannot be properly displayed locally. So in my case the problem could have been solved by just turning that policy off by starting chrome from a shortcut with flags like –allow-file-access-from-files or
–disable-web-security.
I found a better way, no extensions needed, and works for every browser.
Edit httpd-vhosts.conf file (In my system E:\xampp\apache\conf\extra and edit httpd-vhosts.conf)
Add the below lines and save the file, don't delete anything
"VirtualHost *:80
ServerName localhost
ServerAlias localhost
DocumentRoot e:/xampp/htdocs //or whatever link you want//
/VirtualHost"
Restart Xampp