any apache mod_rewrite experts?

Lonni J Friedman netllama at gmail.com
Wed Oct 24 16:25:24 PDT 2012


Thanks for your reply.  I made the change you suggested, and that
improved things slightly.  Now when I go to http://example.com/munin I
get a directory(index) listing of the content that exists in
/var/www/html/munin

On Wed, Oct 24, 2012 at 2:54 PM, Federico Voges <ftc at ftc.com.ar> wrote:
> I'm don't remember exactly how it worked, but you might want to check
> the PT option (pass through, I think). You'd change [L] to [L,PT] or
> something like that.
>
> On 24 October 2012 21:40, Lonni J Friedman <netllama at gmail.com> wrote:
>> I've got a 400+ node munin-1.4.x ( http://munin-monitoring.org )
>> installation, that I'd like to upgrade to munin-2.x, to take advantage
>> of the CGI based content generation (html & graphs) on the munin
>> master server. I've gone through the official dox (
>> http://munin-monitoring.org/wiki/CgiHowto2 ), and its simply not
>> working. It only covers a VirtualHost ( http://munin.example.com ),
>> which is not my setup, but I tried to use it as a starting point.
>>
>> Specifically, I want & need http://example.com/munin to be the base
>> URL that dynamically generates the html content listing all the nodes,
>> with links to the individual node pages (which are then dynamically
>> generated/updated when clicked upon). The added catch is that I'm
>> doing this on Fedora(16), and the vast majority of howto's that I've
>> found assume Debian/Ubuntu (or assume non-cgi static content
>> generation via cron).
>>
>> The official Fedora munin package installs the following:
>>
>>     munin base directory is /var/www/html/munin
>>     munin static content direcotry is /var/www/html/munin/static
>>     munin cgi scripts (munin-cg-graph & munin-cg-html) are in
>> /var/www/html/munin/cgi
>>
>> What I've done so far: * set "html_strategy cgi" and "cgiurl_graph
>> /munin/cgi/munin-cgi-html" in /etc/munin/munin.conf * Added the
>> following to /etc/httpd/conf/httpd.conf:
>>
>> # Rewrites
>> RewriteEngine On
>> Alias /static /var/www/html/munin/static
>> Alias /munin /var/www/html/munin
>> # HTML
>> RewriteCond %{REQUEST_URI} !^/static
>> RewriteCond %{REQUEST_URI} .html$ [or]
>> RewriteCond %{REQUEST_URI} =/
>> RewriteRule ^/(.*)           /var/www/html/munin/cgi/munin-cgi-html/$1 [L]
>> # Images
>> # - remove path to munin-cgi-graph, if present
>> RewriteRule ^/munin/cgi/munin-cgi-graph/(.*) /$1
>> RewriteCond %{REQUEST_URI}                 !^/static
>> RewriteCond %{REQUEST_URI}                 .png$
>> RewriteRule ^/(.*)  /var/www/html/munin/cgi/munin-cgi-graph/$1 [L]
>> ScriptAlias /munin/cgi/munin-cgi-graph   /var/www/html/munin/cgi/munin-cgi-graph
>> <Location /munin/cgi/munin-cgi-graph>
>>         Options +ExecCGI FollowSymLinks
>>         <IfModule mod_fcgid.c>
>>                 SetHandler fcgi-script
>>         </IfModule>
>>         <IfModule !mod_fcgid.c>
>>                 SetHandler cgi-script
>>         </IfModule>
>> </Location>
>> ScriptAlias /munin/cgi/munin-cgi-html   /var/www/html/munin/cgi/munin-cgi-html
>> <Location /munin/cgi/munin-cgi-html>
>>         Options +ExecCGI FollowSymLinks
>>         <IfModule mod_fcgid.c>
>>                 SetHandler fcgi-script
>>         </IfModule>
>>         <IfModule !mod_fcgid.c>
>>                 SetHandler cgi-script
>>         </IfModule>
>> </Location>
>>
>> However, after doing all that (and restarting apache), when I go to
>> http://example.com/munin , I get a 404 error, and in the apache error
>> log I see:
>>
>> File does not exist: /var/www/html/munin/cgi/munin-cgi-html/munin/index.html
>>
>> I'm hoping that i'm just missing something obvious, but right now I'm
>> at a complete loss on what else might need to be adjusted to make this
>> work.
>>
>> thanks.


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                                    netllama at gmail.com
LlamaLand                       https://netllama.linux-sxs.org


More information about the Linux-users mailing list