LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-17-2017, 02:25 PM   #1
srennivass
LQ Newbie
 
Registered: Nov 2017
Posts: 4

Rep: Reputation: Disabled
httpd request redirection


Hello my self sernnivass
i am testing proxy on centos 7, i have made configurations like this
browsing from windows . webserver configured on centos(192.*.**146) and owncloud installed on ubuntu 16 (192*.*.172) . i have configured proxy on centos to ubuntu as below
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass /owncloud http://192.*.*.172/owncloud
ProxyPassReverse /owncloud http://192.*.*.172/owncloud
</VirtualHost>

i have configured hosts in my windows as
192.168.1.172 testsql.com
192.168.1.146 testcen.com
192.168.1.146 local.owncloud.com
when i hit testcen.com it's going to apache of centos but when i hit local.owncloud.com it's directly going to owncloud folder of ubuntu .both have same configuration then why request is going directly to owncloud instead of centos.
Is there any redirection happening could you please clarify me on this. plzzzz.
 
Old 11-17-2017, 03:31 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
Originally Posted by srennivass View Post
both have same configuration
It's not supposed to work like that.

See basic example in:
https://httpd.apache.org/docs/2.4/en/mod/mod_proxy.html
 
Old 11-18-2017, 04:09 AM   #3
scott_R
Member
 
Registered: Jul 2003
Location: Brighton, Michigan, USA
Distribution: Lots of distros in the past, now Linux Mint
Posts: 748

Rep: Reputation: 31
It's doing what you told it to do.

You told Apache to redirect those requests to your local network's (Ubuntu) /owncloud folder. I suspect that you want to aim it at data instead.

I'd also check the owncloud security settings on the Ubuntu machine because it should have errored out instead of allowing you to see it's installation folder.
 
Old 11-18-2017, 07:44 AM   #4
srennivass
LQ Newbie
 
Registered: Nov 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
I did proper configuration but i'm doubting " . " in name ??

Quote:
Originally Posted by scott_R View Post
It's doing what you told it to do.

You told Apache to redirect those requests to your local network's (Ubuntu) /owncloud folder. I suspect that you want to aim it at data instead.

I'd also check the owncloud security settings on the Ubuntu machine because it should have errored out instead of allowing you to see it's installation folder.
I wrote rule to redirect request came for /owncloud to ubuntu's owncloud folder. but not / to ubuntu's owncloud folder. I tested with three names localowncloud.com points to / of proxy server and it's working fine and showing apache page of proxy server whereas with same i configured local.owncloud.com and it's going to /owncloud of ubuntu . Is this " . " making much difference im confused here . As per my configuration local.owncloud.com also shoud hit only proxy server's / folder but it's not happening.

Could you please help me with this to go further.
 
Old 11-18-2017, 08:02 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by srennivass View Post
I wrote rule to redirect request came for /owncloud to ubuntu's owncloud folder. but not / to ubuntu's owncloud folder. I tested with three names localowncloud.com points to / of proxy server and it's working fine and showing apache page of proxy server whereas with same i configured local.owncloud.com and it's going to /owncloud of ubuntu . Is this " . " making much difference im confused here . As per my configuration local.owncloud.com also shoud hit only proxy server's / folder but it's not happening.

Could you please help me with this to go further.
See post #2, where you were pointed to the example in the documentation; read and follow that.
 
Old 11-18-2017, 08:08 AM   #6
srennivass
LQ Newbie
 
Registered: Nov 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
It's not clarifying my doubt

Quote:
Originally Posted by TB0ne View Post
See post #2, where you were pointed to the example in the documentation; read and follow that.
Hello Thanks for your answers , but i'm not able to find is it redirection or my mistake , because same rule working differently to other domain name with same settings. i even tried with clearing caches and cookies of my browser.Could you help me in finding the issue.
 
Old 11-18-2017, 08:29 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by srennivass View Post
Hello Thanks for your answers , but i'm not able to find is it redirection or my mistake , because same rule working differently to other domain name with same settings. i even tried with clearing caches and cookies of my browser.Could you help me in finding the issue.
No, because it's pretty clear you haven't read the documentation. Did you read/think about what you posted initially??
Quote:
Originally Posted by srennivass
i have configured hosts in my windows as
192.168.1.172 testsql.com
192.168.1.146 testcen.com
192.168.1.146 local.owncloud.com

when i hit testcen.com it's going to apache of centos but when i hit local.owncloud.com it's directly going to owncloud folder of ubuntu .both have same configuration then why request is going directly to owncloud instead of centos.
Is there any redirection happening could you please clarify me on this. plzzzz.
I have bolded four things above for emphasis and for you to re-read.
  1. Where does Windows enter into this??
  2. You have TWO different domains, that are POINTED TO THE SAME ADDRESS, and you're surprised that they both go to the same place?
  3. Where did you think it was going to go? You explicitly TOLD Apache to redirect both of those domains to that one address.
  4. Read the LQ Rules about text-speak, and not using it.
 
Old 11-18-2017, 09:55 AM   #8
srennivass
LQ Newbie
 
Registered: Nov 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Windows is my pc and i have configured host names for respective ips.

Quote:
Originally Posted by TB0ne View Post
No, because it's pretty clear you haven't read the documentation. Did you read/think about what you posted initially??

I have bolded four things above for emphasis and for you to re-read.
  1. Where does Windows enter into this??
  2. You have TWO different domains, that are POINTED TO THE SAME ADDRESS, and you're surprised that they both go to the same place?
  3. Where did you think it was going to go? You explicitly TOLD Apache to redirect both of those domains to that one address.
  4. Read the LQ Rules about text-speak, and not using it.
I want to clear you my configuration.
1.Windows is my pc and i have configured host names for respective IPs.In order to reach server just by hitting the domain names.
2.I have pointed two domains to the same IP address , and my worry is that both are not going to same place.i.e testcen.com going to proxy server's apache page and can be understood as working properly but local.owncloud.com is forwarding through proxy server and reaching the owncloud application i.e ubuntu's /owncloud folder.
both are pointed to same ip i.e proxy server's apache page .

3.Until unless i give local.owncloud.com/owncloud it should not go to ubuntu's /owncloud but it's going how ??? and Why ???
 
Old 11-18-2017, 10:00 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by srennivass View Post
I want to clear you my configuration.
1.Windows is my pc and i have configured host names for respective IPs.In order to reach server just by hitting the domain names.
...so unless you enter these things into the actual Apache SERVER, any virtual domain stuff you do won't be effective.
Quote:
2.I have pointed two domains to the same IP address , and my worry is that both are not going to same place.i.e testcen.com going to proxy server's apache page and can be understood as working properly but local.owncloud.com is forwarding through proxy server and reaching the owncloud application i.e ubuntu's /owncloud folder.
both are pointed to same ip i.e proxy server's apache page .
Then you need to straighten out your virtual host configuration, and follow the examples. What you posted here had one definition, not multiples, which is exactly what virtual domains are. Again, read/follow the documentation. You have errors in your configuration, and since you have posted one very small section of it, how do you think we'll be able to give you more guidance, other than telling you where an example is?
Quote:
3.Until unless i give local.owncloud.com/owncloud it should not go to ubuntu's /owncloud but it's going how ??? and Why ???
Because you, again, haven't defined your virtual hosts correctly, and cannot/should not have two domains pointing to the exact same address.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
errors when install httpd (libtool: link: cannot find the library /httpd-2) rookie5 Linux - Server 7 08-16-2015 12:41 PM
httpd Request Entity Too Large using "ServerAlias" NerdGZ Linux - Newbie 1 09-17-2014 06:40 AM
Redhat linux, httpd.conf redirection with paramater bobbythoms Linux - Newbie 1 12-22-2011 11:34 AM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
httpd mod_securiry generating 400 bad request error lcornea Linux - Newbie 4 02-28-2008 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration