You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Johnson <ti...@akwebsoft.com> on 2012/11/14 05:16:04 UTC

[users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

I have an instance of apache listening on port 8080.
the following URL :
http://localhost:8080/cgi-bin/cgitest.py
returns a Not Found Error.

I presume that I need a different virtualhost and scriptalias setup,
but am not sure how to accomplish this.

URLs to documentation on this subject may suffice and are welcome.
thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Tim Johnson <ti...@akwebsoft.com>.
* Igor Cicimov <ic...@gmail.com> [121114 13:29]:
> On Thu, Nov 15, 2012 at 5:40 AM, Tim Johnson <ti...@akwebsoft.com> wrote:
> 
> > * Pete Houston <ph...@openstrike.co.uk> [121114 09:38]:
> > > If you look in the error log it should tell you precisely which path it
> > > is that has not been found, ie. after all the aliasing and so forth this
> > > will tell you precisely where on the filesystem it is looking for the
> > > content that is not found.
> >   Even with the error log directive, the 8080 instance is not
> >   writing to the log.
> >   thanks
> >
> > Meaning apache user probably doesn't have write permissions to the error
> log directory you pointed to.
  The owner is root and the group is wheel. Permissions were 644,
  reset to 666 - no changes

  to Recap :

  with chmod 644, ownership root:wheel the apache logs are written
  to by the port 80 (default) instance

  with chmod 666 OR 644, ownership root:wheel the apache logs are _not_ written
  by the port 8080 instance
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Igor Cicimov <ic...@gmail.com>.
On Thu, Nov 15, 2012 at 5:40 AM, Tim Johnson <ti...@akwebsoft.com> wrote:

> * Pete Houston <ph...@openstrike.co.uk> [121114 09:38]:
> > If you look in the error log it should tell you precisely which path it
> > is that has not been found, ie. after all the aliasing and so forth this
> > will tell you precisely where on the filesystem it is looking for the
> > content that is not found.
>   Even with the error log directive, the 8080 instance is not
>   writing to the log.
>   thanks
>
> Meaning apache user probably doesn't have write permissions to the error
log directory you pointed to.


> --
> Tim
> tim at tee jay forty nine dot com or akwebsoft dot com
> http://www.akwebsoft.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Tim Johnson <ti...@akwebsoft.com>.
* Pete Houston <ph...@openstrike.co.uk> [121114 09:38]:
> If you look in the error log it should tell you precisely which path it
> is that has not been found, ie. after all the aliasing and so forth this
> will tell you precisely where on the filesystem it is looking for the
> content that is not found.
  Even with the error log directive, the 8080 instance is not
  writing to the log.
  thanks

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Pete Houston <ph...@openstrike.co.uk>.
If you look in the error log it should tell you precisely which path it
is that has not been found, ie. after all the aliasing and so forth this
will tell you precisely where on the filesystem it is looking for the
content that is not found.

HTH,

Pete
-- 
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036 / 07092 020107

Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Igor Cicimov <ic...@gmail.com>.
AddHandler cgi-script .cgi .pl .py

in your case for python scripts


On Thu, Nov 15, 2012 at 9:16 AM, Igor Cicimov <ic...@gmail.com> wrote:

>
>
>
> On Thu, Nov 15, 2012 at 5:14 AM, Tim Johnson <ti...@akwebsoft.com> wrote:
>
>> I have made some tweaks to httpd.conf without
>>   success
>>   Here's what I have :
>>      # for port 8080
>>     <VirtualHost *:8080>
>>         DocumentRoot "/Users/http"
>>         ScriptAlias /cgi-bin/ "/Users/http/run/"
>>         ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$)
>> "/Users/http/run/$1"
>>         <Directory "/Users/http/run">
>>             AllowOverride None
>>             Options None
>>
>
> This is wrong, it should be
>
> Options +ExecCGI
> AddHandler cgi-script .cgi .pl
>
> you need to tell apache that the files in that directory are cgi scripts.
> Please read
>
> http://httpd.apache.org/docs/2.2/howto/cgi.html
>
> its all in there.
>
>
>
>
>>             Order allow,deny
>>             Allow from all
>>         </Directory>
>>     </VirtualHost>
>>     # end port 8080
>> These are the same settings as for the default (port 80) settings.
>> However, something is still lacking.
>> If I point my browser to
>> http://localhost/cgi-bin/cgitest.py
>> I get the output I expect.
>> If I point my browser to
>> http://localhost:8080/cgi-bin/cgitest.py
>> I still get a Not Found error.
>>
>> /usr/sbin/apachectl configtest
>> gives me "Syntax OK"
>> thanks
>> --
>> Tim
>> tim at tee jay forty nine dot com or akwebsoft dot com
>> http://www.akwebsoft.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>

Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Tim Johnson <ti...@akwebsoft.com>.
* Igor Cicimov <ic...@gmail.com> [121114 13:29]:
> On Thu, Nov 15, 2012 at 5:14 AM, Tim Johnson <ti...@akwebsoft.com> wrote:
> 
> > I have made some tweaks to httpd.conf without
> >   success
> >   Here's what I have :
> >      # for port 8080
> >     <VirtualHost *:8080>
> >         DocumentRoot "/Users/http"
> >         ScriptAlias /cgi-bin/ "/Users/http/run/"
> >         ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$)
> > "/Users/http/run/$1"
> >         <Directory "/Users/http/run">
> >             AllowOverride None
> >             Options None
> >
> 
> This is wrong, it should be
> 
> Options +ExecCGI
> AddHandler cgi-script .cgi .pl
> 
> you need to tell apache that the files in that directory are cgi scripts.
> Please read
> 
> http://httpd.apache.org/docs/2.2/howto/cgi.html
> 
> its all in there.
  This is mac OS X 10.7. I have done previous setups for apache all
  on linux. And yes, 
> Options +ExecCGI
> AddHandler cgi-script .cgi .pl
  is needed on linux. However, for some reason they _are not_ needed in this
  Mac install.
>From httpd.conf
    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    #AddHandler cgi-script .cgi
    #AddHandler cgi-script .py
Note the following: 
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
I understand from the above that is only needed in this installation
for directory outside of ScriptAliased directories.

Nevertheless, I did add those lines to the directory container, but
with no success.

I appreciate the help. I suspect that perhaps (and I am a permanent
apache noob because I do configs so seldom) - that there is a module
whose loading was disabled that may have an effect.

What I will do, is send my entire httpd.conf OTL to a known and trusted
individual who is a sysadmin, and then pose the problem to a mailing
list of sysadmins that both myself and he belong to. Any further
help that you offer would be appreciated, but perhaps with the full
httpd.conf for this individuals review and the other sysadmins eyes
- who do virtual host setups all the time - I might be able to
  report the solution by tomorrow.

Thanks again for your help.
regards
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Igor Cicimov <ic...@gmail.com>.
On Thu, Nov 15, 2012 at 5:14 AM, Tim Johnson <ti...@akwebsoft.com> wrote:

> I have made some tweaks to httpd.conf without
>   success
>   Here's what I have :
>      # for port 8080
>     <VirtualHost *:8080>
>         DocumentRoot "/Users/http"
>         ScriptAlias /cgi-bin/ "/Users/http/run/"
>         ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$)
> "/Users/http/run/$1"
>         <Directory "/Users/http/run">
>             AllowOverride None
>             Options None
>

This is wrong, it should be

Options +ExecCGI
AddHandler cgi-script .cgi .pl

you need to tell apache that the files in that directory are cgi scripts.
Please read

http://httpd.apache.org/docs/2.2/howto/cgi.html

its all in there.




>             Order allow,deny
>             Allow from all
>         </Directory>
>     </VirtualHost>
>     # end port 8080
> These are the same settings as for the default (port 80) settings.
> However, something is still lacking.
> If I point my browser to
> http://localhost/cgi-bin/cgitest.py
> I get the output I expect.
> If I point my browser to
> http://localhost:8080/cgi-bin/cgitest.py
> I still get a Not Found error.
>
> /usr/sbin/apachectl configtest
> gives me "Syntax OK"
> thanks
> --
> Tim
> tim at tee jay forty nine dot com or akwebsoft dot com
> http://www.akwebsoft.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Tim Johnson <ti...@akwebsoft.com>.
* lists-apache <re...@listmail.innovate.net> [121114 09:26]:
> 
> 
> Look in your server's error log for the 8080 instance to see where
> it's directing the request.
> 
> 
>    - Richard
  Oh! Good tip...
  Added the following:
  ErrorLog "/private/var/log/apache2/error_log"
  to httpd.conf
  and restart apache at 8080.
  Tried the cgi-bin URL again, got Not Found Error,
  *but*

  apache is not writing to that error log from 8080, so

  I presume that a further directive is needed.
  thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Tim Johnson <ti...@akwebsoft.com>.
I have made some tweaks to httpd.conf without
  success
  Here's what I have :
     # for port 8080
    <VirtualHost *:8080>
        DocumentRoot "/Users/http"
        ScriptAlias /cgi-bin/ "/Users/http/run/"
        ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Users/http/run/$1"
        <Directory "/Users/http/run">
            AllowOverride None
            Options None
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
    # end port 8080
These are the same settings as for the default (port 80) settings.
However, something is still lacking.
If I point my browser to
http://localhost/cgi-bin/cgitest.py
I get the output I expect.
If I point my browser to
http://localhost:8080/cgi-bin/cgitest.py
I still get a Not Found error.

/usr/sbin/apachectl configtest
gives me "Syntax OK"
thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Tim Johnson <ti...@akwebsoft.com>.
* Igor Cicimov <ic...@gmail.com> [121113 20:03]:
> You have probably put the python script in wrong directory. According to
> this:
  right directory for port 80 - since I have scriptaliased for that
  port setting.
> http://www.editrocket.com/articles/perl_apache_mac.html
> 
> the default cgi one on OSX is */Library/WebServer/CGI-Executables
  http://localhost:8080/CGI-Executables is also "Not Found" 

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Igor Cicimov <ic...@gmail.com>.
You have probably put the python script in wrong directory. According to
this:

http://www.editrocket.com/articles/perl_apache_mac.html

the default cgi one on OSX is */Library/WebServer/CGI-Executables

*


On Wed, Nov 14, 2012 at 3:19 PM, Tim Johnson <ti...@akwebsoft.com> wrote:

> * Tim Johnson <ti...@akwebsoft.com> [121113 19:16]:
> > I have an instance of apache listening on port 8080.
> > the following URL :
> > http://localhost:8080/cgi-bin/cgitest.py
> > returns a Not Found Error.
> >
> > I presume that I need a different virtualhost and scriptalias setup,
> > but am not sure how to accomplish this.
> >
> > URLs to documentation on this subject may suffice and are welcome.
> > thanks
>  Left out :
>  Apache running on Mac OSX 10.7
>
> --
> Tim
> tim at tee jay forty nine dot com or akwebsoft dot com
> http://www.akwebsoft.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Tim Johnson <ti...@akwebsoft.com>.
* Tim Johnson <ti...@akwebsoft.com> [121113 19:16]:
> I have an instance of apache listening on port 8080.
> the following URL :
> http://localhost:8080/cgi-bin/cgitest.py
> returns a Not Found Error.
> 
> I presume that I need a different virtualhost and scriptalias setup,
> but am not sure how to accomplish this.
> 
> URLs to documentation on this subject may suffice and are welcome.
> thanks
 Left out :
 Apache running on Mac OSX 10.7

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] [solved] [users@httpd] ScriptAlias/cgi-bin for apache instance on port 8080

Posted by Tim Johnson <ti...@akwebsoft.com>.
* Tim Johnson <ti...@akwebsoft.com> [121113 19:16]:
> I have an instance of apache listening on port 8080.
> the following URL :
> http://localhost:8080/cgi-bin/cgitest.py
> returns a Not Found Error.
  All was revealed when I ran find against httpd.conf 
  FYI : This is an instance of apache started and controlled by
  drupal.
  And I am new to drupal..
  an httpd.conf was found in drupal's own apache setup/directory.
  I simply moved the test script to the scriptalias specified there
  and it works.
  Thanks to everybody for their help!
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org