?

Log in

No account? Create an account
Hello, tentacle support? - Many a mickle maks a muckle

> Recent Entries
> Archive
> Friends
> Profile

August 3rd, 2005


Previous Entry Share Next Entry
04:27 pm - Hello, tentacle support?
Subject line from here, via waistcoatmark. Silly, work-safe.

I am trying to establish a web site and put a perl script to run a Wiki on it. I have uploaded the software correctly, unzipped it, extracted the tar archive and put the wiki.pl script into ~/htdocs/cgi-bin/ . I have made sure that both the wiki.pl script and the cgi-bin directory have 755 permissions. When I visit http://www.appropriatesitename.com/cgi-bin/wiki.pl then it does not execute the script, it merely displays the code of the script in the browser. However, when I open a shell, cd to the appropriate directory and execute perl wiki.pl from the command line, it produces a perfectly-formed HTML page that I would expect to see. I do not believe there is anything further I need to do in order to enable running scripts on the web site.

Any advice, please? aTdHvAaNnKcSe to anyone who can help.

ETA: We now think it's a problem at their end. Their engineers are looking at it and hope to have sorted it out in 24 hours. If not, I shall phone again. Thank you for the suggestions anyhow, but I doubt there's much anybody can do about it from this end in that case...
Current Mood: disappointeddisappointed

(28 comments | Leave a comment)

Comments:


[User Picture]
From:pseudomonas
Date:August 3rd, 2005 03:39 pm (UTC)
(Link)
You probably need to set the first line of the scripts to
#!/path/to/perl/executable

try going to the directory and running ./wiki.pl - any luck?
[User Picture]
From:pseudomonas
Date:August 3rd, 2005 03:41 pm (UTC)
(Link)
and/or editing the httpd.conf file to tell it that the cgi-bin directory is to be treated as an script-aliased (or something) directory, if it doesn't think it is at the moment.
[User Picture]
From:pseudomonas
Date:August 3rd, 2005 03:42 pm (UTC)
(Link)
If you're running apache, the cgi-bin directory is usually in ~/cgi-bin not ~/htdocs/cgi-bin
[User Picture]
From:chrisvenus
Date:August 3rd, 2005 03:43 pm (UTC)
(Link)
I assume ~ is his home directory and ~/htdocs/ is the web root. I may be wrong though.
[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 03:46 pm (UTC)
(Link)
You assume correctly!
[User Picture]
From:chrisvenus
Date:August 3rd, 2005 03:43 pm (UTC)
(Link)
Yup. Or sometimes make sure the right extenstions are being treated as scripts. But yeah, all the things you just said I was going to. Though I always forget what that first line looks like so I wasn't actually going to quote it. :)
[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 03:45 pm (UTC)
(Link)
It is. :-)

Yes.
[User Picture]
From:pseudomonas
Date:August 3rd, 2005 03:51 pm (UTC)
(Link)
In which case it's probably that the webserver doesn't know that this is a script directory.

Does the httpd.conf have something that looks like
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/xxx/cgi-bin/"

[Error: Irreparable invalid markup ('<ifmodule mod_cgid.c>') in entry. Owner must fix manually. Raw contents below.]

In which case it's probably that the webserver doesn't know that this is a script directory.

Does the httpd.conf have something that looks like
<pre>#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/xxx/cgi-bin/"

<IfModule mod_cgid.c>
#
# Additional to mod_cgid.c settings, mod_cgid has Scriptsock <path>
# for setting UNIX socket for communicating with cgid.
#
#Scriptsock logs/cgisock
</IfModule>

#
# "/xxx/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/xxx/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
</pre>

If so, move your files to /xxx/cgi-bin or change the conf file to reflect the location of the files (I'd say preferably not under htdocs, but that's just me)
[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 03:55 pm (UTC)
(Link)
Hmm. Now you're reaching the point where I am highly confused. :-)

There isn't a httpd.conf file anywhere within ~ or subdirectories. Where should I set one up, please?
[User Picture]
From:pseudomonas
Date:August 3rd, 2005 04:02 pm (UTC)
(Link)
It's the configuration file for the webserver (again, assuming you're using apache). If the server's running, you already have one of these. I don't know where it will have been installed on your system (on mine it's in ~/apache/conf) but you could try a file search.
[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 04:07 pm (UTC)
(Link)
I assume the web server is running too, because a raw HTML file in the htdocs directory works.

find / -name apache (which I got from here, though this isn't the Wiki I'm running!) returns a lot of Permission denieds and nothing else.
[User Picture]
From:pseudomonas
Date:August 3rd, 2005 04:10 pm (UTC)
(Link)
I think you might have to talk to whoever maintains the server, then, and ask them where to put your scripts.
[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 04:17 pm (UTC)
(Link)
Thanks very much for your help, anyway.:-) Am talking to the tech support line, managed to get someone Linux-competent by good fortune, he has tried all the obvious things and hasn't spotted anything very silly that I've done, and he has escalated it to second level support.
[User Picture]
From:pseudomonas
Date:August 3rd, 2005 04:19 pm (UTC)
(Link)
Ah, if it's a commercial outfit they might have things set up in all kinds of odd ways :) Good luck with it!
[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 04:25 pm (UTC)
(Link)
Looks like a problem at their end and their engineers are on their server config. Doesn't look like much we can do about it from here.
[User Picture]
From:anatsuno
Date:August 3rd, 2005 04:03 pm (UTC)
(Link)
(stupid question but hu, why run a wiki in perl when you can do it in php? *a little biased and w/ prolly no good reason, omg*)
[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 04:04 pm (UTC)
(Link)
I don't know php. Heck, I don't know perl, for that matter. My knowledge of all things *NIXy is very very basic indeed. :-D
[User Picture]
From:anatsuno
Date:August 3rd, 2005 04:12 pm (UTC)
(Link)
Right. And my own bias is probably because I do know a little of PHP, vs not knowing the first bit of Perl. :)

hope you sort it out! (my only one idea was something very vague that has probably no conenction, like, are you sure you FTP'd the files in acsii mode when you did and not binary (or the opposite, I never know which it should be) )
[User Picture]
From:pseudomonas
Date:August 3rd, 2005 04:14 pm (UTC)
(Link)
perl doesn't have problems with deciphering linebreaks properly, as far as I know :)
[User Picture]
From:ewx
Date:August 3rd, 2005 04:07 pm (UTC)
(Link)
Put another way, why do anything in PHP when you could conceivably avoid it?
[User Picture]
From:anatsuno
Date:August 3rd, 2005 04:12 pm (UTC)
(Link)
:))

bias, yesyes, is all bias.
[User Picture]
From:ewx
Date:August 3rd, 2005 04:34 pm (UTC)
(Link)
register_globals.
[User Picture]
From:chrisvenus
Date:August 3rd, 2005 04:16 pm (UTC)
(Link)
aTdHvAaNnKcSe

I feel like I'm watching Catchphrase...
[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 04:19 pm (UTC)
(Link)
Just say what you see!

(Can't remember who, but someone suggested buzzing in and saying "An incompetent host in a bad jacket" at this point. Only rather more rudely.)
[User Picture]
From:pseudomonas
Date:August 3rd, 2005 04:20 pm (UTC)
(Link)
It was the It's good, it's not right that made me want to throw things.
[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 04:28 pm (UTC)
(Link)
It's fast and furious in the Ready Money round!

BEEEEEEYOIOIOIOIOIOIOINGGGGGG!!!!

etc. ctd., Challenge
[User Picture]
From:bateleur
Date:August 3rd, 2005 04:28 pm (UTC)
(Link)
Further to wise comments from pseudomonas above about web server configuration: Try renaming your script to be called wiki.cgi, having first ensured that the first line of the script is "#!/usr/bin/perl" (may vary on some systems). This is a (benign) hack, but works for some configurations.

[User Picture]
From:jiggery_pokery
Date:August 3rd, 2005 04:35 pm (UTC)
(Link)
Tried that before I posted. :-) (Just tried it again. No joy.)

The issue is with the permissions. Apparently they want the permissions on the file to be set to 700, but if you do that, then you're not going to be able to view the file from the outside world. :-/ (Or perhaps you are, if they have some hack at their end. Idunno.) Setting them to 755 just gives you the "read rather than execute" problem still.

Hey ho!

> Go to Top
LiveJournal.com