Kibana dashboard not loading using Apache2 ProxyPass - elasticsearch

I'm trying to setup kibana on a server, all seems fine and curl -I my_server_address/kibana returns a 200 (when doing the curl request remotely/from another machine). However, when I try to load that same url in a browser, nothing happens. My browser console tells me the following:
Content Security Policy: Directive ‘child-src’ has been deprecated. Please use directive ‘worker-src’ to control workers, or directive ‘frame-src’ to control frames respectively.
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). kibana:372:1
The script from “http://my_server_address/kibana/bundles/app/kibana/bootstrap.js” was loaded even though its MIME type (“application/json”) is not a valid JavaScript MIME type.
kibana
Loading failed for the with source “http://my_server_address/kibana/bundles/app/kibana/bootstrap.js”.
Of which the 1st, 3rd and 4th line are warnings, the 2nd ('settings blocked the loading of a resource...') is an error. I've also set this up on another machine and testing/accessing the Kibana GUI locally works, even though I get this error (second line), leading me to believe that perhaps it's not critical.
On the server, I've setup a proxypass with apache, the relevant lines in my sites-available/000-default.conf are:
ProxyPass /kibana http://localhost:5601/app/kibana
ProxyPassReverse /kibana http://localhost:5601/app/kibana
The only things I changed in my kibana.yaml file are:
server.host: "0.0.0.0"
server.basePath: "/kibana"
I've left the rest at its default. I suspect it has something to do with the redirecting/routing of apache2, causing the GUI to look for files in the wrong place, because the curl requests work fine.
Would be grateful for any thoughts or comments.

Solved. Made a mistake in my apache confs, relevant lines from above should be:
ProxyPass /kibana http://localhost:5601
ProxyPassReverse /kibana http://localhost:5601
i.e. without /app/kibana

Related

URL for rewrite "Open html page without the .html extension"

My website with the URL1 "https://domain/#/home.html" gives
Error 404: Page Not Found
whereas the URL2 "https://domain/#/home" works as expected.
If I want to reach URL2 from URL1, I know that a change in webserver setting might just be enough.
Despite several unsuccessful attempts to get this done by simply defining a rule within the IBM HTTP Server httpd conf, I wander if mod_rewrite httpd config parameter change is what all I need to look into. Or it's anything else that can solve my purpose.

500 Internal Server Error with Wamp and Magento

I am stuck at accessing the installation page, can't seem to get it to work, it always gives me a 500 Internal Server Error error.
I have looked into some of the similar question solutions but they didn't work.
Following error you have given in your post's comment should lead you to the solution after a little search.
The problem is Magento's .htaccess file consists <IfVersion> command.
In order to use this feature mod_version module should have enabled on your Apache web server. Otherwise it will give 500 error.
In Wamp it is disabled by default.
To enable it in Wamp you can do following steps:
Find your apache config file (httpd.conf) : It usually is under /wamp/bin/apache/apache(version)/conf/httpd.conf
Open the configuration file with your favourite text editor: You can simply use Notepad. But I suggest any other one since notepad sometimes doesn't show line breaks. It will be more readable if you do (e.g. Notepad++)
Search the following text: "mod_version"
You will see following line: #LoadModule version_module modules/mod_version.so
Uncomment it, so it will become enabled: Simply delete # sign to uncomment it
Left Click on Wamp and press Restart All Services: Since you have made changes in the configuration file in order to let Apache server know about the changes you should restart at least Apache server.
Now you can check if Magento is working. If it isn't check the error log again. There might be another issue.
Following 6 steps should easily solve the error that you have provided in the comment. Also, please edit your post and add more details e.g. error log.
If first time issue after installation, probably You must enable the Apache mod_rewrite and mod_version modules, simply uncomment strings in file httpd.conf(LoadModule version_module modules/mod_version.so and LoadModule rewrite_module modules/mod_rewrite.so ) save and restart server.
https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html
Apache 2.2 or 2.4
In addition, you must enable the Apache mod_rewrite and mod_version modules. The mod_rewrite module enables the server to perform URL rewriting. The mod_version module provides flexible version checking for different httpd versions. For more information, see our Apache documentation.

Postman can't reach localhost

I am in a corporate env so I have to use a proxy to reach servers. This works well in postman and in browsers. What I can't reach is localhost in postman but I can reach localhost in the browser.
I am running Postman for Linux Version 6.0.9. I have tried reaching localhost:9082/rest/myapi.... and 127.0.0.1:9082/rest/myapi with both global proxy and system proxy turned on and with either turned on and with non turned on. In all cases I am not able to reach localhost.
What I get as an response is an error page from the proxy server! Someway the call gets out on the network instead of being kept on my machine.
The postman console:
My request headers are:
Cache-Control →no-cache
Connection →Keep-Alive
Content-Length →986
Content-Type →text/html; charset=utf-8
Pragma →no-cache
Proxy-Connection →Keep-Alive
My response headers are:
cache-control:"no-cache"
pragma:"no-cache"
content-type:"text/html; charset=utf-8"
proxy-connection:"Keep-Alive"
connection:"Keep-Alive"
content-length:"986"
My response body is an html page.
How can I make a call to localhost work with postman?
I was having similar issue with HTTP calls to local ASP.NET Core Web API apps. Changing the proxy settings didn't fix it for me.
Finally fixed it by turning off File > Settings > General > SSL Certificate Verification
I have the same issue. What works for me is:
Open File -> Settings -> Proxy
Then, enable proxy and put 127.0.0.1 : 80, if your web server runs on 80.
In the git thread, they say it is a known issue, so hopefully it will get resolved soon.
I solved this by Turning off System proxy of Postman.
Open File -> Settings -> Proxy
Then Turn off Use System Proxy
#Menuka Ishan Answer is correct. But in mac only if we change the turn off proxy won't work. You need to turn off the SSL Certificate verification also you need to disable.
I found a temporary solution:
In terminal, go to the directory where postman is installed and add:
machine#dev:~/Documents/Postman$ export NO_PROXY=localhost,127.0.0.1
machine#dev:~/Documents/Postman$ ./Postman
This will make calls to localhost work.
I found a similar problem on Windows machines here
The problem mentioned as an issue here. You should just write a simple batch file like this:
set HTTP_PROXY=
set http_proxy=
set HTTPS_PROXY=
set https_proxy=
START %LOCALAPPDATA%\Postman\Update.exe --processStart "Postman.exe"
open a simple text file, save this as a ".bat" file, and just run it!
I also faced the same issue, but the trick was I implemented both the methods that were stated earlier in the stack.
First I turned off the postman proxy as shown in below image.
Click Settings -> Proxy
And then turned off the SSL certificate verification check button.
Click Settings -> General
And then tried to hit my local server and finally it worked.
While attempting to Get https://localhost:5001/WeatherForecast via PostMan while developing a basic .NET Core (3.1) Web API (on Ubuntu Linux)
I got the error:
Could not get any response There was an error connecting to
https://localhost:5001/WeatherForecast.
I didn't notice the actual solution in the things to try at first, but if you check the highlighted text in the image you will see it.
You can see that the option is turned on in PostMan by default:
I turned the SSL Certificate Verification off and tried again and it worked.
If you are under corporate proxy and you are deploying your webapplication in localhost then no need to set proxy configuration like
http://username:password#corporateProxyServer:ServerPort in postman (Global Proxy Configuration).
As the app is deployed in local machine just use the localhost configuration in setting -> Global Proxy Configuration as :
proxy server : 127.0.0.1
port : 8300 (this is the port where the web application is running )
My problem was that i was setting an invalid Header token and it gave me the error
Error: Header name must be a valid HTTP token ["Accept "]
Warning: This request did not get sent completely and might not have all the required system headers
Just check your Headers.
Adding another potential answer to this for people to check after they've tried the other ideas here.
I was able to solve my own problem by checking the Postman console (View -> Show Postman Console) and then examining the error from the request (in my case it was because I had a newline character on an auth token).
In my case, I had to precede the localhost with https://
These steps solved this issue after 1 whole day struggle:
1) HTTP_PROXY= proxy.company.com:port
HTTPS_PROXY=proxy.company.com:port
to user variables, not to System variables. Make sure the the case is all cap.
2) Updating newtwork driver, and turning on Windows Defender......Make sure you don't see no reds in here.
I was not able to make any calls from postman to docker container running Couchbase Server. Very frustrating. Turns out I had proxy setting configured to some aws instance which has been long deleted.
Goto setting and remove the proxy setting and it worked like a charm on localhost/127.0.0.1/mac laptop eno IP addr or 0.0.0.0
In my case, I was using django-tenants and had to add the domain for the tenant in etc/hosts to get it working on localhosts. My entry for 127.0.0.1 now looks like
127.0.0.1 localhost test.localhost
My problem was forgetting to select Environment. From the drop down where you see No Environment in the image, select the name of your environment.
Menuka Ishan's solution above saved my hours of pain! I left the Global Proxy Configuration switched ON and changed the Proxy Server to 127.0.0.1. Switched OFF the Use System Proxy. I already had the entry 127.0.0.1 localhost in my hosts file under the path C:\Windows\System32\drivers\etc.
If you have active proxy in your system then make sure Global Proxy Configuration and Use System Proxy are turned off. To do this go to Postman preferences > Proxy. You can also try sending a request in postman without typing localhost (e.g. :8080/send)
i think i also found a perfect fix.
First you turn on global proxy configurations, add your local machine Ip which is 127.0.0.1,then also add localhost in the bypass.
Also turn off SSL verification.
It worked for me
This worked for me, i dissable the parrameter host in the header.
HOST Disabled
If anyone is looking for a solution to WooCommerce local install, here are the steps to make this work:
Go to Wordpress Admin > WooCommerce > Settings > Advanced
Create new API key, give it a name
Copy the Consumer Key & Consumer Secret to
your text editor
Open Postman
Create new connection Set the URL for
testing (GET) : http://mylocalsite/wp-json/wc/v3/orders (change
"mylocalsite" to yours)
Click on Authorization tab
Now here is the main change: Although in WC Rest docs, it says to use the "Basic Auth" - IT WILL NOT WORK. Since usually your localhost is HTTP
and not HTTPS. So "Basic Auth" is not relevant in our case.
You will need to change the Authorization to OAuth 1.0
Set Consumer Key & Consumer Secret respectively as it shows in Woocommerce
Click "Send" - it should work now
If still you have problems, try one by one the following:
File > Settings > Turn off SSL Verification
File > Settings > Turn off "Automatically follow redirects"

XAMPP + WAMP very slow over the weekend?

I use xampp for half a year now, with xdebug and some other extensions. Everything is fine but now, over the weekend it magically went horrible slow. Does not matter if i enter "localhost", "127.0.0.1" or my LAN-IP.
So i installed WAMP. As i know now, WAMP for x64 is a waste of time - (CURL not working) so i installed WAMP x32.
CURL is working so far but the page still takes over a minute to load! Not building the page, not processing the code, to me it looks hardly like it takes a minute to start processing.
Sadly, can anyone recommend a fully working php-apache-mysql bundle for windows that is working as expected with all provided extensions in 2014?? Would be nice if that package/software (if it exists) would work as expected without need to modify registry, systemfiles, dll's and without spending hours and hours to get a simple page-request working.
Last but not least, the content of my host-file:
#::1 localhost
127.0.0.1 localhost
127.0.0.1 127.0.0.1
I tried really everything i found on the web so far. Nothing helps. Theres a similar question to this on Stackoverflow - without any useful (fixing) answer.
Collective Information:
XAMPP and WAMPP are slow
localhost/127.0.0.1/LAN-IP in URL does not
affect performance
the webserver does not take long to perform
requests
the websever does need about 60 seconds to recieve a request
cross-browser tested
with killed session tested
You could try removing the line
127.0.0.1 127.0.0.1
from your HOSTS file.
It is an illegal instruction anyway, but I have know it to cause loops. Does you PHP error file or Apache error file tell you anything useful?
Was this something you added, just before the system slowed down?
ADDITIONAL SUGGESTION:
Also changing these settings has been known to help on Windows systems, you may need to add then to your httpd.conf if they dont already exist.
AcceptFilter http none
AcceptFilter https none
In wamp php.ini turn off displaying errors and change type of displaying errors! :)
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
display_errors = Off
enter php.ini via wamp
edit these lines
Enable gzip
a) enable apache modules: deflate_module and headers_module
b) than paste code below to ur main wordpress folder .htaccess
<IfModule mod_deflate.c>
<FilesMatch "\.(html|php|txt|xml|js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

apache url rewrite not working but redirect works, why?

I'm using an repackaged version apache which is called IHS (IBM HTTP Server). Basical the same as apache web serve with other features. What I'm trying to accomplish is to apply the rewrite rule to hide the complicated url with query strings with a shorten url.
Originally when I first test this out with 'R' Flag it work fine. It was able to match the pattern and response with the proper long url by redirecdt to the final url.
eg: https://example.com/us/ABC/123 -> https://example.com/webapp/headerText=ABC&categoryId=123
But after I have remote the 'R' flag, my rewrite failed with message of " File does not exist: /opt/IBM/HTTPServer/htdocs/dmcst/webapp". I'm trying to show the shorten url without given user the full url. The /webapp/.. is not an local path but rather it is a some other remote path. Why would this fail for 'rewrite' but not 'redirect'?
RewriteEngine on
Alias /wcsstore "/opt/IBM/WebSphere/AppServer/profiles/dmcwcsst/installedApps/WC_dmcwcsst_cell/WC_dmcwcsst.ear/Stores.war"
Alias /wcs "/opt/IBM/WebSphere/AppServer/profiles/dmcwcsst/installedApps/WC_dmcwcsst_cell/WC_dmcwcsst.ear/CommerceAccelerator.war"
Alias /static "/opt/IBM/content"
RewriteRule ^/us/([a-z].)/([0-9].)/?$ /webapp/wcs/stores/servlet/AcquisitionBrowseView?langId=-1&storeId=10001&catalogId=10051&headerText=$1&categoryId=$2 [NC,R,L]
From the WebSphere documentation:
http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.multiplatform.doc%2Finfo%2Fae%2Fae%2Fujpx_rewrite.html
Rewriting rules define how the proxy server rewrites URLs. Responses
that have been redirected by target servers typically return a 302
status code with a location header that defines the URL that the
client should be redirected to. Rewriting this URL is necessary if the
target server is not aware of the proxy servers. The redirected URL is
modified to correctly point clients to the proxy server instead of
directly to a target server that may not be visible to clients. Use
the following properties to configure the URL rewriting rules for a
proxy server
Avoid trouble: The proxy server only supports rewriting redirected
responses. Therefore, these the following settings only apply to
redirected responses. These settings do not apply to requests because
the proxy server does not support URL rewriting for requests.
I had the same issue
It looks like WAS plug-in in not friendly with mod_rewrite
So WAS module declaration (LoadModule was_ap22_module ...) was moved to the bottom of httpd.conf
In my case it helped

Resources