Forum archive 2000-2006

Blake Thornton - AliasMatch and Hardcopy errors: solution

Blake Thornton - AliasMatch and Hardcopy errors: solution

by Arnold Pizer -
Number of replies: 0
inactiveTopicAliasMatch and Hardcopy errors: solution topic started 8/24/2004; 1:31:43 PM
last post 8/25/2004; 4:44:37 PM
userBlake Thornton - AliasMatch and Hardcopy errors: solution  blueArrow
8/24/2004; 1:31:43 PM (reads: 1332, responses: 4)
Following Mike Gage's suggestion we found a tentative solution to the Hardcopy error we were having (see topics below). From what I can tell, the error seems to be an apache error in that apache is not reading the directive AliasMatch correctly. Here is what we did to fix it:

 

In webwork.apache-config, comment out the AliasMatch directives:

 

#AliasMatch $webwork_courses_url/([^/]*)/(.*) $webwork_courses_dir/$1/html/$2
#<Directory $webwork_courses_dir/*/html>
# Options FollowSymLinks
# AllowOverride None
#</Directory>

 

Put equivalent directives in httpd.conf, but AliasMatch doesn't work, so just use the Alias directive. Unfortunately, this means that we have to put a different directive in for each course that we create. (not terrible for us as we only host a few courses each semester):

 

Alias /webwork2_course_files/Course_Name_1 /opt/webwork2/courses/Course_Name_1/html
Alias /webwork2_course_files/Course_Name_2 /opt/webwork2/courses/Course_Name_2/html
<Directory /opt/webwork2/courses/*/html>
Options FollowSymLinks
AllowOverride None
</Directory>

It seems to work. If someone narrows down the problem and finds a better solution, I would love to implement it.

Blake

<| Post or View Comments |>


userSam Hathaway - Re: AliasMatch and Hardcopy errors: solution  blueArrow
8/24/2004; 4:35:32 PM (reads: 1559, responses: 0)
Blake,

Glad to see you found a workaround. Am I to understand that AliasMatch fails anywhere in your Apache configuration, not just in a <Perl> section in webwork.apache-config?

Can you give me an example of an AliasMatch directive that fails in httpd.conf? Remember that dollar-signs have to be escaped with a backslash on this discussion board.

In fact, escaping of dollar signs could be tripping you up. Inside a double-quoted string in a <Perl> section in webwork.apache-config, the AliasMatch directive should look like this:

 

AliasMatch $webwork_courses_url/([^/]*)/(.*) $webwork_courses_dir/\$1/html/\$2

Each dollar-sign should be escaped with one backslash. (On this discussion board, I type two backslashes, and it displays one.)

But outside of a double-quoted string and outside of a <Perl> section, in httpd.conf, the AliasMatch directive should look like this:

 

AliasMatch /webwork2_course_files/([^/]*)/(.*) /opt/webwork2/courses/$1/html/$2

That is, the dollar-signs are not escaped with any backslashes. (On this discussion board, I type one backslash, and it displays zero.)

<| Post or View Comments |>


userBlake Thornton - Re: AliasMatch and Hardcopy errors: solution  blueArrow
8/24/2004; 4:42:00 PM (reads: 1533, responses: 0)
Glad to see you found a workaround.

Me too!!!

Am I to understand that AliasMatch fails anywhere in your Apache configuration, not just in a <Perl> section in webwork.apache-config?

Yes, that is what we found. We attempted essentially copying the AliasMatch directive in httpd.conf and it didn't work. I am not sure I understood the backslash dollarsign 1 (\$1), but we tried it both with the backslash and without and it didn't work.

Can you give me an example of an AliasMatch directive that fails in httpd.conf?

If it would be useful, I can show you the apache error logs and such. But they were exactly the same as if the AliasMatch was in the webwork.apache-config file. I don't know exactly how things are set up, but this led me to believe that this was an apache problem and not a webwork problem.

Blake

<| Post or View Comments |>


userSam Hathaway - Re: AliasMatch and Hardcopy errors: solution  blueArrow
8/24/2004; 5:46:18 PM (reads: 1522, responses: 1)
It looks that it is an Apache problem. Please let us know if you find a way to resolve it.

<| Post or View Comments |>


userDavid K. Watson - Re: AliasMatch and Hardcopy errors: solution  blueArrow
8/25/2004; 4:44:37 PM (reads: 1739, responses: 0)
We were having a hardcopy problem as well. What fixed it for us was recompiling Apache, including the mod_perl module. For us, it appears that the mod_perl that was originally installed wasn't working correctly.

<| Post or View Comments |>