You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ed Sutton <ES...@fescorp.com> on 2011/10/20 23:56:12 UTC

[users@httpd] How to configure httpd.conf to look for stylesheets in other directories ?

I am trying to configure Subversion http server to work from an existing install of apache on CentOs 5.2.

The stylesheet is located here:
/opt/lampstack-1.2-4/apps/subversion/htdocs/svnindex.xs

The SVN repo:
/var/lib/svn/

The error I get from  http://localhost/svn/
Error loading stylesheet: A network error occured loading an XSLT stylesheet:
http://localhost/svnindex.xsl

Is there something I can add to the <Location> to tell it where to find style sheets?  Or is this a <Directory> configuration?  The DocumentRoot is set to my MediaWiki so I do not want to change that.

Thanks in advance,

-Ed


File:subversion.conf
----------------------------

LoadModule dav_svn_module     modules/mod_dav_svn.so

<Location /svn/>
   DAV svn
   SVNListParentPath on
   SVNParentPath /var/lib/svn/
   SVNIndexXSLT "/svnindex.xsl"

   # Limit write permission to list of valid users.
   <LimitExcept GET PROPFIND OPTIONS REPORT>
      # Require SSL connection for password protection.
      # SSLRequireSSL

      AuthType Basic
      AuthName "Authorization Realm"
      AuthUserFile /etc/passwd
      Require valid-user
   </LimitExcept>
</Location>


# /svnindex.xsl is located in this directory
<Directory "/opt/lampstack-1.2-4/apps/subversion/htdocs">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>


-Ed


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to configure httpd.conf to look for stylesheets in other directories ?

Posted by Mark Montague <ma...@catseye.org>.
On October 20, 2011 17:56 , Ed Sutton <ES...@fescorp.com> wrote:
> The error I get from  http://localhost/svn/
> Error loading stylesheet: A network error occured loading an XSLT stylesheet:
> http://localhost/svnindex.xsl
>
> Is there something I can add to the<Location>  to tell it where to find style sheets?  Or is this a<Directory>  configuration?  The DocumentRoot is set to my MediaWiki so I do not want to change that.

To Apache HTTP Server, a stylesheet is the same as any other file:  it 
does not "find" them, it simply serves what the client requests 
according to how its configuration maps the URL namespace to the 
filesystem namespace.

In this case, whatever page is at http://localhost/svn is requesting the 
resource http://localhost/svnindex.xsl -- that is, it is requesting 
something named "svnindex.xsl" which is at the level of the 
DocumentRoot.  Since you say that your DocumentRoot is set to be where 
you have installed MediaWiki and you don't want to change this, the 
first thing you will need to do is to change the configuration of SVN to 
request files from some other part of the URL namespace rather than from 
the top level.  For example, change your SVN configuration so that the 
page that gets generated (or served) for http://localhost/svn/ in turn 
requests http://localhost/svn-static-files/svnindex.xsl instead of 
http://localhost/svnindex.xsl.  (The "svn-static-files" part in this 
example can be replaced with whatever you prefer.)

Once you have this, you then need to tell Apache HTTP Server "when you 
get a request for something under http://localhost/svn-static-files then 
look for it in /opt/lampstack-1.2-4/apps/subversion/htdocs in the 
filesystem.  You do this with an Alias directive:

Alias /svn-static-files/ /opt/lampstack-1.2-4/apps/subversion/htdocs/

For more information and examples, see 
https://httpd.apache.org/docs/2.2/mod/mod_alias.html#alias

Keep the <Directory> stanza that you have in your subversion.conf file 
right now, you'll still need that in order to tell the web server that 
it can serve files to clients from the directory in question.

I hope this helps.

--
   Mark Montague
   mark@catseye.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org