Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8038035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:06:13+00:00 2026-06-05T03:06:13+00:00

At work we have a ViewVC system which has been migrated from one machine

  • 0

At work we have a ViewVC system which has been migrated from one machine to another. The version has also been upgraded. The old system used /cgi-bin/viewvc.cgi as the base of all its urls and the new system uses /viewvc. The hostname remains the same.

We have a lot of documentation which has ViewVC links and I would like those to still work as before. I’m a software developer by day so not an expert on apache but I thought that mod_rewrite would be the right route. Unfortunately I can’t seem to get it to do what I want.

Without any changes, when I go to the url /cgi-bin/viewvc.cgi I get a 404. Here’s what I see in the apache logs:

==> /var/log/httpd/error_log <==
[Thu May 31 03:13:10 2012] [error] [client 172.16.3.52] script not found or unable to stat: /var/www/cgi-bin/viewvc.cgi

==> /var/log/httpd/access_log <==
172.16.3.52 - - [31/May/2012:03:13:10 +0100] "GET /cgi-bin/viewvc.cgi HTTP/1.1" 404 289 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.17 Safari/536.11"

When I add the RewriteEngine/RewriteRule entries to /etc/httpd/httpd.conf as below …

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

    RewriteEngine on
    RewriteRule ^/cgi-bin/viewvc.cgi(.*) /viewvc$1
</Directory>

I get a 403. Here’s what’s in the logs:

==> /var/log/httpd/error_log <==
[Thu May 31 03:15:35 2012] [error] [client 172.16.3.52] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /var/www/cgi-bin/viewvc.cgi

==> /var/log/httpd/access_log <==
172.16.3.52 - - [31/May/2012:03:15:35 +0100] "GET /cgi-bin/viewvc.cgi HTTP/1.1" 403 293 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.17 Safari/536.11"

If I edit the Options line above to include FollowSymLinks and SymLinksIfOwnerMatch I’m back to a 404.

==> /var/log/httpd/error_log <==
[Thu May 31 03:17:20 2012] [error] [client 172.16.3.52] script not found or unable to stat: /var/www/cgi-bin/viewvc.cgi

==> /var/log/httpd/access_log <==
172.16.3.52 - - [31/May/2012:03:17:20 +0100] "GET /cgi-bin/viewvc.cgi HTTP/1.1" 404 289 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.17 Safari/536.11"

What am I doing wrong? Do I have the rule wrong or have it put it in the wrong place? Is mod_rewrite even he correct approach?

Versions: In case it is important, I am on a Fedora 17 machine with the following packages:

  • httpd-2.2.22-4.fc17.x86_64
  • viewvc-1.1.13-2.fc17.noarch
  • viewvc-httpd-wsgi-1.1.13-2.fc17.noarch
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:06:16+00:00Added an answer on June 5, 2026 at 3:06 am

    To answer my own question, the problem was that 1) the period in the pattern match needed escaping and 2) I put the rule in the wrong place. I should have put it at the top level rather than under cgi-bin.


    For completion, here’s how I worked it out:

    I turned on rewrite logging so I could see exactly what the rewrite engine was doing:

    RewriteLog /tmp/rewrite.log
    RewriteLogLevel 9
    

    Using the original rewrite rule, I get this being logged:

    127.0.0.1 - - [02/Jun/2012:23:43:49 +0100] [localhost/sid#b76f4018][rid#b6d4a058/initial] (2) init rewrite engine with requested uri /cgi-bin/viewcvs.cgi
    127.0.0.1 - - [02/Jun/2012:23:43:49 +0100] [localhost/sid#b76f4018][rid#b6d4a058/initial] (3) applying pattern '^/cgi-bin/viewvc.cgi(.*)' to uri '/cgi-bin/viewcvs.cgi'
    127.0.0.1 - - [02/Jun/2012:23:43:49 +0100] [localhost/sid#b76f4018][rid#b6d4a058/initial] (1) pass through /cgi-bin/viewcvs.cgi
    

    When I changed the rule to escape the period:

    RewriteRule ^/cgi-bin/viewvc\.cgi(.*) /viewvc$1
    

    I got this logged.

    192.168.1.64 - - [03/Jun/2012:00:08:53 +0100] [192.168.1.128/sid#b76ed018][rid#b6d39058/initial] (2) init rewrite engine with requested uri /cgi-bin/viewvc.cgi/
    192.168.1.64 - - [03/Jun/2012:00:08:53 +0100] [192.168.1.128/sid#b76ed018][rid#b6d39058/initial] (3) applying pattern '^/cgi-bin/viewvc\.cgi(.*)' to uri '/cgi-bin/viewvc.cgi/'
    192.168.1.64 - - [03/Jun/2012:00:08:53 +0100] [192.168.1.128/sid#b76ed018][rid#b6d39058/initial] (2) rewrite '/cgi-bin/viewvc.cgi/' -> '/viewvc/'
    

    So it was the bare “.” that was making it not match. But this is “Any single character” according to the documentation, so it was unclear to me why it didn’t work.

    The rewriting guide escapes them all over the place, but with no indication that it is required or why, which is a shame.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At work we have been given a .cf7 file from a client and been
At my place of work we have a legacy document management system that for
I have to work with strings which may contain Lat/Long data, like this: $query
At work I have two XP PCs. On one, I can click with the
A few of us at work have been reading some on Haskell and we
at work we have an application that, at first, had been developed for a
At work we have a web app that we'll need to interface with another
at work we have a web-based PHP-application which acts as the single UI that
At work we have several Solaris servers. Each server runs apache which we compiled
at work we have been using JGroups and I have to say that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.