xampp Apache enable proxy for interent operations - apache

I have followd this answer https://serverfault.com/a/249582 to enable proxy and put a line to forward internet operations. However, since I use http://localhost to browse my website, it also redirected localhost to the proxy server and thus my website cannot even load.
How can I bypass local addresses such as localhost, 127.0.0.1 or internal network IP such as 192.168.1.50, such that fopensock can work normally?

Related

How to use SSL-certificates to call https://localhost with apache2 on Raspberry Pi

So I am currently working on a project where I use the Instagram API to get some user Data onto my Localhost webpage on the Raspberry. The API however needs secure redirect uri (https). But when the API wants do redirect to https://localhost/instagram it says
"404 Not Found The requested URL /instagram was not found on this server. Apache/2.4.25 (Raspbian) Server at localhost Port 443"
In the url-bar it says "Not secure", the https part is marked red and is crossed out. When I test my stuff on another computer which has Xampp and Apache running everything works fine and even if I type https://localhost it redirects straight to localhost.
I found out that I might need a SSL certificate in order to make use of https links even if I'm running on localhost. But I don't really know how I should do this on my raspberryPi. There are already some SSL modules enabled inside the Apache2 folder.

Remote access of network computer

I am not sure how or if this can be done. I have a home network and would like to see a computer,not the server, via a remote location. I have Apache on my server. Example: the network computers I would like to see ip 152.254.1.33. Is there a way to add this ip to Apache root directory? I have tried to add a shortcut with in the root directory and it only works on the home network, will not via remote connection.
I need some clarification here on what you are trying to acomplish, are you trying to access the Apache website outside of the local network?
If that is the case, Apache is automatically set to listen on all network interfaces, you can check this in your virtual host configuration in the sites-enabled directory of your apache installation.
You should see something like in the 000-default.conf
You can test if apache is serving pages up correctly using the command
curl 127.0.0.1
You should see the HTML of the page being served.
If this is the case, then it's likely the firewall on your machine/router or your ISP is blocking the required ports. You can allow Apache through the firewall on Ubuntu using sudo ufw allow Apache Full
If you give me some more info in comments we can probably work this out.

apache not serving index.html unless specified

Im new to setting up apache - the site works fine on localhost but when I access it from the LAN it does now display the index.html file - instead the browser says:
This site can’t be reached
localhost refused to connect.
Ive tried editing the apache2.conf file but nothing seems to work
I think you made another mistake. When you are on a different Computer on you network, the Apache server is not available on http://localhost/ but on the domain name or IP of the Apache Server.
The browser tries to open a connection to your client computer. But its not on localhost.

how to access local host in wamp when using proxy server

I am using proxy server address proxy1.xxx.xxx.xx to connect the internet using port number 8888 and when i want to connect to my localhost project it bring error
The requested URL could not be retrieved
but if I did not use proxy server it work correctly
how can I configer to connect with proxy server on. I am working in wamp server
here is my httpd.conf
ServerName localhost:81
HostnameLookups Off
The proxy can't see your local server because it only exists on your machine, and can't be accessed from the outside.
If you tell the proxy "connect to localhost", the proxy tries to connect to 127.0.0.1, which is its own machine, not yours.
If you want to do so, you must configure your webserver and router to accept remote connections on that port, and give the proxy your public IP address instead of localhost
Try to allow the proxy to by-pass local addresses and add your localhost to the list of exceptions. To do so using Chrome:
Go to Settings, Advanced Settings
Navigate to, Change proxy settings then LAN Settings
Click on the checkbox, Bypass proxy for local addresses as shown in the image below.
Check: Bypass proxy for local addresses
This should allow you to access your localhost from behind the proxy server.

GeoServer under https

i am using apache web server on localhost:80 and Geoserver served from tomcat on localhost:8080
I recently installed SSL certificate on apache and it works fine except for that i get the message that says i have insecure content which i thought they were GeoServer layers. So now I'm trying to enable SSL for GeoServer and have Openlayers content like htis https://example.org:8080/geoserver but still not sure what's the best approach to do that.
My suggestion:
Add a (reverse) proxy in Apache and configure your web application that is connects only to the Apache proxying the GeoServer.
ProxyPass "/geoserver" "http://localhost:8080/geoserver"
ProxyPassReverse "/geoserver" "http://localhost:8080/geoserver"
This way you only need to allow HTTPS in the firewall and nobody from outside will have the chance to reach GeoServers web interface unless you enable port 8080 on the firewall. Also see https://gis.stackexchange.com/q/4323/109339 for further details.
Please note that you should set the https://docs.geoserver.org/stable/en/user/configuration/globalsettings.html#proxy-base-url of GeoServer with the public reachable URL via your Apache, e.g. https://your-apache.com/geoserver - otherwise the absolute URLs generated from GeoServer in e.g. GetCapabilities start with http://localhost:8080/geoserver (which is not reachable anymore).
If you had not already Apache in use, I would recommend nginx.