Here is the situcation.
I installed OpenERP instance on Amazon EC2 Ubuntu 12.04.
Use serverip:8069 or domain-one.com:8069 to access website is no problem. Then i set up apache reverse proxy to use domain-two.com for openERP, i can't access the website. here is proxy setting:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName domain-two.com
RewriteEngine on
RewriteRule ^/(.*) http://localhost:8069/$1 [P]
ProxyPassReverse / http://localhost:8069/
</VirtualHost>
But when i add this to my computer /etc/hosts file:
serverip domain-two.com
and then visit the domain-two.com, successfully visit the OpenERP instance.
domain-two nameserver setting in Route53 is correct. no problem
Where i'm doing it wrong? please help.
Many Thanks!
First check whether your DNS setting is working fine or not using the dig command from linux os.
dig domain-two.com
And then use this configurations and try again.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName domain-two.com
ProxyPass / http://localhost:8069/
ProxyPassReverse / http://localhost:8069/
</VirtualHost>
Please dont forget to restart the Apache server. Remember this configuration will not work for SSL based Proxy.
Related
In brief, I can access my site using example.com:3000 but I want to access it using sub.example.com.
I am using WHM to manage my server using the example.com domain. I have added a DNS Zone using the WHM control panel for sub.example.com. It works fine and redirects to sub.example.com/cgi-sys/defaultwebpage.cgi.
I also tried to make a reverse proxy using VirtualHost by adding the following lines to the /etc/apache2/conf/httpd.conf file as mentioned in here:
<VirtualHost *:80>
ServerName sub.example.com
ProxyPreserveHost on
ProxyPass / http://localhost:3000/
</VirtualHost>
Then I restarted the Apache server using sudo systemctl restart httpd. However the subdomain still redirects to the sub.example.com/cgi-sys/defaultwebpage.cgi path rather than forwarding to the port:3000. Could you please help me resolve this problem?
It is worth mentioning that the server is using WHM and CPanel (version 84.0.21) on CentOS (version 7.7) as well as Apache (version 2.4.41) and the port:3000 is connected to a docker image (gitea) via docker-compose.
I had the same issue with the same setup and was able to solve it by using this configuration:
<VirtualHost sub.example.com:80>
ServerName sub.example.com
ServerAlias sub.example.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>
Adding it to Apache's include directive in WHM:
https://docs.cpanel.net/whm/service-configuration/include-editor/
For SSL port 443 you have to use the IP instead of domain:
<VirtualHost 1.1.1.1:443>
I'm trying to run Gogs.io on an apache webserver along with a standard website, and I'm trying to have Gogs.io used on a subdomain rather than using my standard domain with a port.
Gogs.io runs on port 3000, and I want the url to be
http://gogs.example.net/
Rather than
http://example.net:3000/
Both my public IP with port and example.net:3000 work, but when trying to use gogs.example.net, I always get an AT&T DNS Error Assist page. I'm not sure what I'm doing wrong, as I had it working earlier until I tried to change the name of the subdomain in my apache config, but I changed it back when I started having issues, to no luck.
Here is my Apache config for the page:
<VirtualHost *:80>
ServerName gogs.example.net
ProxyPreserveHost On
ProxyPass / http://example.net:3000/
ProxyPassReverse / http://example.net:3000/
</VirtualHost>
This may be impossible, but any help would be greatly appreciated!
Fixed the issue by adding an A record to my domain
A Record: git -> 111.222.333.444
As well as modified the VirtualHost settings to include the subdomain in the ProxyPass and ProxyPassReverse
<VirtualHost *:80>
ServerName gogs.example.net
ProxyPreserveHost On
ProxyPass / http://git.example.net:3000/
ProxyPassReverse / http://git.example.net:3000/
</VirtualHost>
I have a Joomla Installation on Apache2 (Port 83) running on Ubuntu 16.04 Server.
When I connect to the page from the local network like 192.168.178.14:83 it appears and everything is fine. To access my page from the Internet there is another Server running Apache2, that acts as a Proxy Server. All traffic going trough Port 80 and 443 come to this machine, using the ServerName it decide to which machine the traffic have to be forwarded. That's working fine for about 10 domains and machines.
But when I connect to my Joomla Domain I get a HTML Site without any formatting, graphics and templates. When I forward a Port directly to this machine everything works fine again, using this port to connect.
network topologie
My VirtualHost config on Ubuntu1:
<VirtualHost *:80>
ServerName ksg-events.de
Redirect permanent / https://ksg-events.de/
</VirtualHost>
<VirtualHost *:443>
ServerName ksg-events.de
ProxyPreserveHost On
ProxyRequests Off
ProxyVia Off
ProxyPass / http://192.168.178.14:83/
ProxyPassReverse / http://192.168.178.14:83/
SSLCertificateFile /etc/letsencrypt/live/ksg-events.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/ksg-events.de/privkey.pem
</VirtualHost>
Virtual Host config on Ubuntu2:
<VirtualHost *:83>
DocumentRoot /var/www/ksg-events.de/joomla
</VirtualHost>
Thanks for your help!
I find a solution to my problem:
Run Joomla behind Apache reverse proxy (http):
Add ProxyVia full to proxy's VirtualHost config
Using https:
Enable mod_headers on proxy server
Add RequestHeader set X-Forwarded-Proto "https" to proxy's VirtualHost
I hope that can help someone who run into the same problems.
I've got a wordpress blog running in a docker container, and I'm trying to reverse proxy to it from a virtualhost in the host's apache config. My vhost config looks like this:
<VirtualHost *:80>
ServerName my.vhost.com
ProxyRequests off
ProxyPreserveHost on
ProxyPass / http://127.0.0.1:8084/
ProxyPassReverse / http://127.0.0.1:8084/
</VirtualHost>
When I visit it in chrome, it works fine. When I pull it through curl it looks fine. But when I go to the my.vhost.com in firefox it redirects me to the host ip address (no port).
Does anyone know what's going on here?
I am having some problems setting up an Apache Web Server in front of Jboss.
I rent a vps with apache and jboss running up and working fine separately.
Jboss is working fine when I want to acess my app through http://myVpsUrl.com:8080/myApp/
I am trying to redirect http://myUrl.com to my jboss app.
In Apache conf file I set :
<VirtualHost *:80>
ServerName myUrl.com
ServerAlias myUrl.com
ProxyPass / http://localhost:8080/context/
ProxyPassReverse / http://localhost:8080/context/
ProxyPassReverseCookiePath / /
ProxyRequests On
</VirtualHost>
When I am going to myUrl.com I can reach the web app homepage but :
images and style are missing
All links redirect my to the homepage
My style and images are located in
http://myVpsUrl:8080/context/css/icons/devices-14-20.png
http://myVpsUrl:8080/context/javascript/util.js
http://myVpsUrl:8080/context/images/*
etc...
I tried to add
ProxyPreserveHost On
But I'm getting an error :
The page isn't redirecting properly or Infinite redirection
I am stuck with this error since a week, any help would be sincerely appreciated.
Thank you.
I finally find how to make it work.
1- Create a virtual-server in jboss
jboss-as-7.1.1.Final/standalone/configuration/standalone.xml
<virtual-server name="myVirtualServerName" default-web-module="nameOfWarFile">
<alias name="myurl.com"/>
</virtual-server>
2- Configure jboss-web.xml
<jboss-web>
<virtual-host>myVirtualServerName< /virtual-host>
</jboss-web>
3- Restart Jboss and Deploy you app
=> You should be able to access your app via myurl.com:8080
4- Make a redirection from port 80 to 8080 on apache
<VirtualHost *:80>
ServerName myurl.com
ServerAlias www.myurl.com myurl.com
ProxyPass / http://myurl.com:8080/
ProxyPassReverse / http://myurl:8080/
</VirtualHost>
5- Edit your host file (/etc/host) and add this line
127.0.0.1 myurl.com
6- Restart apache, you should be able to access your jboss via myurl.com
you could try use the rewrite engine.
Try this:
<VirtualHost *:80>
ServerName myUrl.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8080/context/
ProxyPassReverse / http://localhost:8080/context/
RewriteEngine On
RewriteCond %{THE_REQUEST} /context/
RewriteRule ^/context/(.*)$ /$1 [PT]
</VirtualHost>