How to configure Apache forward to IIS - apache

My website running on IIS 8.0.
I was install Ubuntu on another machine, and setup Apache and Varnish on it.
Now, I want how to configure Varnish and Apache when visitors access Apache that it will forward to my Website on IIS.
Please help me!!!

As your question, you need varnish and apache to send the visitor to IIS Server .
I could not understand why you need apache to send To IIS which will cause your page load slower due to unnecessary routing.
But to answer your query
in apache config:
sudo vi /etc/apache2/apache2.conf
add below
ProxyPass "/" "http://IISserverip/"
ProxyPassReverse "/" "http://IISserverip/"
hope this resolve your requirement

Related

How to setup Apache as reverse proxy for odoo11 in windows server? Is that posiible?

I need to link my subdomain with the Odoo 11 application which is running in windows server. I have been trying this for a while and ending up in finding the solution for ubuntu server. Please help me in understanding this.
Your help will be highly appreciable. Thanks in Advance.
Why Apache? IMO it will be better to use any other reverse proxy than Apache, one more focused on being a reverse proxy like Traefik or Nginx or Caddy just to name a few that seems to live more in 2018 than Apache. Nothing against Apache, just that IMO there are some better tools for doing reverse proxy today
Assuming that the Odoo 11 listen to the default port 8069
So
Open the Apache virtual host configuration file that refer to your virtual host.
in the virtual host add these lines
####Proxy settings####
Define ODOO_11_URL http://localhost:8069
ProxyPreserveHost On
ProxyPass / ${ODOO_11_URL}
ProxyPassReverse / {ODOO_11_URL}
####END Proxy settings####
If needed - Change the url as needed, for example if the url of Odoo 11 is http://localhost:8069/YOUR_URL - so change the line that start with "Define" to your url.

websphere and apache server proxy and rewrite configuration

There are javaEE applications run on WebSphere server.
The thing I wanna do that to configure a http server that takes the request and redirect to my local websphere server.
For example:
This is live Project testProject.com/Otel..
I wanna reach my local project when I insert local.testProject.com/Otel..
The thing I have done so far I can reach my local apache server when I click local.testProject.com just with adding in host file in windows/system32/drivre/etc directory.
The thing I could not do so far. redirecting this incoming request to my apache server to websphere server.
Could you please help me on these. Dont hasitate to ask further questions.
I would be appreciated if you could give me some ideas with just commenting at least.
Good days..
IBM provides a specialty reverse proxy module for Apache called the WebSphere WebServer Plug-in. Its use is described in detail in the websphere documentation.
In simple configurations, you can just configure any server you already have as a reverse proxy.
Load mod_proxy and mod_proxy_http (varies depending on Apache distribution)
Append to your virtual host:
ProxyPreserveHost ON
ProxyPass /otel http://washostname.example.com/otel
# ProxyPassReverse likely not required in your case.
Of course there are thousands of places to read about setting up Apache as a reverse proxy and there are nearly no WebSphere specifics.

Apache route subdomain to nginx on port?

I have a server running CentOS 7 that has an Apache web-server running on port 80. I am also using a common open-source Git project called GitLab, which uses the nginx web-server instead of Apache. I have configured GitLab's nginx to run on port 4444.
I have a subdomain "git.mydomain.com" that I would like to forward to "mydomain.com:4444" however I would like the URL to continue saying "git.mydomain.com".
I belived that I need to have an Apache VirtualHost file, however I'm not sure what to do.
Is this possible? If so, how can I do so?
Thanks
You would indeed need a git.mydomain.com VirtualHost with a proxy/reverse proxy directive. See https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

Apache Redirect URL or Web Translation

I am a total newb at Apache. So any help with this would be awesome.
So I have an application that's running on a Red Hat web server using Apache. Currently when you hit the base web server URL it gives the standard apache web page. I would like users who visit
http://www.mysite/ and www.mysite/app1
to be redirected to http://www.mysite:8080/app1. How would I go about doing this?
Also, is it possible to hide the redirect address (mostly the :8080) and just show the redirected URL?
you should use mod_proxy from apache like this in your wirtual host
ProxyPass / http://www.mysite.com:8080/
ProxyPass /app1 http://www.mysite.com:8080/app1
to enable this in debian
a2enmod proxy_http

How do I redirect from Apache to Tomcat?

I'm working on my first Java site. I'm running Apache Tomcat on port 8080, and Apache HTTPD on port 80. The current URL that I can access the site at is (for example) 123.4.5.6:8080. I want to remove the port number from the URL before I point the domain at the new IP.
At the moment I am only using Apache for phpmyadmin, however I plan on using it for CGI scripts and other stuff once I figure out mod_jk etc... So I don't want to change Tomcat's port to 80 and turn off Apache.
I hope this makes sense.
The correct way to do things is to leave Apache at 80 and Tomcat at 8080 and use a plug in (preferably mod_proxy) to proxy Tomcat from Apache. mod_proxy would only take you 10 minutes to set up.
This how-to is very simple to follow.
The usual way this is done, as you already mentioned, is to use mod_jk from Apache HTTPD to forward that content that you want to be processed by Tomcat.
There is a Quick HowTo at tomcat.apache.org. You need to do the following:
Copy mod_jk.so into the appropriate modules directory for Apache HTTPD.
Create a configuration file workers.properties
In Apache HTTPD's httpd.conf, add a section to configure mod_jk.
Ensure that Tomcat is configured to accept the mod_jk protocol, which is usually on port 8009.
The lines in httpd.conf with JkMount:
JkMount /examples/* worker1
tell Apache HTTPD which requests are to be forwarded to Tomcat.
Both the helpful answers above are good, but I much prefer mod_proxy over mod_jk. There's no extra installation to do for mod_proxy, unlike mod_jk, and the setup is much easier. mod_jk gives you more control over detailed tuning of Tomcat parameters, but if you just want a simple redirect from Apache to Tomcat, mod_proxy is the way to go.
If you want static content to be served by Apache instead of Tomcat you should use mod_jk : http://tomcat.apache.org/tomcat-6.0-doc/proxy-howto.html
And what about SSL - if we want Apache to handle HTTPS, because it is faster then java/Tomcat?
you should configure your tomcat using this link. for tomcat 7
http://tomcat.apache.org/tomcat-7.0-doc/proxy-howto.html