Access Geoserver From Internet Ubuntu Server 14.04.1 - apache2

i'm triying to getup geoserver on IBM Server with Ubuntu Server 14.04.1, i have try making a file in /etc/apache2/sites-available/geoserver.conf and the information in it was:
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /geoserver "http://localhost:8080/geoserver"
ProxyPassReverse /geoserver "http://localhost:8080/geoserver"
I access to my server via a subdomain in NO-IP, but a i can't make it work the geoserver, like this; my.subdomain.com/geoserver
A will give any information you need, i really need some help with this.
Thanks.

Well after a lot of research and try lot of things, I understood where I have to put this lines, to set up ProxyPass for GeoServer public data access:
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /geoserver "http://localhost:8080/geoserver"
ProxyPassReverse /geoserver "http://localhost:8080/geoserver"
In almost every tutorial that I read, they all explain how to access via internet to GeoServer, using httpd sever, where you have to add the lines of ProxyPass in the archive httpd.conf, in the route:
/etc/httpd/conf/httpd.conf
But since I'm using apache2 server instead of the httpd server, the code to use ProxyPass must be put in in the file 000-default.conf and the route is:
/etc/apache2/sites-avaible/000-default.conf
The code have to be between the labels:
<VirtualHost *:80>
"some code and comments"
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /geoserver "http://localhost:8080/geoserver"
ProxyPassReverse /geoserver "http://localhost:8080/geoserver"
</VirtualHost>
Hope this helps.
Any errors you see from me feel free to comment.
Greetings to all.

Related

Obtain part of url in proxy balancer from one balancer member

I have cluster setup of Apache server . Behind this I have 2 Jboss instances which is load balanced by apache.
The configuration look somewhat like the below
<VirtualHost *:1111>
ServerAdmin admin#example.com
ServerName www.example.com
DocumentRoot "/apps"
ErrorLog "logs/https.www.example.com.-error_log"
TransferLog "logs/https.www.example.com-access_log"
LogLevel warn
<Directory "/apps">
Options -Indexes +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
SSLProxyEngine On
SSLProxyVerify On
SSLProxyMachineCertificateFile "/apps/apache/conf/ssl/int/proxy.pem"
SSLProxyCACertificateFile "/apps/apache/conf/ssl/int/cert.pem"
RewriteEngine On
Header set Cache-Control "max-age=60, public"
<Proxy balancer://2node-aa>
BalancerMember https://app01:8089 route=node1
BalancerMember https://app02:8089 route=node2
ProxyPreserveHost On
ProxyPass /aa balancer://2node/aa stickysession=JSESSIONID|jsessionid
ProxyPass /static balancer://2node/static stickysession=JSESSIONID|jsessionid
ProxyPassReverse /aa balancer://2node/aa
ProxyPassReverse /static balancer://2node/static
ProxyPass /1/aa https://app01:8089/aa
ProxyPass /2/aa https://app02:8089/aa
ProxyPassReverse /1/aa https://app01:8089/aa
ProxyPassReverse /2/aa https://app02:8089/aa
ProxyPass /bb balancer://2node/rest stickysession=JSESSIONID|jsessionid
ProxyPassReverse /bb balancer://2node/bb
</VirtualHost>
In the url access certain part of the url i want it to be routed from second node i.e node2 of jboss.
e.g. if i am accessing http://www.example.com/aa/login/login.jsp i need this request to be process by node2 app02 only.
Rest of the request should load balance as normal access.
How do i set the apache to do it ?
I have tried lot of rewrite,<Location> and ProxyPassMatch none has worked so far.
Please Help. Thanks in advance.
I used the below statement in the configuration file which resolved the issue.
<Proxy balancer://2node-aa>
BalancerMember https://app02:8080 route=node2
</Proxy>
RewriteRule ^/aa/login/(.*)$ balancer://2node-aa%{REQUEST_URI} [P,QSA,L]
This link help me.
apache httpd mod_proxy load balancing with multiple virtual hosts url redirection
-Thanks

Reverse proxy with websocket mod_proxy_wstunnel

I have a problem with the web sockets and my reverse proxy Apache, I have upgraded in latest release 2.4.5 and loaded the module mod_proxy_wstunnel.
The httpd.conf :
<VirtualHost *:80>
ServerAdmin webmaster#localhost
ServerName www.toto.fr
ServerAlias toto.fr
ProxyPass /my_app http://1X.X.X.1:8080/my_app
ProxyPassReverse /web_pmr http://1X.X.X.1:8080/my_app
ProxyPassReverseCookiePath /my_app /
ProxyPassReverseCookieDomain localhost my_app
ProxyRequests off
ProxyTimeout 15
#WEBSOCKETS
ProxyPass /my_app/BasicWebsocketServlet ws://1X.X.X.1:8080/my_app/BasicWebsocketServlet retry=0
ProxyPassReverse /my_app/BasicWebsocketServlet ws://1X.X.X.1:8080/web_pmr/BasicWebsocketServlet retry=0
ErrorLog "logs/my_app_error.log"
LogLevel debug
CustomLog "logs/my_app_access.log" combined
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
When I test in my local URL, websockets are working but with the reverse proxy Apache, there is no trace in Tomcat logs.
This line:
ProxyPass /my_app/BasicWebsocketServlet ws://1X.X.X.1:8080/my_app/BasicWebsocketServlet retry=0
needs to come before this one:
ProxyPass /my_app http://1X.X.X.1:8080/my_app
Explanation (from https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass):
Ordering ProxyPass Directives
The configured ProxyPass and ProxyPassMatch rules are checked in the order of configuration. The first rule that matches wins. So usually you should sort conflicting ProxyPass rules starting with the longest URLs first. Otherwise later rules for longer URLS will be hidden by any earlier rule which uses a leading substring of the URL. Note that there is some relation with worker sharing. In contrast, only one ProxyPass directive can be placed in a Location block, and the most specific location will take precedence.
For the same reasons exclusions must come before the general ProxyPass directives.

balancer-manager not accessible

Whenever I try to access /balancer-manager in the browser, I get a 404 from the connected Tomcat cluster. Any idea what is wrong here?
Environment: Apache/2.2.10 (Linux/SUSE)
<VirtualHost *:443>
ProxyPass /balancer-manager !
ProxyPass / balancer://myalfresco-cluster/ nocanon
ProxyPassReverse / balancer://myalfresco-cluster/
<Proxy balancer://myalfresco-cluster>
BalancerMember ajp://server1:8009 route=jvm1
BalancerMember ajp://server2:8009 route=jvm2
ProxySet stickysession=JSESSIONID
</Proxy>
<Location /balancer-manager>
SetHandler balancer-manager
Order Deny,Allow
Allow from all
</Location>
<Location />
[cluster config]
</Location>
</VirtualHost>
There can be two issue.
You are somehow blocked by your .htaccess.
Check your Document Root .htaccess file.
Add this line "RewriteCond %{REQUEST_URI} !=/balancer-manager" without quote if the rewrite engine is on.
Another problem that I did not face but people has reported is your wild card virtual host tag.
Replace the wildcard with actual ip.
I felt obliged to answer this question since I wasted much time trying to find a solution to the problem and I landed on your question quite often through google but without answer.

How Can I Proxy To Multiple Application Running in Tomcat via mod_proxy

I have 2 web applications running under Tomcat6. Currently, I can access one of them via mod_proxy with the following config...
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin email#email.com
ServerName staging.domain.com
ProxyPass /app1 http://localhost:8080/app1
ProxyPassReverse /app1 http://localhost:8080/app1
</VirtualHost>
Now, I can access app1 via http://staging.domain.com/app1. I also want to be able to access app2 the same way: http://staging.domain.com/app2. I configured a second VirtualHost however, only the first one works. Is this even possible, to proxy 2 web apps under a single domain? If so, any hints, tips, tricks would be greatly appreciated.
Ah, you're already pretty much doing it: just add extra ProxyPass/ProxyPassReverse statements.
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin email#email.com
ServerName staging.domain.com
ProxyPass /app1 http://localhost:8080/app1
ProxyPassReverse /app1 http://localhost:8080/app1
ProxyPass /app2 http://localhost:8080/app2
ProxyPassReverse /app2 http://localhost:8080/app2
ProxyPass /app3 http://localhost:8080/app3
ProxyPassReverse /app3 http://localhost:8080/app3
</VirtualHost>

Apache LoadBalancing, sticky session, and Spring security framework

I have a public facing Apache 2.2 webserver that I've configured to proxy and balance requests to back-end web applications deployed on Tomcat 6.0. I am using Spring FW + Spring security framework as technology stack, therefore the application is using a cookie with jsessionid. The snippet below is from the Apache configuration:
ServerName abc.mydomain.com
ProxyRequests Off
ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On scolonpathdelim=On
ProxyPassReverse / balancer://mycluster/
<Proxy balancer://mycluster >
BalancerMember http://10.179.40.165:8080/abc
</Proxy>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
Order allow,deny
Allow from all
</Location>
The problem is that Spring Security will redirect to invalid session url on any request after a successful login. What can I do to solve the problem?
Thanks
Peter
i just had this issue as well.
found the answer in https://stackoverflow.com/a/9951315/1211174
here is my configuration:
<VirtualHost vm1.mydomain.com:443>
ServerName public.domain.name
<IfModule mod_proxy.c>
ProxyRequests Off
ProxyTimeout 5400
#should be the otherway. white list instead of black list
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Proxy balancer://mybalancername>
BalancerMember ajp://localhost:8209
BalancerMember ajp://localhost:8210
ProxySet lbmethod=bytraffic
ProxySet stickysession=JSESSIONID
</Proxy>
ProxyPass / balancer://mybalancername/
#check out http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html for more info
ProxyPassReverse / balancer://mybalancername/
ProxyPassReverseCookieDomain balancer://mybalancername https://public.domain.name
</IfModule>
seems like that with out
ProxySet lbmethod=bytraffic
ProxySet stickysession=JSESSIONID
spring security doesnt get the right cookie

Resources