2017-02-06 41 views
0

我編譯FCGI的Apache這樣的:FastCGI使用apache - 不是腳本或錯誤的權限?

g++ fcgistart.c -lfcgi 

我得到了a.out和使用

a2enmod fastcgi 

現在的阿帕奇配置它,我讀manual

分配給任何程序處理程序fcgid-script使用FastCGI協議進行處理;

這是否意味着二進制文件是一個腳本? Wreid!無論如何,我把a.out/var/www/html

因爲處理程序(/etc/apache2/mods-enabled/fastcgi.conf)綁定到.fcgi我複製a.outa.fcgi。現在我瀏覽到http://localhost/a.fcgi403-禁止的事件。

[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 

出了什麼問題?

回答

0

我懂了:

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

是錯誤的,我不得不添加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>