CGI con script de Shell

CGI con script de Shell

Tengo problemas para ejecutar un ejemplo CGI con Shell Script, no puedo acceder al directorio creado en el ejemplo que estoy siguiendo "/tmp/shell". Accediendo a la dirección "http://localhost/shell"Debería ver una página "Índice de shel" pero aparece el error 403 con el mensaje "No tienes permiso para acceder a/shell/en este servidor".

Estoy usando Fedora 24, y creo que el usuario de apache se llama 'Apache', bueno, al menos hay un usuario de apache en el archivo "passwd", la carpeta donde quería ejecutar archivos CGI tiene el permiso 777 y ha cambiado. el usuario "apache" con chown, pero aún da el error 403.

Mi archivo "/etc/httpd/conf/httpd.conf" tiene este aspecto:

$ Tail -n20 /etc/httpd/conf/httpd.conf

# Settings for the study of Shell Script and CGI

Alias ​​/shell "/tmp/shell/"

<Directory "/tmp/shell/">
    Options Indexes FollowSymlinks ExecCGI
    AllowOverride None
    Order allow, deny
    Allow from all
</ Directory>

Mi /tmp/shell:

$ ls -ld /tmp/ /tmp/shell
drwxrwxrwt. 15 root   root   480 Out  1 13:53 /tmp/
drwxrwxr-x.  2 apache apache  40 Out  1 13:52 /tmp/shell

Apache se ejecuta normalmente enhttp://localhost, No entiendo por qué no puedo acceder al archivo /tmp/shell. ¡Me estoy volviendo loco aquí!

¿Alguien me puede ayudar?

Respuesta1

Fedora 24 usa systemd y probablemente esté configurando un privado /tmpsolo para el proceso httpd. Puedes comprobar esto con

sudo systemctl show -p PrivateTmp httpd

Puede anular esto creando un archivo /etc/systemd/system/httpd.serviceque contenga

.include /lib/systemd/system/httpd.service
[Service]
PrivateTmp=false

y haciendo sudo systemctl daemon-reloadantes de reiniciar el servicio.

información relacionada