Rundeck running behind apache proxy does not show "Resource Node Models" - apache

I have a rundeck server which is running on server A with 10.10.100.120 VIP. I configured also a proxy on Server B having ip address 192.168.38.205.
So, Proxy server redirects incoming traffic to VIP:4440 in order to access Rundeck application.
To get there I have 2 options; Using application's VIP or Server B's ip address (proxy server).
Application server is a Centos 7, running Rundeck 3.0.22
Proxy server is a Centos 6 running apache 2.2
Here is my httpd configuration on proxy server:
<VirtualHost *:80>
ProxyPreserveHost On
# Servers to proxy the connection, or;
# List of application servers:
# Usage:
# ProxyPass / http://[IP Addr.]:[port]/
# ProxyPassReverse / http://[IP Addr.]:[port]/
# Example:
ProxyPass / http://10.10.100.120:4440/
ProxyPassReverse / http://10.10.100.120:4440/
ServerName localhost
</VirtualHost>
Proxy modules loaded:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
I followed instructions here:
From Digital ocean's proxy guide!
The problem is :
When I access the application from proxy and click on "Resource Model" tab in order to add node file under project > project settings > edit nodes, new window does not appear.
Normally, It should appear, by this way I could select the model that I want to use as node file.
Expected result:
From_rundeck_Server1
From_rundeck_server2
Proxy server problem:
From_proxy_server1
From_proxy_Server2

That's a Known Issue, to solve it change the grails.serverURL (rundeck-config.properties file usually at /etc/rundeck/rundeck-config.properties) value from "localhost" to your server hostname. Check this: https://groups.google.com/d/msg/rundeck-discuss/I94cVxK_6kQ/0a3PPyygAwAJ

Related

Reverse Proxy on Apache

I am naive to apache and network management. I have GeoServer hosted on one of my virtual machine which works correctly by the URL as localhost/geoserver . Also, I have successfully mapped one link say abc.ac.in/pqr/ (Link changed) to the localhost of virtual machine displaying the index.html of apache. But when I try to access abc.ac.in/pqr/geoserver then I get an error as /geoserver was not found on this server. Also, the link gets changed to abc.ac.in/geoserver.
I have used the reverse proxy as below in the httpd conf of apache as below:-
<IfModule proxy_module>
ProxyPass "/geoserver" "http://localhost:8080/geoserver"
ProxyPassReverse "/geoserver" "http://localhost:8080/geoserver"
</IfModule>
and uncommented below lines:-
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
Please let me know whether is this the issue from configuration side or related to mapping from network side and the possible workaround if any.

WildFly 9 load balancing with mod_cluster

I'm trying to configure load balancing with jboss wildfly running on windows for the first time. I d'ont have an experience with jboss or apache httpd. i have installed apache httpd and mod_cluster, than i added the required modules from mod_cluster to appache httpd then in httpd.conf i added this configuration :
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so
Listen 127.0.0.1:8080
<VirtualHost 127.0.0.1:8080>
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
Allow from 127.0.0.
</Location>
KeepAliveTimeout 60
MaxKeepAliveRequests 0
ManagerBalancerName mycluster
ServerAdvertise On
</VirtualHost>
When i put a clustered ejb application in the deployments and start the server with default standlone-ha.xml values i can access to /mod_cluster_manager but there is no node detected
I don't know if theres is further configuration i found a tutorial but it's not well explained anything can help thank you
You are missing some configuration, so there is no communication between Apache and Wildfly currently.
First, change the Port of your virtual host above to 6666 (common default for mod_cluster-manager virtual host) or anything other than 8080. You seem to be running Wildfly and Apache on the same host, 8080 is Wildfly's default HTTP listener Port, so instead of changing Wildfly's default, use something else for Apache.
Then you have two options:
a) enable MCPM in Apache's part of mod_cluster to get multicast auto-configuration
<VirtualHost 127.0.0.1:6666>
...
EnableMCPMReceive
</VirtualHost>
b) don't use multicast, and explicitly set the proxies in Wildfly's standalone.xml
<subsystem xmlns="urn:jboss:domain:modcluster:2.0">
<mod-cluster-config proxies="127.0.0.1:6666" ...>
...
</mod-cluster-config>
</subsystem>

Apache Proxy: No protocol handler was valid

I am trying to proxy a subdirectory to another server. My httpd.conf:
RewriteEngine On
ProxyPreserveHost On
RewriteRule .*subdir/ https://anotherserver/subdir/ [P]
The problem is that Apache is always logging this:
AH01144: No protocol handler was valid for the URL /subdir/. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule., referer: http://localhost/
So after searching the internet, I have activated these modules:
LoadModule headers_module modules/mod_headers.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_express_module modules/mod_proxy_express.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_html_module modules/mod_proxy_html.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule rewrite_module modules/mod_rewrite.so
(I know that I don't need all of them but I just activated them to be sure I am not missing one)
But this error still appears and clients get a HTTP 500.
How can I fix this?
This can happen if you don't have mod_proxy_http enabled
sudo a2enmod proxy_http
For me to get my https based load balancer working, i had to enable the following:
sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod proxy_balancer
sudo a2enmod proxy_http
For my Apache2.4 + php5-fpm installation to start working, I needed to activate the following Apache modules:
sudo a2enmod proxy
sudo a2enmod proxy_fcgi
No need for proxy_http, and this is what sends all .php files straight to php5-fpm:
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php5-fpm.sock|fcgi://localhost"
</FilesMatch>
In my case, I needed proxy_ajp module.
a2enmod proxy proxy_http proxy_ajp
This was happening for me in my Apache/2.4.18 (Ubuntu) setup. In my case, the error I was seeing was:
... AH01144: No protocol handler was valid for the URL /~socket.io/. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.
The configuration related to this was:
ProxyPass /~socket.io/ ws://127.0.0.1:8090/~socket.io/
ProxyPassReverse /~socket.io/ ws://127.0.0.1:8090/~socket.io/
"No protocol handler was valid for the URL /~socket.io/" meant that Apache could not handle the request being sent to "ws://127.0.0.1:8090/~socket.io/"
I had proxy_http loaded, but also needed proxy_wstunnel. Once that was enabled all was good.
To clarify for future reference, a2enmod, as is suggested in several answers above, is for Debian/Ubuntu. Red Hat does not use this to enable Apache modules - instead it uses LoadModule statements in httpd.conf.
More here:
https://serverfault.com/questions/56394/how-do-i-enable-apache-modules-from-the-command-line-in-redhat
The resolution/correct answer is in the comments on the OP:
I think you need mod_ssl and SSLProxyEngine with ProxyPass – Deadooshka May 29 '14 at 11:35
#Deadooshka Yes, this is working. If you post this as an answer, I can accept it – das_j May 29 '14 at 12:04
I am posting an answer here, since I had the same error message for a different reason.
This error message can happen, for example, if you are using apache httpd to proxy requests from a source on protocol A to target on protocol B.
Here is the example of my situation:
AH01144: No protocol handler was valid for the URL /sockjs-node/info
(scheme 'ws').
In the case above, what was happening was simply the following.
I had enabled mod proxy to proxy websocket requests to nodejs based on path /sockjs-node.
The problem is that node does not use the path /sockjs-node for websocket requests exclusively. It also uses this path for hosting REST entrypoints that deliver information about websockets.
In this manner, when the application would try to open http://localhost:7001/sockjs-node/info, apache httpd would be trying to route the rest call from HTTP protocol to to a Webscoket endpoint call. Node did not accept this.
This lead to the exception above.
So be mindful that even if you enable the right modules, if you try to do the wrong forwarding, this will end with apache httpd informing you that the protocol you tried to use on the target server is not valid.
In my case, all modules were correctly set up (https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension is a good starter) & I had the redirection working for a base url, let's say /mysite/
but I got the errors for any child ULR, let's say /mysite/login/
http://reverse-proxy.dns.com/mysite/ was properly redirected to the remote servers while http://reverse-proxy.dns.com/mysite/login/ failed at the Apache2 reverse proxying with OP's error message.
The issue was the ending / character in the proxypass directive "/mysite/". Working configuration for child URL is :
<Proxy balancer://mysite_cluster>
BalancerMember http://192.x.x.10:8080/mysite
BalancerMember http://192.x.x.11:8080/mysite
</Proxy>
<VirtualHost *:80>
[...]
ProxyRequests Off
ProxyPreserveHost On
ProxyPass "/mysite" "balancer://mysite_cluster"
ProxyPassReverse "/mysite" "balancer://mysite_cluster"
</VirtualHost>
Trailing / truly are tricky.
I tried to get an uwsgi:// working, but somehow the manual thought it was clear to me that I actually needed mod_proxy_uwsgi. It was not. Here is how you do it: How to compile mod_proxy_uwsgi or mod_uwsgi?
For me all above-mentioned answers was enabled on xampp still not working. Enabling below module made virtual host work again
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

How to create a proxy with apache 2.2?

I have a web app deployed on Tomcat. So my web is reachable with the url http//localhost:8080/myapp. Tomcat is install on my computer. I've installed Apache 2.2 (xampp) because i want to make a proxy. My aim is to build a proxy in order to have the following use case :
1. http://127.0.0.1:8080/myapp => displays my web app(as now)
2. http://mysuperapp.com/myapp => displays my web app ( here the http request is handled by my http://localhost:8080/myapp and the navigator always displays url http://mysuperapp.com/myapp).
Here is the configuration i use :
httpd.conf :
...various non-proxy-related modules omitted...
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_html_module modules/mod_proxy_html.so
LoadModule proxy_http_module modules/mod_proxy_http.so
<VirtualHost *:80>
ServerName mysuperapp.com
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ProxyPassReverseCookieDomain localhost mysuperapp.com
ProxyPreserveHost On
</VirtualHost>
When i try the url mysuperapp.com/myapp i cannot see my webapp. Is it something wrong ?
I'm assuming that mysuperapp.com correctly resolves to the computer that apache is running on? Just by mentioning a server name in apache's config, doesn't make it accessible under that name.
Is Apache running on the same computer as tomcat? If not, you can't use http://localhost:8080/ but will have to give the name your tomcat is accessible to Apache under (e.g. log in to the Apache-running computer and access your webapp from a browser there. If it's a headless server, use lynx or w3m - those are shell-based (text-mode) browsers.
If it's not any of these reasons, please specify "I cannot see my webapp" further: What can you see instead?
Edit: I've seen you've made some (moderator-rejected) edits to this answer: You should add these comments as "comments" below this answer.
From those edits I have the feeling that you'll have to work on the DNS side - e.g. you'll need to figure out how to make your Apache available under mysuperapp.com: So far you have configured it to reply correctly if it has been reached under that domain name, but it seems that the general name resolution does not point to it: Try ping mysuperapp.com. If that doesn't resolve to the IP-address of your Apache, you don't need to worry about anything else.

Apache mod_proxy port redirect for game server?

I've got a game running on port xxxx (server, that is). I made a rule for mod proxy in Apache to forward that port to 25555 /game (which theoretically should work. Problem comes when conencting, since I'm led to believe that the Headers are incorrect or basically Apache mod proxy only works with http or ftp traffic. It doesn't forward all packets directly to the destination and back with proxy reverse? For websites on other ports it works, just not anything non-http or ftp.
Example config:
(only summarizing)
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /folder/ http://localhost:8180/folder
ProxyPassReverse /folder/ http://localhost:8180/folder
Yep, proxying is for specific types of traffic. HTTP, FTP, AJP, etc. By its nature a proxy server needs to know the nature of the traffic its dealing with. Proxy/Apache is not the correct tool to use for port forwarding of any connections/traffic. You need some other lower level network utility for generic forwarning.
If you're on linux I think you can use iptables or something for this. Maybe go and ask on Server Fault, as generic forwarding is more suited over there.