View previous topic :: View next topic |
Author |
Message |
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Sun Jul 20, 2014 12:21 pm Post subject: Problems getting apache running |
|
|
I installed apache the other day, without a problem, however CGI wasn't enabled.
I tried a couple different things but one of the posts on gentoo.org stated that a line needed to be added to my make.conf followed by re-emerging
Code: |
APACHE2_MODULES="cgi"
|
Now it won't start. I get this error.
Code: |
dan@mojo ~ $ sudo /etc/init.d/apache2 start
Password:
apache2 | * apache2 has detected an error in your setup:
apache2 |apache2: Syntax error on line 61 of /etc/apache2/httpd.conf: Cannot load /usr/lib64/apache2/modules/mod_actions.so into server: /usr/lib64/apache2/modules/mod_actions.so: cannot open shared object file: No such file or directory
apache2 | * ERROR: apache2 failed to start
|
it doesn't appear that the apache package installed this shared library. Do I need some other flag?
Code: |
dan@mojo ~ $ equery f apache| grep .so
/usr/lib64/apache2/build/instdso.sh
/usr/lib64/apache2/modules/mod_authnz_ldap.so
/usr/lib64/apache2/modules/mod_cgi.so
/usr/lib64/apache2/modules/mod_ldap.so
/usr/lib64/apache2/modules/mod_ssl.so
/usr/share/apache2/icons/small/sound.gif
/usr/share/apache2/icons/small/sound.png
/usr/share/apache2/icons/small/sound2.gif
/usr/share/apache2/icons/small/sound2.png
/usr/share/apache2/icons/sound1.gif
/usr/share/apache2/icons/sound1.png
/usr/share/apache2/icons/sound2.gif
/usr/share/apache2/icons/sound2.png
|
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Sun Jul 20, 2014 4:19 pm Post subject: |
|
|
Based solely on the name, you need APACHE2_MODULES=actions. For me, this and many other modules, including cgi, defaulted to on. Please remove your APACHE2_MODULES definition and then post the output of emerge --pretend --verbose www-servers/apache. Also, please cite exactly what page told you to set APACHE2_MODULES. |
|
Back to top |
|
|
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Sun Jul 20, 2014 10:28 pm Post subject: |
|
|
According to that output, following the advice from huuan was a mistake. That output says you already had the cgi module enabled even without setting APACHE2_MODULES. Also, I think you misunderstood the advice from huuan. That post, which was a serious case of thread necromancy, was stating that if you had the cgi module enabled via APACHE2_MODULES, then only the configuration file change was required. According to your output, you had the cgi module enabled via APACHE2_MODULES even before your change. Rebuild Apache with APACHE2_MODULES not assigned via make.conf. |
|
Back to top |
|
|
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Sun Jul 20, 2014 11:43 pm Post subject: |
|
|
I will try but I did that once before. The web server worked, but I wasn't able to get cgi working. |
|
Back to top |
|
|
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Mon Jul 21, 2014 10:01 pm Post subject: |
|
|
So I'm back to where I started. Apache seems to work fine but no matter what I do I can't seem to enable CGI.
currently I'm looking at this tutorial
http://www.techrepublic.com/blog/diy-it-guy/diy-enable-cgi-on-your-apache-server/
I'm getting forbidden errors, but I don't think it should be an access issue. the test binary along with everything upstream has 755 permissions |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21635
|
Posted: Tue Jul 22, 2014 1:12 am Post subject: |
|
|
What does the Apache error log report? |
|
Back to top |
|
|
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Tue Jul 22, 2014 11:35 pm Post subject: |
|
|
access_log:
Code: |
::1 - - [22/Jul/2014:19:27:03 -0400] "GET /cgi-bin/test.pl HTTP/1.1" 403 276
|
error_log:
Code: |
[Tue Jul 22 19:27:03 2014] [error] [client ::1] client denied by server configuration: /var/www/localhost/cgi-bin
|
/etc/conf.d/apache2: (the uncommented parts)
Code: |
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE"
|
/etc/apache2/httpd.conf:
http://bpaste.net/show/489432/ |
|
Back to top |
|
|
freke l33t
Joined: 23 Jan 2003 Posts: 977 Location: Somewhere in Denmark
|
Posted: Wed Jul 23, 2014 4:22 am Post subject: |
|
|
mreff555 wrote: | access_log:
error_log:
Code: |
[Tue Jul 22 19:27:03 2014] [error] [client ::1] client denied by server configuration: /var/www/localhost/cgi-bin
|
Is this where your test.pl is? (/var/www/localhost/cgi-bin/test.pl)
/etc/apache2/httpd.conf:
http://bpaste.net/show/489432/ |
In your httpd.conf it seems like you expect to have the scripts in /usr/lib/cgi-bin
Does it work if you change to:
Code: | ScriptAlias /cgi-bin/ /var/www/localhost/cgi-bin/ !!<- this might already be defined elsewhere?!!
<Directory "/var/www/localhost/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
|
You might have a conf-file in /etc/apache2/modules.d/ which is messing with mod_cgi-settings, too? |
|
Back to top |
|
|
mreff555 Apprentice
Joined: 10 Mar 2011 Posts: 231 Location: Philadelphia
|
Posted: Thu Jul 24, 2014 12:23 am Post subject: |
|
|
This is my virtual host entry. Intention is to have the index.html file at the default location "/var/www/localhost/htdocs/index.html
and have associated cgi scripts in /usr/lib/cgi-bin. From what I am told this is the best place to put these folders. Regardless, I think it's set up to
accomodate this. right?
Code: |
<VirtualHost _default_:80>
DocumentRoot /var/www/localhost
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</VirtualHost> |
|
|
Back to top |
|
|
freke l33t
Joined: 23 Jan 2003 Posts: 977 Location: Somewhere in Denmark
|
Posted: Thu Jul 24, 2014 11:14 am Post subject: |
|
|
mreff555 wrote: | This is my virtual host entry. Intention is to have the index.html file at the default location "/var/www/localhost/htdocs/index.html
and have associated cgi scripts in /usr/lib/cgi-bin. From what I am told this is the best place to put these folders. Regardless, I think it's set up to
accomodate this. right?
Code: |
<VirtualHost _default_:80>
DocumentRoot /var/www/localhost
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
</VirtualHost> |
|
I'm not sure you're using that virtual host - I'd remove that from httpd.conf and edit the files found in /etc/apache2/vhosts.d.
ie.
/etc/apache2/vhosts.d/default_vhost.include and/or /etc/apache2/vhosts.d/00_default_vhost.conf
the conf-file is included from httpd.conf
Code: | Include /etc/apache2/vhosts.d/*.conf |
and the conf-file includes the default_vhost.include-file
Code: | Include /etc/apache2/vhosts.d/default_vhost.include |
In the standard-configuration...
Also the default vhost seems to be *:80 - dunno if _default_:80 works, too? |
|
Back to top |
|
|
|