Score:0

Failing to connect apache2 with ScriptAlias

de flag

I'm trying to set up a ScriptAlias on an apache2 server, but when I try to connect to it using the alias, I get a Forbidden error:

enter image description here

This is my /etc/apache2/apache.conf:

enter image description here

cgi.load is enabled on /etc/apache2/mods-enabled/:

enter image description here

This is the /new-cgi/foo.cgi file and its permissions:

enter image description here

And if I do sudo su www-data -s /bin/bash, I can access the file and execute it without any problems.

There are some warnings (not fatal) in the logs plus a AH01630: client denied by server configuration which I believe is the cause of the problem but I can't figure out how to solve it:

enter image description here

My version of Apache2 is 2.4.41

Thanks in advance for any help!

Score:3
cn flag
Kai

Your scriptalias definition misses a / on the right argument. It really aliasses exactly what you type in the config, so if the left argument has a slash, and the right not, you end up missing a /.

In your case there is no directory or file named new-cgifoo.cgi in /, so the configuration denies it.

The exact docs are here: https://httpd.apache.org/docs/2.4/mod/mod_alias.html#scriptalias

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.