top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

documentRoot and directory relative to serverroot in httpd

+2 votes
428 views

I'm trying to set DocumentRoot and the following directory directive relative to ServerRoot:

DocumentRoot "../web"

DocumentRoot is working, but the Directory directive is not. It won't match. If I change the directory directive to an absolute path it will work. Any idea how I can get this to work?

posted Sep 3, 2013 by Naveena Garg

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

I start httpd.exe from a PHP script, using this command string on Win7:

 start /b  /d ...httpd.exe -f myhttpd.conf

This appears to work OK. However, when it comes to stopping it I have an error message. I'm trying initially from the console prompt:

 httpd.exe -k stop -f pathtomyhttpd.conf

and the message is:

 (OS 5)Access is denied. : failed to open the Apache2.2 Service

What is the right way to do this?

0 votes

I want to allow a directory " /var/www/html/ldap" to two users according to IPs (192.168.1.2 192.168.1.7):

 Order allow,deny
 Allow from 192.168.1.2 192.168.1.7
 Satisfy any
 AuthName "LDAP Authentication"
 AuthType Basic

 AuthBasicProvider ldap
 AuthzLDAPauthoritative off
 AuthLDAPURL ldap://192.168.1.3/dc=example,dc=com?uid?sub?(objectClass=*)
 Require valid-user

but I don't want to allow a sub directory to 192.168.1.7 (I want it to be allowed only to 192.168.1.2):

I have tried to add:

 Order allow,deny
 Allow from 192.168.1.2
 Satisfy any
 AuthName "LDAP Authentication"
 AuthType Basic

 AuthBasicProvider ldap
 AuthzLDAPauthoritative off
 AuthLDAPURL ldap://192.168.1.3/dc=example,dc=com?uid?sub?(objectClass=*)
 Require valid-user

but it seems that 192.168.1.7 can reach to manager directory because it is a part of ldap directory, how can I forbid this?

0 votes

I've been using relative links in content in the past without any trouble. It has been suggested this is a bad practice, but the reasons given I haven't found terribly convincing. I may be wrong, but it seems as though people are using relative linking as a scapegoat for generally bad practices.

Take the following article for instance: http://yoast.com/relative-urls-issues/

The way I see it, if broken links are being deployed then testing isn't thorough enough. If a test environment is accessible to involved parties (e.g. spiders) then testing isn't controlled enough. If multiple paths exist to the same content without good reason, then the architecture is poor.

Looking around Google, this seems to be rather representative of the arguments. Relative links are bad because when they're combined with other issues that should never happen the results are undesirable. That's not good enough for me. Does anybody have a better reason?

0 votes

I am a bit confused about the mod_rewrite documentation. It shows this rule to block hotlinking:

RewriteCond "%{HTTP_REFERER}" "!^$"
RewriteCond "%{HTTP_REFERER}" "!www.example.com" [NC]
RewriteRule ".(gif|jpg|png)$" "-" [F,NC]

however, I'd think a better rule would be:

RewriteCond "%{HTTP_REFERER}" "^$" [OR]
RewriteCond "%{HTTP_REFERER}" "!(www.)?example.com/.*$" [OR,NC]
RewriteRule ".(gif|jpg|png)$" "-" [F,NC]

if I want to block anyone manually typing in a link (no referer) + hotlinking (probably has a referer). Do i need the [OR] on the 1st
RewriteCond and not the 2nd one? It seems to work with OR on both conditions.

...