2017-02-06 2 views
0

ich meine fcgi für Apache wie folgt zusammengestellt:FastCGI mit Apache - kein Skript oder falsche Erlaubnis?

g++ fcgistart.c -lfcgi 

ich einen a.out bekam und konfigurieren Sie es für Apache mit

a2enmod fastcgi 

Jetzt lese ich die manual

abgetretenen Programm Das Handler fcgid-Skript wird unter Verwendung des FastCGI-Protokolls verarbeitet;

Bedeutet das, dass die Binärdatei ein Skript ist? Wreid! Jedenfalls platziere ich die a.out unter /var/www/html.

Da der Handler (/etc/apache2/mods-enabled/fastcgi.conf) an .fcgi bindet, kopiere ich a.out zu a.fcgi. Jetzt stöbere ich zu http://localhost/a.fcgi und einem 403-verbotenen occurse.

[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 

Was ist los?

Antwort

0

Ich habe es:

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

ist falsch, ich die ExecCGI Option hinzufügen hatte:

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