From: Xeno Campanoli Date: 2007-06-19T11:35:15+09:00 Subject: Re: hard time setting up ruby with apache Gale CC wrote: >> seen so much variation as with Apache. Sometimes its httpd.conf, >> sometimes apache2.conf, on my laptop using Ubuntu Feisty it has >> /etc/apache2/sites-enabled/000-default which points to >> /etc/apache2/sites-available/default. > > I'm pretty sure I'm playing with the right file, because I have noticed > difference in behaviours upon making changes. But want I dont understand > is that Apache's FAQ specifically says that anything under ScriptAlias > doesnt need any further configuration, it will "execute" if called. Okay, please quote the exact line in the FAQ in your next post. That kind of thing can be mis-paraphrased easily when one is new to these things. But > I'm still getting the "You don't have permission to access > /forms/cgi-bin/survey.cgi 1. Did you make sure your directory tree has read and execution privileges at every level above? Here is mine: ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ root@joehill:~# ls -ald /usr drwxr-xr-x 13 root root 4096 2007-06-06 21:35 /usr root@joehill:~# ls -ald /usr/lib drwxr-xr-x 57 root root 12288 2007-06-18 14:54 /usr/lib root@joehill:~# ls -ald /usr/lib/cgi-bin/ drwxr-xr-x 2 root root 4096 2007-06-14 17:08 /usr/lib/cgi-bin/ ---snip--- Please see that for each of the nodes, and the file itself: -rwxr-xr-x 1 root root 169 2007-06-09 14:42 blek.sh ---snip--- all three categories have read and execute privileges (the most important being the last, which is world "r-x". This is critical, because Apache relays these protections by behaving according to their implications, so a public user coming in through http gets the privileges of "other" the third category, which is "tous le monde", so to speak. 2. The actual ScriptAlias, in my /etc/apache2/sites-available/default is in fact part of a large stanza, as follows: NameVirtualHost * ServerAdmin webmaster@localhost DocumentRoot /var/www/ Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all # This directive allows us to have apache2's default start page # in /apache2-default/, but still have / go to the right place #RedirectMatch ^/$ /apache2-default/ ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On Alias /doc/ "/usr/share/doc/" Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 Actually, I have dumped the whole file here for your perusal. The thing is, capabilities in Apache XMLy configurations are rather complex, and allow lots of stuff. But you may not necessarily be able to do it in a way you find intuitive. That is why I suggested you may need to quote us the FAQ, as it my imply something different from what you think. I'd recommend you start with a configuration that is alleged to work for your revision of Apache, and modify it carefully step by step, not changing more than one aspect at a time. Do not even change the script at the same time as the configuration. Just one at a time. I'd recommend something like the following as a simple starting script : #!/bin/bash echo "Content-type: text/html" echo echo "" echo "

Blek!

" date echo "" ---snip--- Then in the browser, make sure it comes out orange, and make sure especially that it says "Blek!". That's your simple starting point, then work up from there. And believe me: taking simple steps is a normal procedure for all people doing this. This is nothing to feel bad about. Very best wishes. xc on this > server" error. > Somebody please help me. I've spent just too much time trying to make it > work. > > Thanks, > Gale > -- The only sustainable organizing methods focus not on scale, but on good design of the functional unit, not on winning battles, but on preservation.