Perl restrictions hindering installation (19)

1 Name: Anonymous 2005-01-17 19:39 ID:tm/ZpBUT (Replies) [Del]

The admin tells me perl scripts can only be accessed from /~/public_html/cgi-bin/, which won't execute anything but perl.

The problem, if I haven't made it clear, is figuring out how to run Wakaba outside of /cgi-bin/.

2 Name: !WAHa.06x36 2005-01-17 20:34 ID:ZBaW6hfu (Replies) [Del]

Well, you can try putting the whole installation inside cgi-bin, but many installations won't show HTML files inside cgi-bin. As it is now, Wakaba doesn't let you keep the perl and html files in separate directories.

I'd suggest asking the admin to remove that restriction. It's really not necessary, and just makes for trouble like this.

3 Name: Anonymous 2005-01-17 20:43 ID:tm/ZpBUT (Replies) [Del]

The dir won't execute anything but perl, including the HTML for the boards, so. Guess I'll ask him next I see him then.

No way to embed the scripts in another page or mess with .htaccess to allow running scripts? Dunno how to go about either, or if it's possible.

4 Name: !WAHa.06x36 2005-01-17 21:14 ID:ZBaW6hfu (Replies) [Del]

If the server is set up to not allow scripts to run anywhere but cgi-bin, .htaccess can't override it. But you can always try adding:

Options +ExecCGI
AddHandler cgi-script .pl

5 Name: !WAHa.06x36 2005-01-17 21:15 ID:ZBaW6hfu (Replies) [Del]

...although, Options +ExecCGI is likely to not be allowed. However, if the server has set it elsewhere it might work without it.

6 Name: cyrilthefish!ljAhqzG3aU 2005-01-18 09:48 ID:5C2OXbde (Replies) [Del]

My ISP's webspace is the same, makes it a nightmare to get anything working on it :(

7 Name: Anonymous 2005-01-18 10:47 ID:H656cPVy (Replies) [Del]

Nope, the .htaccess junk doesn't work. 'Either the server is overloaded or there was an error in a CGI script.' Guess it's not allowed.

8 Name: !WAHa.06x36 2005-01-18 11:31 ID:U8JR7KQg (Replies) [Del]

Try removing the Options line. If that doesn't work, nag your host.

9 Name: Anonymous 2005-01-19 14:32 ID:T0AAFEvM (Replies) [Del]

Admin said nope for loosening restrictions on even one dir, security risk. Any hope for running Wakaba?

10 Name: !WAHa.06x36 2005-01-19 15:11 ID:31LyLntx (Replies) [Del]

I've considered hacking it to be able to keep its files elsewhere than the main program, but I haven't yet. If you know any Perl, you may be able to do it yourself. And I'd say the admin is full of shit about it being a "security risk".

11 Name: !WAHa.06x36 2005-01-19 15:19 ID:31LyLntx (Replies) [Del]

Here's a guess what might work: Put all the .pl files in /cgi-bin/, and make a separate directory for the rest. Then edit wakaba.pl, and after the BEGIN statements at the top of wakaba.pl, put in something like:

chdir "../imgboard";

That is, the relative path to the board that holds the files on the server.

Then, change this line in expand_filename():

my ($self_path)=$ENV{SCRIPT_NAME}=~m!^(.*/)[^/]+$!;

to something like:

my $self_path="/imgboard/";

Or whatever the path to the directory is, as seen from the web.

Finally, change all the lines like this:

make_http_forward(HTML_SELF,ALTERNATE_REDIRECT);

Into this:

make_http_forward(expand_filename(HTML_SELF),ALTERNATE_REDIRECT);

12 Name: Anonymous 2005-01-19 18:14 ID:T0AAFEvM (Replies) [Del]

Blah... isn't working. Accessing it from the web gives 'Premature end of script headers: wakaba.pl'. Running it manually doesn't seem to do anything.

13 Name: !WAHa.06x36 2005-01-19 19:07 ID:31LyLntx (Replies) [Del]

Do Perl scripts work AT ALL? Does http://wakaba.c3.cx/sup/kareha.pl/1102836129/6 work?

14 Name: Anonymous 2005-01-19 19:57 ID:T0AAFEvM (Replies) [Del]

They work if run from the shell, but not from the web.

15 Name: dmpk2k!hinhT6kz2E 2005-01-19 21:03 ID:u4d/VD+h (Replies) [Del]

Could you post somewhere your .htaccess, httpd.conf (unlikely), error.log and a detailed recursive listing of your web dir?

I'd curious about the restriction to cgi-bin. What exactly is supposed to be achieved by that?

16 Name: !WAHa.06x36 2005-01-20 06:53 ID:31LyLntx (Replies) [Del]

>>14

Gaaah. I keep hearing about these idiotic webservers that pretend to run CGI scripts but don't actually. Go yell at your admin to get their fucking shit together.

>>15

It's some sort of retarded historical thing. I never understood it either. I blame obsessive-compulsive control-freak sysadmins.

17 Name: Anonymous 2005-01-20 09:42 ID:ymbr+3rR (Replies) [Del]

... I have no idea how, but I finally got it working. Messing with .htaccess seems to throw up server errors no matter what, I guess that was part of the problem. Hohoho, I'm an idiot. Thanks for dealing with me.

18 Name: !WAHa.06x36 2005-01-20 10:04 ID:tkHGr3Ng (Replies) [Del]

Did you use the modifications I suggested? That is, should I put in support for that in the real version?

19 Name: Anonymous 2005-01-20 11:46 ID:ymbr+3rR (Replies) [Del]

I just tried installing it from the beginning and it worked. None of those modifications were needed. I'm a dumbass, it seems.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: