[us...@httpd] cgi as directory index?
I'm sure this one is really simple, but I don't know what I am doing wrong. I have the following config block in my httpd.conf file:ScriptAlias /abc /var/www/abc/cgi-binDirectory /var/www/abc/cgi-bin Options +ExecCGI allow from all directoryindex abc.cgi/Directoryif I go to http://myserver/abc/abc.cgi, it works fine. However, if I just go to http://myserver/abc, I get a "Forbidden" message. The error log shows "attempt to invoke directory as script: /var/www/abc/cgi-bin". I want to be able to just typehttp://myserver/abc to get to the script. What am I missing here? Thanks. ---Israel BrewsterComputer SupportTechnician IIFrontier Flying Service Inc.5245 Airport Industrial RdFairbanks, AK 99709(907) 450-7250 x293---BEGIN:VCARD VERSION:3.0 N:Brewster;Israel;;; FN:Israel Brewster ORG:Frontier Flying Service;MIS TITLE:PC Support Tech II EMAIL;type=INTERNET;type=WORK;type=pref:isr...@frontierflying.com TEL;type=WORK;type=pref:907-450-7293 item1.ADR;type=WORK;type=pref:;;5245 Airport Industrial Wy;Fairbanks;AK;99701; item1.X-ABADR:us CATEGORIES:General X-ABUID:36305438-95EA-4410-91AB-45D16CABCDDC\:ABPerson END:VCARD
Re: [us...@httpd] cgi as directory index?
On Oct 15, 2009, at 12:38 PM, Dick Davies wrote: Why don't you do ScriptAlias /abc /var/www/abc/cgi-bin/abc.cgi ? Because I didn't know you could do that. I thought aliases had to point to directories :) Knew it would be something simple :-P On Thu, Oct 15, 2009 at 8:35 PM, Israel Brewster isr...@frontierflying.com wrote: I'm sure this one is really simple, but I don't know what I am doing wrong. I have the following config block in my httpd.conf file: ScriptAlias /abc /var/www/abc/cgi-bin Directory /var/www/abc/cgi-bin Options +ExecCGI allow from all directoryindex abc.cgi /Directory if I go to http://myserver/abc/abc.cgi, it works fine. However, if I just go to http://myserver/abc, I get a Forbidden message. The error log shows attempt to invoke directory as script: /var/www/abc/cgi- bin. I want to be able to just type http://myserver/abc to get to the script. What am I missing here? Thanks. --- Israel Brewster Computer Support Technician II Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org --- Israel Brewster Computer Support Technician II Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- BEGIN:VCARD VERSION:3.0 N:Brewster;Israel;;; FN:Israel Brewster ORG:Frontier Flying Service;MIS TITLE:PC Support Tech II EMAIL;type=INTERNET;type=WORK;type=pref:isr...@frontierflying.com TEL;type=WORK;type=pref:907-450-7293 item1.ADR;type=WORK;type=pref:;;5245 Airport Industrial Wy;Fairbanks;AK;99701; item1.X-ABADR:us CATEGORIES:General X-ABUID:36305438-95EA-4410-91AB-45D16CABCDDC\:ABPerson END:VCARD - 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-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [EMAIL PROTECTED] .cgi as DirectoryIndex?
On Apr 10, 2008, at 8:37 AM, Christopher Bianchi wrote: Israel, Use mod_rewrite to redirect requests to a directory to the url of the cgi page, including any URL variables that you want. I was hoping to avoid that solution. My experiences with mod_rewrite have been, shall we say, somewhat less than pleasant :) Oh well, It'll work. Thanks! --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- Chris On Wed, April 9, 2008 2:37 pm, Israel Brewster wrote: I have a .cgi script that I would like to use as the DirectoryIndex for a location on my web server, preferably with the trailing ?abc= argument attached (although without would work too). I thought I might just be able to put the .cgi file as the DirectoryIndex directive for the directory, but that didn't work, failing with an attempt to invoke directory as script error. So what would be the easiest way to make this work? I don't need to hide the .cgi path/arguments from the end user or anything, i'd just like to be able to simply type www.myserver.com/abc and have the cgi (www.myserver.com/abc/somescript.cgi?someargument=somevalue) load. Thanks. --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED] .cgi as DirectoryIndex?
I have a .cgi script that I would like to use as the DirectoryIndex for a location on my web server, preferably with the trailing ?abc= argument attached (although without would work too). I thought I might just be able to put the .cgi file as the DirectoryIndex directive for the directory, but that didn't work, failing with an attempt to invoke directory as script error. So what would be the easiest way to make this work? I don't need to hide the .cgi path/arguments from the end user or anything, i'd just like to be able to simply type www.myserver.com/abc and have the cgi (www.myserver.com/abc/somescript.cgi?someargument=somevalue) load. Thanks. --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED] Basic mod_rewrite help
I am running a personal webserver with apache 1.3.33 on Mac OS X 10.4. I have a main site set up at the root level of http:// izzy.homeip.net, and a second site set up at the subdirectory of / ~mongoose. I recently added virtual hosts to my configuration, so now http://izzy.homeip.net/~mongoose can be accessed directly at http:// mongoosedelta.homeip.net. This all works as expected. Now I would like to set things up such that if you typed http://izzy.homeip.net/ ~mongoose the address is re-written to http:// mongoosedelta.homeip.net, for which I believe the correct tool to be mod_rewrite. in my httpd.conf file there is the following sections at the root level: LoadModule rewrite_module libexec/httpd/mod_rewrite.so AddModule mod_rewrite.c IfModule mod_rewrite.c RewriteEngine On RewriteCond %{REQUEST_METHOD} ^TRACE RewriteRule .* - [F] /IfModule which came with the default install. In order to implement the desired changes, I added the following lines: RewriteLog /var/log/httpd/rewrite.log RewriteLogLevel 2 RewriteRule ^/~mongoose(.*) http://mongoosedelta.homeip.net/$1 [NC,L,R] Yes, I know the R flag is redundant, however, all I am seeing in the rewrite log is entries like the following: [28/Sep/2007:10:04:43 -0800] [izzy.homeip.net/sid#1840290] [rid#1822238/initial] (1) [per-dir /WebServer/Documents/] pass through /WebServer/Documents/favicon.ico I have the root level of my webserver at /WebServer/Documents. Yes, I know it isn't standard, but I like it there :) My first thought was that it wasn't matching the rule, maybe because of the ~ or something, so I tried several different variations on the match pattern, including the way to generic .*mongoose.* but nothing seems to have made a difference. At one point I was getting similar entries on the home directory for the /~mongoose page, but with subsiquent changes they stopped, and now I can't even get those back- I'm not sure what I changed to get them in the first place or make them stop. Can anyone tell me what I am missing here, and how I can make this work? Thanks. --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] Basic mod_rewrite help
On Sep 28, 2007, at 10:48 AM, Joshua Slive wrote: On 9/28/07, Israel Brewster [EMAIL PROTECTED] wrote: which came with the default install. In order to implement the desired changes, I added the following lines: WHERE exactly did you add the lines? Oh, right, sorry, should have mentioned that. I inserted these lines at the end of the config file, outside of any configuration blocks. RewriteLog /var/log/httpd/rewrite.log RewriteLogLevel 2 Up the loglevel to 9 and try again. Still not seeing anything. Just for kicks, I tried rewriting the match part of that rule to just .* , and I still get nothing, either in the logs or redirected. I also tried adding a RewriteEngine on directive to the virtual host, with no results. Is there some way to verify that the rewrite engine is in fact operating? the lack of any sort of response would seem to indicate not, but I'm at a loss for why. If it helps, the config for the directory in question is Directory /Users/mongoose/Sites/ Options Indexes MultiViews AllowOverride All Order allow,deny Allow from all /Directory although I would think if this was wrong I would get some sort of error. Thanks for any assistance. Joshua. --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] Basic mod_rewrite help
On Sep 28, 2007, at 12:40 PM, Joshua Slive wrote: On 9/28/07, Israel Brewster [EMAIL PROTECTED] wrote: On Sep 28, 2007, at 10:48 AM, Joshua Slive wrote: On 9/28/07, Israel Brewster [EMAIL PROTECTED] wrote: which came with the default install. In order to implement the desired changes, I added the following lines: WHERE exactly did you add the lines? Oh, right, sorry, should have mentioned that. I inserted these lines at the end of the config file, outside of any configuration blocks. If the requests are being served by VirtualHosts, then you'll need to read http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#vhosts Perfect, thanks. That RewriteOptions inherit directive did the trick :) --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- (or simply place the directives inside the relevant VirtualHost block). Joshua. - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED] OpenBSD 4.1 CGI issues
First off, I apologize for asking a question that I know you get a lot, but I have just spent the last hour and a half beating my head against the wall and searching the internet trying to find a solution with no luck. Short version: I have an existing OpenBSD 4.0 box on which Apache (version 1.3.29) is working properly, including execution of CGI scripts. I am trying to move to a new machine with OpenBSD 4.1, so I started with a fresh OpenBSD 4.1 install, which comes with the same version of Apache as 4.0, and copied the httpd.conf file over from my old machine. After starting the web server, however, I found that it could not run any CGI scripts- always just giving me the following error: [Thu Aug 23 08:45:40 2007] [error] [client 127.0.0.1] Premature end of script headers: /cgi-bin/test-cgi The details: Aside from being OpenBSD 4.1, the new box is set up the same as the old one. I have checked and double checked the permissions on both the cgi files, including the test cgi included with the install, as well as the CGI folder. The test-cgi, as well as the printenv both run fine from a terminal window. I tried reverting to the factory default httpd.conf, with no luck. The permissions on the contents of the cgi-bin folder are as follows: ls -l /var/www/cgi-bin/ total 212 -- 1 root bin 99072 Mar 10 16:41 bgplg drwxr-xr-x 2 root daemon512 Aug 23 07:59 nagios -rwxrwxrwx 1 root bin 268 Mar 10 16:32 printenv -rwxrwxrwx 1 root bin 757 Mar 10 16:32 test-cgi the cgi-bin folder itself has 755 permissions. The relevant section from the httpd.conf file is as follows: ScriptAlias /cgi-bin/ /var/www/cgi-bin/ # # @@ServerRoot@@/cgi-bin should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # Directory /var/www/cgi-bin AllowOverride None Options none Order allow,deny Allow from all /Directory I have tried adding an AddHandler cgi-script .cgi directive to that block, as one webpage I found suggested, as well as changing the Option none to Options ExecCGI. I did, of course, restart the server between each configuration change. I have also tried with various different CGI scripts, most of which come from a fresh install. Nothing seems to make any difference- I still get the premature end of script headers error. If this was linux, i'd say check the SELinux settings, but it isn't. What am I missing here? --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] OpenBSD 4.1 CGI issues
On Aug 23, 2007, at 9:56 AM, Joshua Slive wrote: On 8/23/07, Israel Brewster [EMAIL PROTECTED] wrote: First off, I apologize for asking a question that I know you get a lot, but I have just spent the last hour and a half beating my head against the wall and searching the internet trying to find a solution with no luck. Short version: I have an existing OpenBSD 4.0 box on which Apache (version 1.3.29) is working properly, including execution of CGI scripts. I am trying to move to a new machine with OpenBSD 4.1, so I started with a fresh OpenBSD 4.1 install, which comes with the same version of Apache as 4.0, and copied the httpd.conf file over from my old machine. After starting the web server, however, I found that it could not run any CGI scripts- always just giving me the following error: [Thu Aug 23 08:45:40 2007] [error] [client 127.0.0.1] Premature end of script headers: /cgi-bin/test-cgi [...snip...] But anyway, this problem is fairly standard and is addressed here: http://httpd.apache.org/docs/1.3/howto/cgi.html#butitsstillnotworking As I mentioned in the first line, I was aware of that fact, and had been searching the internet for a solution and trying different things for the last hour and a half before asking for help :-) The error means that apache is perfectly happy to launch your CGI script, but the CGI is failing in some way. The first thing to try is running the CGI from the command line: cd /path/to/cgi-bin ./test-cgi Joshua. [...snip...] The test-cgi, as well as the printenv both run fine from a terminal window. Yep, as I also mentioned, tried that. Worked fine. I did manage to fix the problem though-turns out that the problem was with Apache being chrooted. The first line of the test script was looking for / bin/sh, which, when chrooted, Apache could not find. I thought I had checked this against my functioning box, but apparently I was looking at the wrong box or something. At any rate, un-chrooting Apache fixed the issue. Thanks for the help attempt! --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- I tried reverting to the factory default httpd.conf, with no luck. The permissions on the contents of the cgi-bin folder are as follows: ls -l /var/www/cgi-bin/ total 212 -- 1 root bin 99072 Mar 10 16:41 bgplg drwxr-xr-x 2 root daemon512 Aug 23 07:59 nagios -rwxrwxrwx 1 root bin 268 Mar 10 16:32 printenv -rwxrwxrwx 1 root bin 757 Mar 10 16:32 test-cgi the cgi-bin folder itself has 755 permissions. The relevant section from the httpd.conf file is as follows: ScriptAlias /cgi-bin/ /var/www/cgi-bin/ # # @@ServerRoot@@/cgi-bin should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # Directory /var/www/cgi-bin AllowOverride None Options none Order allow,deny Allow from all /Directory I have tried adding an AddHandler cgi-script .cgi directive to that block, as one webpage I found suggested, as well as changing the Option none to Options ExecCGI. I did, of course, restart the server between each configuration change. I have also tried with various different CGI scripts, most of which come from a fresh install. Nothing seems to make any difference- I still get the premature end of script headers error. If this was linux, i'd say check the SELinux settings, but it isn't. What am I missing here? --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] Restrict access to folders
On Mar 19, 2007, at 11:43 AM, Zembower, Kevin wrote: Maybe I'm missing something here, but … If neither PersonalSite nor ProfessionalSite contain any links to the other, and if they both contain an ‘index.html’ file to suppress automatic index generation, then users won’t be able to browse from one site to the other. Am I missing something? -Kevin If I read the question right, what you are missing is what happens if someone currently at www.myDomainName.com/PersonalSite decides to delete the /PersonalSite part of the URL, leaving them at www.myDomainName.com/ At that point (given no index.html file at root level and indexing enabled) they would be able to see both the PersonalSite and the ProfessionalSite directories, and navigate to either one. This also assumes that the physical directory structure of the site is set up with a root level folder containing both the PersonalSite folder and ProfessionalSite folder. As this is a lot of assumptions, I suspect that one or more would not hold up for any given site (for example, I would think most sites would have an index.html at root), and as such, there may not be an issue. However, if I am wrong, and assuming my understanding of the issue is correct, then I see a number of possibilities to restrict this behavior: 1) Place an index.html file at the root level of the server that does not contain links to ProfessionalSite and/or PersonalSite 2) Restrict access to the root level entirely using a Deny from ALL directive, which is then over-ridden in your ProfesionalSite and PersonalSite directories using an Allow from ALL directive (I think that would work) 3) Place your PersonalSite and ProfesionalSite directories outside of the webserver root directory, and use Alias directives to point / PersonalSite and /ProfessionalSite to them. That way even if you can list the root level directory, neither site will show up Those, at least, are what I can think of off the top of my head. There may be other/better options, depending on your site layout, requirements, and other stuff about Apache I don't know. --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, March 19, 2007 1:55 PM To: users@httpd.apache.org Subject: Re: [EMAIL PROTECTED] Restrict access to folders Hey Bruce, I'm a newbie and I'm interested in this question, too, so thanks for asking. - Original Message From: Bruce Hyatt [EMAIL PROTECTED] To: users@httpd.apache.org Sent: Monday, March 19, 2007 12:42:37 PM Subject: [EMAIL PROTECTED] Restrict access to folders Sorry, this is probably a tired newbie question. I've read the httpd.conf file and browsed the archives but haven't found what I'm looking for. If you could just point me in the right direction I'd be really happy. I want to set up something similar to virtual hosts but I only have one domain name. What I have in mind and I believe I've seen before is: www.myDomainName.com/PersonalSite www.myDomainName.com/ProfessionalSite set up so that people can't navigate up to the root, see the other site and navigate to it. I don't want to have to restrict the individual sites to password access. TIA, Bruce ___ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list.
[EMAIL PROTECTED] More mod_rewrite info
I was recently having an issue using mod_rewrite that turned out to be due to the PHP script that I was using querying the REQUEST_URI to figure out the page it needed to display, and the (apparent) fact that mod_rewrite doesn't change this value (see archives for full discussion/problem explanation). Now, I was able to fix the issue with a slight modification to the script, but it left me wondering- if mod_rewrite doesn't change the REQUEST_URI, what does it do? and is there something similar that does change the REQUEST_URI? Thanks for any information or links, and for helping to satisfy my curiosity :) --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] mod_rewrite problem
Just got a response from the developer of the PHP script (serendipity). Turns out the problem lies there, and not with the rewrite rule. Apparently what's going on is that the php script uses the REQUEST_URI to determine what to display. If it doesn't recognize the REQUEST_URI (as is the case with /nagios) it just displays the main page. It would appear that while mod_rewrite successfully rewrites the URL and calls the PHP script, it doesn't actually change the REQUEST_URI, so the script is still acting on /nagios, which it doesn't recognize. I'll admit this is somewhat beyond me at the moment, perhaps I need to look more into the difference between the REQUEST_URI that the php script is seeing and what, exactly, mod_rewrite is changing. At any rate, that at least explains the problem. On Mar 7, 2007, at 3:38 PM, Vincent Bray wrote: [snip] What's also changed and also puzzling is there's now two steps where there was just one. yeah, sorry. That was one of the things I was experimenting with. Since I knew the later rewrite rule worked as intended, I thought I'd try just rewriting /nagios into what the second rule was designed to match. Kind of a kludgy grasping at straws solution that didn't help anyway. The line that I am actually running is back with the index.php? section, I just copied and pasted the wrong code block. [snip] However, the first [L] should cause the second rule to not be reached, assuming that the [R] isn't meant to be there as you pointed out in the OP. ... And the last three rules shouldn't do anything (but let's let that drop). Interesting point. However, as these rules were added by serendipity and not me, and don't affect anything anyway, I'm not too concerned :) [snip] This looks like a general case of mod_rewrite overuse. It's often a better idea to use a blanket rewrite with exceptions for static files and then let the application split the url from the environment. But that's not your problem :) yep :) Actually, the original rule set did have a blanket anything.html = index.php?url=$1 rule, but as that made it so I couldn't access the non-serendipity directories on my server (trying, for example, http://izzy.homeip.net/Alaska/Alaska.html, which is an actual page, just wound up back at the home page), I removed it. Thinking about it though, a more elegant solution might be to put that rewrite rule back in by itself, and then use a RewriteEngine Off directive in my other directories to override it, or some such solution. It bears consideration. [snip] Just an aside, don't mix relative and absolute Options. That directive does what you probably think it should but it wouldn't if -Indexes weren't the first argument and besides: Options FollowSymLinks MultiViews has the same effect and requires less typing. well, it WOULD have the same effect, but for some reason Options Indexes is the default for the / directory, so if I don't override it for my other directories it generates an index page if you request a directory without an index file, which I don't want. I suppose a better option would be to simply remove the Options Indexes from the root level Directory block :) [snip] Hrmph, I don't seem to be really helping much. About the script, php is a pretty brute-force and ignorance kind of environment so just adding: phpinfo(); die(); to the start of the script after the opening ?php tag will show you what's getting passed in, just in case the problem is with the app. which does appear to be the case, as per the developer response. Thanks for the thoughts! -- noodl PS. I'm about to pass out for a few hours, good luck : ) --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] mod_rewrite problem
On Mar 8, 2007, at 8:33 AM, matt farey wrote: yeah, if you compare the number and type of rewrites for this package with the way that wordpress used to operate, there is a lot of correlation, instead now wordpress uses a much simpler form of rewrite which directs the REQUEST_URI to the application for subsequent alteration, as is the case with your serendipity app. My idea would be to handle all the serendipity rules with the app, leaving a much smaller set of rules which would happily coexist and be easy to modify. I know you say you aren't a php developer, but it wouldn't be that hard to locate and alter the script, perhaps though it would be difficult to subsequently update Serendipity and you would feel this would be a step too far. my $0.02 - when wordpress changed their rewrite rules from 2k down to 4 lines it was great! Actually, after the behavior I've been seeing while trying to work out this issue, I think the serendipity application may already work this way, in spite of the fact that it writes out that long list of rules. If I am understanding what is going on properly, then as long as the REQUEST_URI typed into the address bar is one that serendipity understands (i.e. /categories/8-Nagios) then it doesn't really matter what it is rewritten to, as long as the rewrite calls index.php? So, in theory at least, I should be able to replace all those rewrites with a blanket rewrite whatever to index.php?url=, and it should still work. Of course, I would need to have exceptions for the things I DON'T want handled my the serendipity php script, but that shouldn't be too difficult. I'll have to experiment with that some. -- Matthew Farey --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] mod_rewrite problem
Thanks for your response and suggestions. On Mar 7, 2007, at 9:48 AM, Vincent Bray wrote: Hi, welcome to rewrite-in-htaccess pain and suffering. As you're able to use RewriteLog, why put rewrite rules in htaccess? When I tried that my RewriteRules stopped working entirely :P I suspect that was just a mis-configuration on my part, however, so I'll keep looking. [snip] Otherwise (as suggested by rbowen) try adding PT to your flags to mitigate RewriteBase confusion. That didn't help -- noodl - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] mod_rewrite problem
[snip] In this case, ^nagios never matches because the per-directory prefix isn't stripped. ^/nagios is what you need, in addition to simillar changes for the rest of your rules. Ok, yeah- that made the rewrite rules start matching when in the httpd.conf file, unfortunately the behavior I'm getting with that particular rule is the same. Maybe it's time to consider a different approach entirely. This annoyance aside, putting rewrite rules in server context has other advantages, mainly increased speed (regexen are compiled once at startup and the uri-filepath translation stage can be skipped) but also decreased confusion; rewrite in htaccess involves extra steps beyond what seems reasonable to figure out the resulting url. -- noodl - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] mod_rewrite problem
On Mar 7, 2007, at 1:16 PM, Vincent Bray wrote: Like, posting the rest of your rules, perhaps? As you're rewriting to a php script, are you able to edit it to show a dump of the environment? phpinfo(); die(); does that job. Also, are there any Alias directives for nagios? Seeing your config in more detail would help. -- noodl Oh, sure. Sorry- not trying to make things difficult here, it's just that I spent several hours yesterday working on the issue, so I'm a bit frustrated, and quite possibly not thinking straight any more :P. Anyway, the rewrite rules I'm currently working with are as follows: RewriteLog /var/log/httpd/rewrite.log RewriteLogLevel 2 RewriteRule ^/nagios[/A-Za-z0-9]* /categories/8-Nagios [NC,QSA,L,R] RewriteRule ^(/archives/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+\.html) / index.php?/$1 [NC,L,QSA] RewriteRule ^(/authors/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+) /index.php?/ $1 [NC,L,QSA] RewriteRule ^(/feeds/categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-\%]+ \.rss) /index.php?/$1 [NC,L,QSA] RewriteRule ^(/feeds/authors/([0-9]+)-[0-9a-z\.\_!;,\+\-\%]+\.rss) / index.php?/$1 [NC,L,QSA] RewriteRule ^(/categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-\%]+) / index.php?/$1 [NC,L,QSA] RewriteRule ^/archives([/A-Za-z0-9]+)\.html /index.php?url=/archives/ $1.html [NC,L,QSA] RewriteRule ^(/[0-9]+)[_\-][0-9a-z_\-]*\.html /index.php?url=$1- article.html [L,NC,QSA] RewriteRule ^/feeds/(.*) /index.php?url=/feeds/$1 [L,QSA] RewriteRule ^/unsubscribe/(.*)/([0-9]+) /index.php?url=/unsubscribe/ $1/$2 [L,QSA] RewriteRule ^/approve/(.*)/(.*)/([0-9]+) /index.php?url=approve/$1/$2/ $3 [L,QSA] RewriteRule ^/delete/(.*)/(.*)/([0-9]+) /index.php?url=delete/$1/$2/ $3 [L,QSA] RewriteRule ^(/admin|entries)(/.+)? /index.php?url=admin/ [L,QSA] RewriteRule ^/archive/? /index.php?url=/archive [L,QSA] RewriteRule ^(/index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) / rss.php?file=$1ext=$2 RewriteRule ^(/plugin|plugin)/(.*) /index.php?url=$1/$2 [L,QSA] RewriteRule ^/search/(.*) /index.php?url=/search/$1 [L,QSA] RewriteRule ^/comments/(.*) /index.php?url=/comments/$1 [L,QSA] RewriteRule ^(serendipity\.css|serendipity_admin\.css) index.php?url=/ $1 [L,QSA] RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA] RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA] Aside from the nagios one that I added, this is the standard set of rules for a serendipity (www.s9y.org) install. I have tried commenting out all of them (completely breaking my site, of course) except for the nagios one, but I still wind up at the index page when I try accessing /nagios. The Directory block for the root directory (which this is all running out of) is the following: Directory /WebServer/Documents Options -Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all RewriteEngine On /Directory the rest of my httpd.conf is default, the only other parts I have edited being the server name and UseCanonicalName directives. I could potentially edit the php file, but I really don't know php- my programing skills are primarily limited to shell scripting and C+ + :) Where would I stick that code, or would that depend on the script (as I suspect would be the case)? It is the serendipity index.php file if you want to download it and take a look. Thank you VERY much for your help. I greatly appreciate it :) --- Israel Brewster Computer Support Technician Frontier Flying Service Inc. 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7250 x293 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] mod_perl issue
On Jan 21, 2007, at 11:39 PM, Matus UHLAR - fantomas wrote: On 21.01.07 14:35, Israel Brewster wrote: I have a perl script running in apache 1.3 which generates a .png image. If i run it normally (using system perl), it works. When I try running it under mod_perl however (increased performance, works under chrooting), the first line of the png file data (the image headers) gets cut off, making it so the system no longer recognizes it a an image, and all I get is a bunch of giberish on the screen. Is there something I can do to fix this? Thanks. what if you try to run it as CGI? That works, if I understand what you are saying. Running it through the webserver just as a CGI (not using mod_perl) creates and displays the .png properly. it is only when running through mod_perl that there is an issue. I think that the first line should give server the content type, optionally following a few header lines, and then the image... I think you're right. Unfortunately, it's these first few lines that get chopped, leaving the server with no idea what type of file it is dealing with. As a result, it either just dumps the raw contents to the browser, or else downloads it as a binary. unfortunately, even then it can't display as it is missing some essential lines. As an example, if I run the command less file.png on a good .png image, the ASCII representation of the binary code for the first few lines is the following: 89PNG ^Z [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED] and so on and so forth. The files created by the script (when run through mod_perl), however, look like so: ^Z [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@ note that the 89PNG portion is missing. It may be worth noting that the scrip has the option to create GIF's rather than PNG's, but the GIFS run into the same issue. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED] mod_perl issue
I have a perl script running in apache 1.3 which generates a .png image. If i run it normally (using system perl), it works. When I try running it under mod_perl however (increased performance, works under chrooting), the first line of the png file data (the image headers) gets cut off, making it so the system no longer recognizes it a an image, and all I get is a bunch of giberish on the screen. Is there something I can do to fix this? Thanks. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] Simple perl question
Well, as it turned out, I didn't need to go that route after all. I just needed to use the correct URL when accessing my perl scripts so they would be executed using mod Perl. So it's working now, without needing to copy or re-install perl. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 11, 2007, at 11:41 PM, Issac Goldstand wrote: Unfortunately, that's the price of a chroot... Remember to also install all your Perl modules to the chroot jail for the same reasons... Basically a separate install of Perl would be intelligent. If you want some form of package management/uninstall for the new one, or even just don't want to deal with compiling etc, you might install a binary ActivePerl distribution - I do this on several servers of mine. Issac Israel Brewster wrote: Yeah, I'm coming to that conclusion. I didn't want to go that route, and have two copies of perl on my system, but it is looking as though that will be my best option --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 11, 2007, at 1:38 AM, Issac Goldstand wrote: mod_perl sounds a bit excessive. Just make sure Perl is installed in your chroot. Issac Serge Dubrouski wrote: For this configuration you need to have mod_perl installed on your server. Why don't you simply put your script into your cgi-bin directory? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I don't know if what I am trying to do here is even possible (sane?) but I thought I'd ask. I am running Apache 1.3.29 on an OpenBSD 4.0 system, with Apache chrooted to /var/www. I have a perl script CGI (it has the .cgi extention, not .pl, but is actually a perl script) that I need to run. Currently, the script is written to run using the system perl interpreter, with the first line of the script being #!/ usr/bin/perl This obviously doesn't work, since when it runs as a CGI it is chrooted to /var/www, and can not see /usr/bin. Now I would think that Apache should be able to run this script using the perl module, which I have installed, but I can't seem to get it to work. Could someone point me to something that tells me how to properly enable/run perl scripts in Apache? I looked at mod_perl website, but all it says is to add a code block like the following: Alias /perl/ /home/httpd/perl/ PerlModule Apache::Registry Location /perl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI allow from all PerlSendHeader On /Location which just gives me an 'Invalid command 'PerlModule' This would imply to me that mod_perl isn't being loaded, in spite of being installed, but that leaves me needing to know how to load the perl module. Adding a line like LoadModule mod_perl /usr/local/lib/mod_perl.so (which is the correct path to the mod_perl.so file) just gives me a Can't locate API module structure `mod_perl' in file /usr/ local/lib/ mod_perl.so: Unable to resolve symbol What am I missing here? How can I get Apache to run perl scripts? Thanks for any assistance that can be provided --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- -- --- 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- -- 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e
Re: [EMAIL PROTECTED] Simple perl question
Yeah, I did need to copy the perl modules I needed, but that was no big deal. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 11, 2007, at 11:42 PM, Issac Goldstand wrote: It still needs modules, etc, at the very least while Apache starts (they are usually cached in memory once intially loaded) Issac Serge Dubrouski wrote: modperl doesn't need to have perl installed because it has it embedded. Have you tried to put your script into your /perl directory and run it using Apache::Registry? But most probably it'll have problems anyway because it'll require perl libraries: CGI, strict, etc... unless it's a really generic script. On 1/11/07, Israel Brewster [EMAIL PROTECTED] wrote: On Jan 11, 2007, at 6:22 AM, Serge Dubrouski wrote: DO NOT REMOVE that #!/usr/bin/perl line. Without it OS tries to run it as a binary (ELF or whatever is appropriate for your systen ) file and of course fails. But with it, it can not find /usr/bin/perl (thanks to the chroot), and, of course, fails :-p bit of a catch 22-can't run with it, can't run without it. So after reading the various responses, as well as some additional web searching, I have gone ahead and copied /usr/ bin/ perl to /var/www/usr/bin/perl so the script can see/access /usr/bin/ perl, even when chrooted. This, at least, gets rid of the cant find file/directory and invalid exec format errors. I'm still getting a premature end of script headers error when I try to run it though Apache, however. Running the test script as chroot /var/www/ /cgi- bin/test.cgi gives an Abort trap error. Running it normally (not chrooted) works. Obviously I do not have a proper install of perl in my chroot. Sigh. I'll keep trying. Thanks for the responses! --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: yeah, perl is not available at all from within the Apache chroot jail, unless I am missing something. Making the change to the LoadModule line you suggested allowed the various perl directives in the config file to load without complaint. Attempting to execute the script, however, results in a [error] (8)Exec format error: exec of / cgi-bin/perl/routers2.cgi failed This error is the same if I try with either a .cgi extension on the file or a .pl extension --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 4:31 PM, Serge Dubrouski wrote: So you don't have perl available at all? Then you definetely need mod_perl. Have you tried to change your LoadModule line for mod_perl like I suggested erlier? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: But with it I get a file not found error since it can't access / usr/ bin/perl from within the chroot (/var/www). If that line can't be removed, then apparently I can't run perl scripts under Apache with Apache chrooted, even with mod_perl running properly-is that correct? or do I just need to change that line to something else? On the brighter side, changing the LoadModule line as suggested did allow the config directives to load properly. Didn't help get the script to run though. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 2:35 PM, Serge Dubrouski wrote: Do not remove #!/usr/bin/perl line! Without it OS doesn't know how to run that file. On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I installed mod_perl from the package that was distributed with OpenBSD 4.0. The install didn't give any errors, so I have to assume it installed properly. As far as I can tell, it didn't make any configuration changes. Just placing the script in my CGI directory (and removing the #!/usr/bin/perl line) gives [error] (8)Exec format error: exec of /cgi-bin/perl/routers2.pl failed. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 1:39 PM, Serge Dubrouski wrote: For this configuration you need to have mod_perl installed on your server. Why don't you simply put your script into your cgi- bin directory? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I don't know if what I am trying to do here is even possible (sane?) but I
Re: [EMAIL PROTECTED] Simple perl question
On Jan 11, 2007, at 6:22 AM, Serge Dubrouski wrote: DO NOT REMOVE that #!/usr/bin/perl line. Without it OS tries to run it as a binary (ELF or whatever is appropriate for your systen ) file and of course fails. But with it, it can not find /usr/bin/perl (thanks to the chroot), and, of course, fails :-p bit of a catch 22-can't run with it, can't run without it. So after reading the various responses, as well as some additional web searching, I have gone ahead and copied /usr/bin/ perl to /var/www/usr/bin/perl so the script can see/access /usr/bin/ perl, even when chrooted. This, at least, gets rid of the cant find file/directory and invalid exec format errors. I'm still getting a premature end of script headers error when I try to run it though Apache, however. Running the test script as chroot /var/www/ /cgi- bin/test.cgi gives an Abort trap error. Running it normally (not chrooted) works. Obviously I do not have a proper install of perl in my chroot. Sigh. I'll keep trying. Thanks for the responses! --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: yeah, perl is not available at all from within the Apache chroot jail, unless I am missing something. Making the change to the LoadModule line you suggested allowed the various perl directives in the config file to load without complaint. Attempting to execute the script, however, results in a [error] (8)Exec format error: exec of / cgi-bin/perl/routers2.cgi failed This error is the same if I try with either a .cgi extension on the file or a .pl extension --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 4:31 PM, Serge Dubrouski wrote: So you don't have perl available at all? Then you definetely need mod_perl. Have you tried to change your LoadModule line for mod_perl like I suggested erlier? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: But with it I get a file not found error since it can't access / usr/ bin/perl from within the chroot (/var/www). If that line can't be removed, then apparently I can't run perl scripts under Apache with Apache chrooted, even with mod_perl running properly-is that correct? or do I just need to change that line to something else? On the brighter side, changing the LoadModule line as suggested did allow the config directives to load properly. Didn't help get the script to run though. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 2:35 PM, Serge Dubrouski wrote: Do not remove #!/usr/bin/perl line! Without it OS doesn't know how to run that file. On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I installed mod_perl from the package that was distributed with OpenBSD 4.0. The install didn't give any errors, so I have to assume it installed properly. As far as I can tell, it didn't make any configuration changes. Just placing the script in my CGI directory (and removing the #!/usr/bin/perl line) gives [error] (8)Exec format error: exec of /cgi-bin/perl/routers2.pl failed. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 1:39 PM, Serge Dubrouski wrote: For this configuration you need to have mod_perl installed on your server. Why don't you simply put your script into your cgi- bin directory? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I don't know if what I am trying to do here is even possible (sane?) but I thought I'd ask. I am running Apache 1.3.29 on an OpenBSD 4.0 system, with Apache chrooted to /var/www. I have a perl script CGI (it has the .cgi extention, not .pl, but is actually a perl script) that I need to run. Currently, the script is written to run using the system perl interpreter, with the first line of the script being #!/ usr/bin/perl This obviously doesn't work, since when it runs as a CGI it is chrooted to /var/www, and can not see /usr/bin. Now I would think that Apache should be able to run this script using the perl module, which I have installed, but I can't seem to get it to work. Could someone point me to something that tells me how to properly enable/run perl scripts in Apache? I looked at mod_perl website, but all
Re: [EMAIL PROTECTED] Simple perl question
On Jan 11, 2007, at 2:15 AM, Mark Feather wrote: What is not being found? /usr/bin/perl, since it is not in the chroot jail Is apache finding the perl script or is perl not finding what it wants to run the script. Perl is not being found- it can't be, since apache (annd, by extention, the CGI's run under it) is chrooted to /var/www Have you had perl scripts running without errors in the past? Nope. At least, not through the webserver. Never tried before. Perl scripts are running fine on the system level When you try running the test.cgi script does apache / your browser find it and try to run it, if apache does find it and it does start then is it perl that is if failing to run the script because it is misconfigured in some way? Apache finds it and tries to run it, but as with the main script, it can't find /usr/bin/perl --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - Original Message - From: Israel Brewster [EMAIL PROTECTED] To: users@httpd.apache.org Sent: Wednesday, January 10, 2007 11:56 PM Subject: Re: [EMAIL PROTECTED] Simple perl question But with it I get a file not found error since it can't access / usr/ bin/perl from within the chroot (/var/www). If that line can't be removed, then apparently I can't run perl scripts under Apache with Apache chrooted, even with mod_perl running properly- is that correct? or do I just need to change that line to something else? On the brighter side, changing the LoadModule line as suggested did allow the config directives to load properly. Didn't help get the script to run though. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 2:35 PM, Serge Dubrouski wrote: Do not remove #!/usr/bin/perl line! Without it OS doesn't know how to run that file. On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I installed mod_perl from the package that was distributed with OpenBSD 4.0. The install didn't give any errors, so I have to assume it installed properly. As far as I can tell, it didn't make any configuration changes. Just placing the script in my CGI directory (and removing the #!/usr/bin/perl line) gives [error] (8)Exec format error: exec of /cgi-bin/perl/routers2.pl failed. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 1:39 PM, Serge Dubrouski wrote: For this configuration you need to have mod_perl installed on your server. Why don't you simply put your script into your cgi-bin directory? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I don't know if what I am trying to do here is even possible (sane?) but I thought I'd ask. I am running Apache 1.3.29 on an OpenBSD 4.0 system, with Apache chrooted to /var/www. I have a perl script CGI (it has the .cgi extention, not .pl, but is actually a perl script) that I need to run. Currently, the script is written to run using the system perl interpreter, with the first line of the script being #!/ usr/bin/perl This obviously doesn't work, since when it runs as a CGI it is chrooted to /var/www, and can not see /usr/bin. Now I would think that Apache should be able to run this script using the perl module, which I have installed, but I can't seem to get it to work. Could someone point me to something that tells me how to properly enable/run perl scripts in Apache? I looked at mod_perl website, but all it says is to add a code block like the following: Alias /perl/ /home/httpd/perl/ PerlModule Apache::Registry Location /perl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI allow from all PerlSendHeader On /Location which just gives me an 'Invalid command 'PerlModule' This would imply to me that mod_perl isn't being loaded, in spite of being installed, but that leaves me needing to know how to load the perl module. Adding a line like LoadModule mod_perl /usr/local/lib/ mod_perl.so (which is the correct path to the mod_perl.so file) just gives me a Can't locate API module structure `mod_perl' in file /usr/ local/lib/ mod_perl.so: Unable to resolve symbol What am I missing here? How can I get Apache to run perl scripts? Thanks for any assistance that can be provided --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709
Re: [EMAIL PROTECTED] Simple perl question
Yeah, I'm coming to that conclusion. I didn't want to go that route, and have two copies of perl on my system, but it is looking as though that will be my best option --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 11, 2007, at 1:38 AM, Issac Goldstand wrote: mod_perl sounds a bit excessive. Just make sure Perl is installed in your chroot. Issac Serge Dubrouski wrote: For this configuration you need to have mod_perl installed on your server. Why don't you simply put your script into your cgi-bin directory? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I don't know if what I am trying to do here is even possible (sane?) but I thought I'd ask. I am running Apache 1.3.29 on an OpenBSD 4.0 system, with Apache chrooted to /var/www. I have a perl script CGI (it has the .cgi extention, not .pl, but is actually a perl script) that I need to run. Currently, the script is written to run using the system perl interpreter, with the first line of the script being #!/ usr/bin/perl This obviously doesn't work, since when it runs as a CGI it is chrooted to /var/www, and can not see /usr/bin. Now I would think that Apache should be able to run this script using the perl module, which I have installed, but I can't seem to get it to work. Could someone point me to something that tells me how to properly enable/run perl scripts in Apache? I looked at mod_perl website, but all it says is to add a code block like the following: Alias /perl/ /home/httpd/perl/ PerlModule Apache::Registry Location /perl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI allow from all PerlSendHeader On /Location which just gives me an 'Invalid command 'PerlModule' This would imply to me that mod_perl isn't being loaded, in spite of being installed, but that leaves me needing to know how to load the perl module. Adding a line like LoadModule mod_perl /usr/local/lib/mod_perl.so (which is the correct path to the mod_perl.so file) just gives me a Can't locate API module structure `mod_perl' in file /usr/local/ lib/ mod_perl.so: Unable to resolve symbol What am I missing here? How can I get Apache to run perl scripts? Thanks for any assistance that can be provided --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] Unwanted rewrite followup/continuationn
Thank you! That is EXACTLY what I was looking for! Sure enough, the default config supplied with my system had a UseCanonicalName On directive in there, changing that to Off fixed the issue. I knew there had to be something like that, I just didn't know where to look. Thanks again! --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 11, 2007, at 3:56 AM, Krist van Besien wrote: Put the following in your httpd.conf: UseCanonicalName off Krist -- [EMAIL PROTECTED] Bremgarten b. Bern, Switzerland -- ...what you don't realize is that in the future Google WILL reach sentience, will [have had] invent[ed] a time machine, and will [have had] travel[ed] back in time to prevent Bill Gates... only to become Bill Gates by accident because of a search engine optimization miscalculation. (Comment on the Dilbert Blog) - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] Simple perl question
Ok- FINALLY got it working. Turns out I was bitten by the wording of my http.conf- I had used a location directive to tell it to execute using the perl_module for the location /perl, but then I was accessing the script through /cgi-bin/perl (/cgi-bin/perl is aliased to /perl) Once I tried accessing the script at /perl, it worked- mostly. still have a few dependancies I need to work out, but that I can manage. Thanks for all the suggestions! On Jan 11, 2007, at 8:16 AM, Serge Dubrouski wrote: modperl doesn't need to have perl installed because it has it embedded. Have you tried to put your script into your /perl directory and run it using Apache::Registry? But most probably it'll have problems anyway because it'll require perl libraries: CGI, strict, etc... unless it's a really generic script. On 1/11/07, Israel Brewster [EMAIL PROTECTED] wrote: On Jan 11, 2007, at 6:22 AM, Serge Dubrouski wrote: DO NOT REMOVE that #!/usr/bin/perl line. Without it OS tries to run it as a binary (ELF or whatever is appropriate for your systen ) file and of course fails. But with it, it can not find /usr/bin/perl (thanks to the chroot), and, of course, fails :-p bit of a catch 22-can't run with it, can't run without it. So after reading the various responses, as well as some additional web searching, I have gone ahead and copied /usr/bin/ perl to /var/www/usr/bin/perl so the script can see/access /usr/bin/ perl, even when chrooted. This, at least, gets rid of the cant find file/directory and invalid exec format errors. I'm still getting a premature end of script headers error when I try to run it though Apache, however. Running the test script as chroot /var/www/ /cgi- bin/test.cgi gives an Abort trap error. Running it normally (not chrooted) works. Obviously I do not have a proper install of perl in my chroot. Sigh. I'll keep trying. Thanks for the responses! --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: yeah, perl is not available at all from within the Apache chroot jail, unless I am missing something. Making the change to the LoadModule line you suggested allowed the various perl directives in the config file to load without complaint. Attempting to execute the script, however, results in a [error] (8)Exec format error: exec of / cgi-bin/perl/routers2.cgi failed This error is the same if I try with either a .cgi extension on the file or a .pl extension --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 4:31 PM, Serge Dubrouski wrote: So you don't have perl available at all? Then you definetely need mod_perl. Have you tried to change your LoadModule line for mod_perl like I suggested erlier? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: But with it I get a file not found error since it can't access / usr/ bin/perl from within the chroot (/var/www). If that line can't be removed, then apparently I can't run perl scripts under Apache with Apache chrooted, even with mod_perl running properly-is that correct? or do I just need to change that line to something else? On the brighter side, changing the LoadModule line as suggested did allow the config directives to load properly. Didn't help get the script to run though. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 2:35 PM, Serge Dubrouski wrote: Do not remove #!/usr/bin/perl line! Without it OS doesn't know how to run that file. On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I installed mod_perl from the package that was distributed with OpenBSD 4.0. The install didn't give any errors, so I have to assume it installed properly. As far as I can tell, it didn't make any configuration changes. Just placing the script in my CGI directory (and removing the #!/usr/bin/perl line) gives [error] (8) Exec format error: exec of /cgi-bin/perl/routers2.pl failed. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 1:39 PM, Serge Dubrouski wrote: For this configuration you need to have mod_perl installed on your server. Why don't you simply put your script into your cgi- bin
[EMAIL PROTECTED] Unwanted rewrite followup/continuationn
Ok, so I have managed to work around the problem below by putting the hostname of the Apache server in the /etc/hosts file on the machines that need to access the server by IP, so when it changes the IP to the hostname the client can still find the server. This, however, feels like a kludgy workaround, and wouldn't be feasible if we had more than a couple machines that needed to access this server via ip. Is there any way to convince Apache to NOT change the IP inn the URL to the hostname? Thanks for any assistance that can be provided. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 8, 2007, at 9:55 AM, Israel Brewster wrote: I am running into a somewhat annoying problem with Apache 1.3.29 on an OpenBSD 4.0 box. When attempting to access the server via IP address, it loads the first page fine, but after clicking a link to another page it rewrites the IP address in the URL to the hostname of the machine. This promptly results in a server not found error, as the hostname of the machine is not in DNS. How can I get appache to leave the URL alone? The config of this server is mostly still the default, aside from some authorization directives. Due to the network setup, simply setting the ServerName directive to the IP won't work, the problem there being that the IP the machine is accessed at is different depending on if you are accessing it from inside our network or outside. Actually, inside our network our internal DNS is set up so you can access the server by the hostname, but outside you need to use the IP (we don't want to make this server easy to find). Thank you for any assistance you can provide. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] Unwanted rewrite followup/continuationn
Unfortunately, that won't work: the IP is different depending on where the machine is being accessed from. So as long as Apache insists on changing the URL to the server name, I will always have issues- it will just change depending on what I use for the server name. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 10:13 AM, Mark Lavi wrote: Try changing the servername directive to the IP address in httpd.conf, I believe that will work. E.g.: VirtualHost *:80 ServerName 127.0.0.1 # etc /VirtualHost --Mark Mark Lavi, Enterprise Web Management Team @ SGI mailto:[EMAIL PROTECTED] || phone:+1-650-933-7707 -Original Message- From: Israel Brewster [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 10, 2007 9:00 AM To: users@httpd.apache.org Subject: [EMAIL PROTECTED] Unwanted rewrite followup/continuationn Ok, so I have managed to work around the problem below by putting the hostname of the Apache server in the /etc/hosts file on the machines that need to access the server by IP, so when it changes the IP to the hostname the client can still find the server. This, however, feels like a kludgy workaround, and wouldn't be feasible if we had more than a couple machines that needed to access this server via ip. Is there any way to convince Apache to NOT change the IP inn the URL to the hostname? Thanks for any assistance that can be provided. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 8, 2007, at 9:55 AM, Israel Brewster wrote: I am running into a somewhat annoying problem with Apache 1.3.29 on an OpenBSD 4.0 box. When attempting to access the server via IP address, it loads the first page fine, but after clicking a link to another page it rewrites the IP address in the URL to the hostname of the machine. This promptly results in a server not found error, as the hostname of the machine is not in DNS. How can I get appache to leave the URL alone? The config of this server is mostly still the default, aside from some authorization directives. Due to the network setup, simply setting the ServerName directive to the IP won't work, the problem there being that the IP the machine is accessed at is different depending on if you are accessing it from inside our network or outside. Actually, inside our network our internal DNS is set up so you can access the server by the hostname, but outside you need to use the IP (we don't want to make this server easy to find). Thank you for any assistance you can provide. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED] Simple perl question
I don't know if what I am trying to do here is even possible (sane?) but I thought I'd ask. I am running Apache 1.3.29 on an OpenBSD 4.0 system, with Apache chrooted to /var/www. I have a perl script CGI (it has the .cgi extention, not .pl, but is actually a perl script) that I need to run. Currently, the script is written to run using the system perl interpreter, with the first line of the script being #!/ usr/bin/perl This obviously doesn't work, since when it runs as a CGI it is chrooted to /var/www, and can not see /usr/bin. Now I would think that Apache should be able to run this script using the perl module, which I have installed, but I can't seem to get it to work. Could someone point me to something that tells me how to properly enable/run perl scripts in Apache? I looked at mod_perl website, but all it says is to add a code block like the following: Alias /perl/ /home/httpd/perl/ PerlModule Apache::Registry Location /perl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI allow from all PerlSendHeader On /Location which just gives me an 'Invalid command 'PerlModule' This would imply to me that mod_perl isn't being loaded, in spite of being installed, but that leaves me needing to know how to load the perl module. Adding a line like LoadModule mod_perl /usr/local/lib/mod_perl.so (which is the correct path to the mod_perl.so file) just gives me a Can't locate API module structure `mod_perl' in file /usr/local/lib/ mod_perl.so: Unable to resolve symbol What am I missing here? How can I get Apache to run perl scripts? Thanks for any assistance that can be provided --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] Simple perl question
I installed mod_perl from the package that was distributed with OpenBSD 4.0. The install didn't give any errors, so I have to assume it installed properly. As far as I can tell, it didn't make any configuration changes. Just placing the script in my CGI directory (and removing the #!/usr/bin/perl line) gives [error] (8)Exec format error: exec of /cgi-bin/perl/routers2.pl failed. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 1:39 PM, Serge Dubrouski wrote: For this configuration you need to have mod_perl installed on your server. Why don't you simply put your script into your cgi-bin directory? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I don't know if what I am trying to do here is even possible (sane?) but I thought I'd ask. I am running Apache 1.3.29 on an OpenBSD 4.0 system, with Apache chrooted to /var/www. I have a perl script CGI (it has the .cgi extention, not .pl, but is actually a perl script) that I need to run. Currently, the script is written to run using the system perl interpreter, with the first line of the script being #!/ usr/bin/perl This obviously doesn't work, since when it runs as a CGI it is chrooted to /var/www, and can not see /usr/bin. Now I would think that Apache should be able to run this script using the perl module, which I have installed, but I can't seem to get it to work. Could someone point me to something that tells me how to properly enable/run perl scripts in Apache? I looked at mod_perl website, but all it says is to add a code block like the following: Alias /perl/ /home/httpd/perl/ PerlModule Apache::Registry Location /perl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI allow from all PerlSendHeader On /Location which just gives me an 'Invalid command 'PerlModule' This would imply to me that mod_perl isn't being loaded, in spite of being installed, but that leaves me needing to know how to load the perl module. Adding a line like LoadModule mod_perl /usr/local/lib/mod_perl.so (which is the correct path to the mod_perl.so file) just gives me a Can't locate API module structure `mod_perl' in file /usr/local/lib/ mod_perl.so: Unable to resolve symbol What am I missing here? How can I get Apache to run perl scripts? Thanks for any assistance that can be provided --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [EMAIL PROTECTED] Simple perl question
But with it I get a file not found error since it can't access /usr/ bin/perl from within the chroot (/var/www). If that line can't be removed, then apparently I can't run perl scripts under Apache with Apache chrooted, even with mod_perl running properly-is that correct? or do I just need to change that line to something else? On the brighter side, changing the LoadModule line as suggested did allow the config directives to load properly. Didn't help get the script to run though. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 2:35 PM, Serge Dubrouski wrote: Do not remove #!/usr/bin/perl line! Without it OS doesn't know how to run that file. On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I installed mod_perl from the package that was distributed with OpenBSD 4.0. The install didn't give any errors, so I have to assume it installed properly. As far as I can tell, it didn't make any configuration changes. Just placing the script in my CGI directory (and removing the #!/usr/bin/perl line) gives [error] (8)Exec format error: exec of /cgi-bin/perl/routers2.pl failed. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 1:39 PM, Serge Dubrouski wrote: For this configuration you need to have mod_perl installed on your server. Why don't you simply put your script into your cgi-bin directory? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I don't know if what I am trying to do here is even possible (sane?) but I thought I'd ask. I am running Apache 1.3.29 on an OpenBSD 4.0 system, with Apache chrooted to /var/www. I have a perl script CGI (it has the .cgi extention, not .pl, but is actually a perl script) that I need to run. Currently, the script is written to run using the system perl interpreter, with the first line of the script being #!/ usr/bin/perl This obviously doesn't work, since when it runs as a CGI it is chrooted to /var/www, and can not see /usr/bin. Now I would think that Apache should be able to run this script using the perl module, which I have installed, but I can't seem to get it to work. Could someone point me to something that tells me how to properly enable/run perl scripts in Apache? I looked at mod_perl website, but all it says is to add a code block like the following: Alias /perl/ /home/httpd/perl/ PerlModule Apache::Registry Location /perl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI allow from all PerlSendHeader On /Location which just gives me an 'Invalid command 'PerlModule' This would imply to me that mod_perl isn't being loaded, in spite of being installed, but that leaves me needing to know how to load the perl module. Adding a line like LoadModule mod_perl /usr/local/lib/mod_perl.so (which is the correct path to the mod_perl.so file) just gives me a Can't locate API module structure `mod_perl' in file /usr/ local/lib/ mod_perl.so: Unable to resolve symbol What am I missing here? How can I get Apache to run perl scripts? Thanks for any assistance that can be provided --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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
Re: [EMAIL PROTECTED] Unwanted rewrite followup/continuationn
Thanks, I'll consider those, perhaps one or more will be doable. Although I wouldn't say I am expecting Apache to understand my network, I'm just expecting it to leave the URL I enter alone, i.e., if I type http://1.2.3.4/something in the address bar, I want that to STAY http://1.2.3.4/something, and if I click a relative link (not absolute) to /somethingelse, it should then be http://1.2.3.4/ somethingelse. As things stand, Apache for some reason decides to change the 1.2.3.4, even though the link clicked doesn't affect that portion of the address. I want to turn off this rewriting of the URL- just leave it alone, as entered. If I understand what you are saying, though, this is not possible- Apache will always rewrite the URL. If so, I'l deal with it, but I'd rather not have to :) If it helps any, the exact setup (and the reason for the whole conundrum) is the following: We have the server set up on our internal network, with an given inside-only routable IP, let's call it 10.10.10.10. This internal network has DNS set up on, so all the machines inside can be accessed from inside by name rather than ip. So inside our network I can access this machine either by ip or hostname, and if apache rewrites the ip to the hostname, no bigie, since it is in DNS as well. Now certain people in our company have a need to access this server from outside our network. For this purpose I have set up a 1-1 NAT to translate the internal IP of this server into our external IP space- call it 12.13.14.15. I want to keep security on the server as tight as possible, however, so I don't want to advertise the fact that there is a server at 12.13.14.15 via DNS (minor issue, I know, but humor me) Therefore, to access this machine from outside our network one would need to enter the ip 12.13.14.15. When apache then changes that to the hostname, it of course is no longer accessible, and the user gets an error. If I set the ServerName directive to 12.13.14.15, then I get an error when trying to access the machine from inside the network. If Apache would just leave the entered URL alone, only changing the relative part when a link is clicked (unless, of course, it is an absolute link), then it would work fine. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 2:01 PM, Mark Lavi wrote: Forgive me if I don't understand, but it sounds like you are expecting Apache (which is your network end point) to understand your network routing and deal with it all by itself. I don't believe that reasonable without incorporating your network into the solution. Perhaps you should consider: - Adding IPs to your Apache webserver, adjusting your network routing and/or DNS, then make a virtual host respond to each IP and set serveralias as you wish. - Feed Apache additional information in order to trigger some functionality you need (cookie the users per segment, give them different DNS aliases to your web server, use rewrite rules to leverage cookies, etc). - Setting up local network segment http proxies to your Apache web server to insulate people from your network routing. - Combining the above into some sort of solution. Those are ideas, I probably can't help further. --Mark Mark Lavi, Enterprise Web Management Team @ SGI mailto:[EMAIL PROTECTED] || phone:+1-650-933-7707 -Original Message- From: Israel Brewster [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 10, 2007 12:51 PM To: users@httpd.apache.org Subject: Re: [EMAIL PROTECTED] Unwanted rewrite followup/continuationn Unfortunately, that won't work: the IP is different depending on where the machine is being accessed from. So as long as Apache insists on changing the URL to the server name, I will always have issues- it will just change depending on what I use for the server name. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 10:13 AM, Mark Lavi wrote: Try changing the servername directive to the IP address in httpd.conf, I believe that will work. E.g.: VirtualHost *:80 ServerName 127.0.0.1 # etc /VirtualHost --Mark Mark Lavi, Enterprise Web Management Team @ SGI mailto:[EMAIL PROTECTED] || phone:+1-650-933-7707 -Original Message- From: Israel Brewster [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 10, 2007 9:00 AM To: users@httpd.apache.org Subject: [EMAIL PROTECTED] Unwanted rewrite followup/continuationn Ok, so I have managed to work around the problem below by putting the hostname of the Apache server in the /etc/hosts file on the machines that need to access the server by IP, so when it changes the IP
Re: [EMAIL PROTECTED] Simple perl question
yeah, perl is not available at all from within the Apache chroot jail, unless I am missing something. Making the change to the LoadModule line you suggested allowed the various perl directives in the config file to load without complaint. Attempting to execute the script, however, results in a [error] (8)Exec format error: exec of / cgi-bin/perl/routers2.cgi failed This error is the same if I try with either a .cgi extension on the file or a .pl extension --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 4:31 PM, Serge Dubrouski wrote: So you don't have perl available at all? Then you definetely need mod_perl. Have you tried to change your LoadModule line for mod_perl like I suggested erlier? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: But with it I get a file not found error since it can't access / usr/ bin/perl from within the chroot (/var/www). If that line can't be removed, then apparently I can't run perl scripts under Apache with Apache chrooted, even with mod_perl running properly-is that correct? or do I just need to change that line to something else? On the brighter side, changing the LoadModule line as suggested did allow the config directives to load properly. Didn't help get the script to run though. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 2:35 PM, Serge Dubrouski wrote: Do not remove #!/usr/bin/perl line! Without it OS doesn't know how to run that file. On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I installed mod_perl from the package that was distributed with OpenBSD 4.0. The install didn't give any errors, so I have to assume it installed properly. As far as I can tell, it didn't make any configuration changes. Just placing the script in my CGI directory (and removing the #!/usr/bin/perl line) gives [error] (8)Exec format error: exec of /cgi-bin/perl/routers2.pl failed. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- On Jan 10, 2007, at 1:39 PM, Serge Dubrouski wrote: For this configuration you need to have mod_perl installed on your server. Why don't you simply put your script into your cgi-bin directory? On 1/10/07, Israel Brewster [EMAIL PROTECTED] wrote: I don't know if what I am trying to do here is even possible (sane?) but I thought I'd ask. I am running Apache 1.3.29 on an OpenBSD 4.0 system, with Apache chrooted to /var/www. I have a perl script CGI (it has the .cgi extention, not .pl, but is actually a perl script) that I need to run. Currently, the script is written to run using the system perl interpreter, with the first line of the script being #!/ usr/bin/perl This obviously doesn't work, since when it runs as a CGI it is chrooted to /var/www, and can not see /usr/bin. Now I would think that Apache should be able to run this script using the perl module, which I have installed, but I can't seem to get it to work. Could someone point me to something that tells me how to properly enable/run perl scripts in Apache? I looked at mod_perl website, but all it says is to add a code block like the following: Alias /perl/ /home/httpd/perl/ PerlModule Apache::Registry Location /perl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI allow from all PerlSendHeader On /Location which just gives me an 'Invalid command 'PerlModule' This would imply to me that mod_perl isn't being loaded, in spite of being installed, but that leaves me needing to know how to load the perl module. Adding a line like LoadModule mod_perl /usr/local/lib/ mod_perl.so (which is the correct path to the mod_perl.so file) just gives me a Can't locate API module structure `mod_perl' in file /usr/ local/lib/ mod_perl.so: Unable to resolve symbol What am I missing here? How can I get Apache to run perl scripts? Thanks for any assistance that can be provided --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED
[EMAIL PROTECTED] Unwanted rewrite
I am running into a somewhat annoying problem with Apache 1.3.29 on an OpenBSD 4.0 box. When attempting to access the server via IP address, it loads the first page fine, but after clicking a link to another page it rewrites the IP address in the URL to the hostname of the machine. This promptly results in a server not found error, as the hostname of the machine is not in DNS. How can I get appache to leave the URL alone? The config of this server is mostly still the default, aside from some authorization directives. Due to the network setup, simply setting the ServerName directive to the IP won't work, the problem there being that the IP the machine is accessed at is different depending on if you are accessing it from inside our network or outside. Actually, inside our network our internal DNS is set up so you can access the server by the hostname, but outside you need to use the IP (we don't want to make this server easy to find). Thank you for any assistance you can provide. --- Israel Brewster Computer Support Technician Frontier Flying Service INC. 5245 Airport Industrial Rd Fairbanks, AK 99709 --- - 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: [EMAIL PROTECTED] from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]