unable to revere proxy jenkins using apache - apache

I have installed Jenkins and apache2 on my Ubuntu-16.04 serverand both are working fine. Now i want to deploy or configure reverse proxy for jenkins using apache.
Took help from this site to configure. I configured everything as per my need. My configuration file under sites-available folder ci.conf looks like
<Virtualhost *:80>
ServerName jenkins.tre.com
ProxyRequests Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
<Proxy http://localhost:8080/*>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/ nocanon
ProxyPassReverse / http://localhost:8080/
ProxyPassReverse / http://jenkins.tre.com/
</Virtualhost>
and system hostname abd domain name is
root#tre:~# hostname
tre
root#tre:~# domainname
(none)
When i restarted apache & jenkins and tried to access http://jenkins.tre.com/ the page is not opening, can anyone help me with this.... since iam very much new in to this thing.

Related

Running a perl script from proxy in Apache xampp

I'm using Windows 10 OS. I have used
<VirtualHost *:9001>
ProxyRequests On
<Proxy>
Order deny,allow Allow from all
</Proxy>
ProxyPass / http://localhost:8080/App/ ProxyPassReverse /
http://localhost:8080/App/
</VirtualHost>
for doing the proxy settings. I have created a virtual host.
Can anyone suggest me how to run a Perl script from here by giving the document root and call the Perl script from proxy settings?

httpd reverse proxy redirect with extra root directory name

I deploy a website war in wildfly named testDom-0.1 with apache httpd reverse proxy on. After logging in successfully, the default successful URL in spring security is "/booking", but the browser always get "testDom-0.1/booking" and then complain 404 error, if manually change the url into /booking, the page can be accessed without problem.
http.formLogin()
.loginPage("/denglu").permitAll()
.defaultSuccessUrl("/booking",true)
<VirtualHost *:80>
ProxyRequests off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/testDom-0.1/
ProxyPassReverse / http://127.0.0.1:8080/testDom-0.1/
ProxyPassReverseCookiePath /testDom-0.1 /
<proxy>
Order deny,allow
Allow from all
</proxy>
</VirtualHost>
The expected return url should be localhost/booking not localhost/testDom-0.1/booking

apache2 proxy redirect configuration

This has been asked a bunch of time I realize but I still can't seem to get it working. Here is my situation. I have 2 servers on my network. Server A is public facing which hosts my website. My second server also has apache running with a web application which I would like to access externally. I am not exactly sure how to configure this. My current config looks like this
NameVirtualHost *:2323
<VirtualHost *:2323>
ProxyPass / http://192.168.1.7/ampache
ProxyPassReverse / http://192.168.1.7/ampache
servername slave-1
ProxyPreserveHost On
ProxyRequests Off
</VirtualHost>
So I would like all traffic on https://my_domain.xx:2323 to redirect to 192.168.1.7/ampache
Thank you
I fixed it by doing the following
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass /airsonic http://192.168.1.7:8088/airsonic
ProxyPassReverse /airsonic http://192.168.1.7:8088/airsonic

Map apache2 proxy to different ports

I am running apache 2.2 and have a problem to map two different applications (Plex and Owncloud) on port 80. What I want to do is to proxy example/plex to localhost:32400/web (which is the default setting of plex). Also I want to map example/cloud on localhost/owncloud.
What I have tried so far:
<VirtualHost *:80>
ServerName example
<Proxy *>
Order deny,allow
Allow from 192.168.1.0/24
</Proxy>
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /cloud http://127.0.0.1/owncloud/
ProxyPassReverse /cloud http://127.0.0.1/owncloud/
<Location /plex/>
ProxyPass http://127.0.0.1:32400/web/
ProxyPassReverse http://127.0.0.1:32400/web/
</Location>
</VirtualHost>
That works for the cloud => owncloud proxy, but for some reason, whatever I try it doesn´t work for the Plex with port 32400.
I also tried with this instead of the Location block:
ProxyPass /plex http://127.0.0.1:32400/web/
ProxyPassReverse /plex http://127.0.0.1:32400/web/
Thanks in advance!

Error in Redirect from Apache to Tomcat using mod_proxy

I have apache and Tomcat in my server and im using mod_proxy to redirect from Apache to Tomcat... the apache is running on port 80 and tomcat is running on port 8080
here is my virtual host :
<VirtualHost *:80>
ServerName www.example.ir
ServerAlias example.ir
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/example
ProxyPassReverse / http://localhost:8080/example
<Location "/">
Order allow,deny
Allow from all
</Location>
</VirtualHost>
But the problem is when I try www.example.com i get the following error :
HTTP Status 404 - /exampleexample/
so whats wrong with my configuration ?
Thanks and sorry for my poor english
Do you want to execute Tomcat's examples webapp? If this is the case, try following configuration:
ProxyPass / http://localhost:8080/examples/
ProxyPassReverse / http://localhost:8080/examples/
After restarting your Apache, navigate to http://yourhost/.
Hope this helps.