Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems getting apache running
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
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 228
Location: Philadelphia

PostPosted: Sun Jul 20, 2014 12:21 pm    Post subject: Problems getting apache running Reply with quote

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
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 9394

PostPosted: Sun Jul 20, 2014 4:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 228
Location: Philadelphia

PostPosted: Sun Jul 20, 2014 10:03 pm    Post subject: Reply with quote

http://bpaste.net/show/482160/

This is where I saw the suggestion to add the entry to make.conf

https://forums.gentoo.org/viewtopic-t-852840-start-0.html
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 9394

PostPosted: Sun Jul 20, 2014 10:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 228
Location: Philadelphia

PostPosted: Sun Jul 20, 2014 11:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 228
Location: Philadelphia

PostPosted: Mon Jul 21, 2014 10:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 9394

PostPosted: Tue Jul 22, 2014 1:12 am    Post subject: Reply with quote

What does the Apache error log report?
Back to top
View user's profile Send private message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 228
Location: Philadelphia

PostPosted: Tue Jul 22, 2014 11:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
freke
Apprentice
Apprentice


Joined: 23 Jan 2003
Posts: 166

PostPosted: Wed Jul 23, 2014 4:22 am    Post subject: Reply with quote

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
View user's profile Send private message
mreff555
Apprentice
Apprentice


Joined: 10 Mar 2011
Posts: 228
Location: Philadelphia

PostPosted: Thu Jul 24, 2014 12:23 am    Post subject: Reply with quote

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
View user's profile Send private message
freke
Apprentice
Apprentice


Joined: 23 Jan 2003
Posts: 166

PostPosted: Thu Jul 24, 2014 11:14 am    Post subject: Reply with quote

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
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