LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache 2.2 & Content Switches (https://www.linuxquestions.org/questions/linux-software-2/apache-2-2-and-content-switches-535715/)

ThisGuyIKnow 03-08-2007 10:53 AM

Apache 2.2 & Content Switches
 
Hello people,

I work at a university library and our institution's networks deparment has a lot of "things" in place between our library network and the outside world. One of those "things" being a content switch. So, people in the outside world generally get to our web content via the following url: (not actual hostname, domain & ip, obviously)

Code:

  www.mylibrary.myuniversity.edu = ip 123.123.123.123
The above url/ip maps to the content switch. You can also get to our site using the hostname url of our machine:

Code:

  hostname.mylibrary.myuniversity.edu = ip 456.456.456.456
The problem I'm having is that any directory access configuration, except the document root, I have to use the hostname url because if I use the www one, I get a 403 Access forbidden error. I WANT to be able to use www for all directories. For example, if I have:

Code:

  <Directory /srv/www/htdocs/foo>
      AllowOverride None
      Order deny,allow
      Deny from all
      Allow from (library ip's)
  </Directory>

I have to use:

Code:

  hostname.mylibrary.myuniversity.edu/foo
But I get a 403 if I use:
Code:

  www.mylibrary.myuniversity.edu/foo
I've tried using Redirect in my config, but that didn't work. Anyone know how to get around this? TIA :)

- Gavin

sn68 03-09-2007 04:58 AM

Try following, may work !
Code:

<Directory /srv/www/htdocs/foo>
      AllowOverride None
      Order deny,allow
      Allow from (library ip's)
      Deny from all
</Directory>


ThisGuyIKnow 03-12-2007 10:06 AM

Thanks sn 68. :scratch: I don't understand why you think that would work, but I tried it anyway. No luck. Maybe I didn't explain my problem clear enough. Perhaps you could explain your reasoning? :D

sn68 03-12-2007 01:15 PM

My reasoning was that the syntax gives allow first & deny later, but apparently that doesn't seem to make a difference
The problem could be SElinux policy, something to do with SELinux context labels, in such cases 403 error occurs even though permissions are correct when accessing through www because the context label was wrong
to configure
chcon -R -h -t httpd_sys_content_t /srv/www/htdocs/foo

For more google for - apache "SELinux Security Context File Labels"


All times are GMT -5. The time now is 09:17 PM.