2017-02-06 3 views
0

Je compilé mon fcgi pour apache comme ceci:FastCGI en utilisant apache - pas un script ou une fausse autorisation?

g++ fcgistart.c -lfcgi 

J'ai obtenu un a.out et le configurer pour apache en utilisant

a2enmod fastcgi 

Maintenant je lis les manual

Tout programme affecté à le gestionnaire fcgid-script est traité en utilisant le protocole FastCGI; Est-ce que cela signifie que le binaire est un script?

Wreid! De toute façon je place le a.out à /var/www/html. Comme le gestionnaire (/etc/apache2/mods-enabled/fastcgi.conf) se lie à .fcgi, je copie a.out à a.fcgi. Maintenant je passe en revue http://localhost/a.fcgi et un 403-interdit occourse.

[email protected]:/var/www/html$ ls -la 
drwxr-xr-x 2 root root 4096 Feb 6 13:44 . 
drwxr-xr-x 3 root root 4096 Feb 6 12:56 .. 
-rwxr-xr-x 1 root root 8696 Feb 6 13:44 a.fcgi 
-rwxr-xr-x 1 root root 8696 Feb 6 13:16 a.out 
-rw-r--r-- 1 root root 11321 Feb 6 12:57 index.html 

Qu'est-ce qui ne va pas?

Répondre

0

Je l'ai:

<VirtualHost *:80> 
     ServerAdmin [email protected] 
     DocumentRoot /var/www/html 
     ErrorLog ${APACHE_LOG_DIR}/error.log 
     CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost> 

ne va pas, je devais ajouter l'option ExecCGI:

<VirtualHost *:80> 
     ServerAdmin [email protected] 
     DocumentRoot /var/www/html 
     ErrorLog ${APACHE_LOG_DIR}/error.log 
     CustomLog ${APACHE_LOG_DIR}/access.log combined 
     <Directory /var/www/html> 
       Options +ExecCGI 
     </Directory> 
</VirtualHost>