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/.
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.
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.
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
...although, Options +ExecCGI
is likely to not be allowed. However, if the server has set it elsewhere it might work without it.
My ISP's webspace is the same, makes it a nightmare to get anything working on it :(
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.
Try removing the Options line. If that doesn't work, nag your host.
Admin said nope for loosening restrictions on even one dir, security risk. Any hope for running Wakaba?
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".
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);
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.
Do Perl scripts work AT ALL? Does http://wakaba.c3.cx/sup/kareha.pl/1102836129/6 work?
They work if run from the shell, but not from the web.
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?
... 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.