Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache install cgi's now download instead of execute(solved)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
iplayfast
l33t
l33t


Joined: 08 Jul 2002
Posts: 642
Location: Cambridge On,CA

PostPosted: Tue Apr 02, 2013 7:55 pm    Post subject: apache install cgi's now download instead of execute(solved) Reply with quote

/etc/conf.d/apache2 has
Code:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC -D LANGUAGE -D USERDIR"


My 00_default_vhost.conf has
Code:

<IfDefine DEFAULT_VHOST>

Listen 80
<VirtualHost *:80>
        ServerName localhost
        Include /etc/apache2/vhosts.d/default_vhost.include

        <IfModule mpm_peruser_module>
                ServerEnvironment apache apache
        </IfModule>
</VirtualHost>
</IfDefine>


My default_vhost.include has
Code:

ServerAdmin root@localhost

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
# If you change this to something that isn't under /var/www then suexec
# will no longer work.
DocumentRoot "/var/www/localhost/htdocs"

# This should be changed to whatever you set DocumentRoot to.
<Directory "/var/www/localhost/htdocs">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

<IfModule alias_module>
        ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/"
</IfModule>

<Directory "/var/www/localhost/cgi-bin">
        AllowOverride None
        Options None
        Require all granted
</Directory>


The site is:
/var/www/localhost/htdocs/chris->home/chris/public_html
and the page there accesses a cgi binary executable located in the cgi-bin directory at
/var/www/localhost/htdocs/chris->home/chris/public_html/cgi-bin

The cgi downloads instead of executing. It used to work but I've done many upgrades since the last time I tried it, and something isn't configured right.

I'm sure it's something simple but I'm not seeing it. Please help.


Last edited by iplayfast on Wed Apr 03, 2013 7:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
honp
Guru
Guru


Joined: 25 Sep 2006
Posts: 355
Location: Good old Prague, Czech rep.

PostPosted: Wed Apr 03, 2013 9:00 am    Post subject: Reply with quote

You must add "-D CGI" to /etc/conf.d/apache to APACHE2_OPTS.


H.
Back to top
View user's profile Send private message
iplayfast
l33t
l33t


Joined: 08 Jul 2002
Posts: 642
Location: Cambridge On,CA

PostPosted: Wed Apr 03, 2013 7:30 pm    Post subject: Reply with quote

That seemed to make no difference at all.
Doing a grep on CGI I found that the module 00_mod_mime.conf had a line
Code:


# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#AddHandler cgi-script .cgi



So I uncommented that, and it now gives a 403 forbidden error.
Permissions look right.

the error_log shows that Options ExecCGI is off in this directory: /var/www/localhost/htdocs/chris/cgi-bin/file.cgi

How do I turn them on?

*** edit ***
Not stuck anymore,
Added ExecCGI to the options in the default_vhost.include file.


Thanks for the help!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum