2014-02-10 2 views
2

아파치 2.2와 PHP-FPM mod_fcgi 셋업으로 기본 CakePHP 2.4 앱 셋업을 시도하고 있는데, 알아낼 수없는 내부 리다이 팅 문제가 발생했습니다. .CakePHP 2.4 아파치 2.2와 PHP-FPM

그 파일은 아파치가 필요한 모듈이로드에 불과과 PHP의 FastCGI 프로세스 설정이 기본 CakePHP는 2.4 분기이

# Send all php file requests to the fcgi handler 
FastCgiExternalServer /var/www/php5.external -socket /var/run/php5-fpm.sock 
AddHandler php5-fcgi .php 
Action php5-fcgi /usr/lib/cgi-bin/php5.external 
Alias /usr/lib/cgi-bin/ /var/www/ 

과 같은

ServerAdmin [email protected] 
ServerName company.local 
ServerAlias *.company.local 
DocumentRoot /var/www/ 

# Since htis is a PHP site avoid wasting time looking for other index files 
DirectoryIndex index.php 

<Directory /var/www> 
    Options Indexes FollowSymLinks MultiViews +ExecCGI 
    Order allow,deny 
    allow from all 
    AllowOverride All 
</Directory> 

기본 설정이없는 나는 다음과 같은 오류가 발생합니다

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. 

나는 모든 제안과 트릭을 시도했다. 나는 케이크가 정리 문제를 재 받고에서 찾을 수 있지만,이 PHP-FPM 설치에 내려 보인다

나는 응용 프로그램/웹 루트에 다음을 추가하면 내 재 작성 로그이

192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16e10a0/initial] (2) init rewrite engine with requested uri/
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16e10a0/initial] (1) pass through/
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16e10a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/ -> 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16e10a0/initial] (3) [perdir /var/www/] applying pattern '^$' to uri '' 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16e10a0/initial] (2) [perdir /var/www/] rewrite '' -> 'app/webroot/' 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16e10a0/initial] (3) [perdir /var/www/] add per-dir prefix: app/webroot/ -> /var/www/app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16e10a0/initial] (2) [perdir /var/www/] strip document_root prefix: /var/www/app/webroot/ -> /app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16e10a0/initial] (1) [perdir /var/www/] internal redirect with /app/webroot/ [INTERNAL REDIRECT] 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16dcb78/initial/redir#1] (2) init rewrite engine with requested uri /app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16dcb78/initial/redir#1] (1) pass through /app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16dcb78/initial/redir#1] (3) [perdir /var/www/app/webroot/] strip per-dir prefix: /var/www/app/webroot/ -> 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16dcb78/initial/redir#1] (3) [perdir /var/www/app/webroot/] applying pattern '.*' to uri '' 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16dcb78/initial/redir#1] (1) [perdir /var/www/app/webroot/] pass through /var/www/app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b60a0/subreq] (2) init rewrite engine with requested uri /app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b60a0/subreq] (1) pass through /app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b60a0/subreq] (3) [perdir /var/www/app/webroot/] strip per-dir prefix: /var/www/app/webroot/index.php -> index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b60a0/subreq] (3) [perdir /var/www/app/webroot/] applying pattern '.*' to uri 'index.php' 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b60a0/subreq] (1) [perdir /var/www/app/webroot/] pass through /var/www/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (2) init rewrite engine with requested uri /usr/lib/cgi-bin/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (1) pass through /usr/lib/cgi-bin/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (3) [perdir /var/www/] add path info postfix: /var/www/php5.external -> /var/www/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (3) [perdir /var/www/] strip per-dir prefix: /var/www/php5.external/app/webroot/index.php -> php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (3) [perdir /var/www/] applying pattern '^$' to uri 'php5.external/app/webroot/index.php' 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (3) [perdir /var/www/] add path info postfix: /var/www/php5.external -> /var/www/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (3) [perdir /var/www/] strip per-dir prefix: /var/www/php5.external/app/webroot/index.php -> php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (3) [perdir /var/www/] applying pattern '(.*)' to uri 'php5.external/app/webroot/index.php' 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (2) [perdir /var/www/] rewrite 'php5.external/app/webroot/index.php' -> 'app/webroot/php5.external/app/webroot/index.php' 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (3) [perdir /var/www/] add per-dir prefix: app/webroot/php5.external/app/webroot/index.php -> /var/www/app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (2) [perdir /var/www/] strip document_root prefix: /var/www/app/webroot/php5.external/app/webroot/index.php -> /app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16b8b88/initial/redir#2] (1) [perdir /var/www/] internal redirect with /app/webroot/php5.external/app/webroot/index.php [INTERNAL REDIRECT] 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16af770/initial/redir#3] (2) init rewrite engine with requested uri /app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16af770/initial/redir#3] (1) pass through /app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16af770/initial/redir#3] (3) [perdir /var/www/app/webroot/] add path info postfix: /var/www/app/webroot/php5.external -> /var/www/app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16af770/initial/redir#3] (3) [perdir /var/www/app/webroot/] strip per-dir prefix: /var/www/app/webroot/php5.external/app/webroot/index.php -> php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16af770/initial/redir#3] (3) [perdir /var/www/app/webroot/] applying pattern '.*' to uri 'php5.external/app/webroot/index.php' 
192.168.56.1 - - [09/Feb/2014:22:08:13 --0500] [company.local/sid#7ff2c1871658][rid#7ff2c16af770/initial/redir#3] (1) [perdir /var/www/app/webroot/] pass through /var/www/app/webroot/php5.external 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d70a0/initial] (2) init rewrite engine with requested uri/
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d70a0/initial] (1) pass through/
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d70a0/initial] (3) [perdir /var/www/] strip per-dir prefix: /var/www/ -> 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d70a0/initial] (3) [perdir /var/www/] applying pattern '^$' to uri '' 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d70a0/initial] (2) [perdir /var/www/] rewrite '' -> 'app/webroot/' 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d70a0/initial] (3) [perdir /var/www/] add per-dir prefix: app/webroot/ -> /var/www/app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d70a0/initial] (2) [perdir /var/www/] strip document_root prefix: /var/www/app/webroot/ -> /app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d70a0/initial] (1) [perdir /var/www/] internal redirect with /app/webroot/ [INTERNAL REDIRECT] 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d2b78/initial/redir#1] (2) init rewrite engine with requested uri /app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d2b78/initial/redir#1] (1) pass through /app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d2b78/initial/redir#1] (3) [perdir /var/www/app/webroot/] strip per-dir prefix: /var/www/app/webroot/ -> 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d2b78/initial/redir#1] (3) [perdir /var/www/app/webroot/] applying pattern '.*' to uri '' 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1d2b78/initial/redir#1] (1) [perdir /var/www/app/webroot/] pass through /var/www/app/webroot/ 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1ac0a0/subreq] (2) init rewrite engine with requested uri /app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1ac0a0/subreq] (1) pass through /app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1ac0a0/subreq] (3) [perdir /var/www/app/webroot/] strip per-dir prefix: /var/www/app/webroot/index.php -> index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1ac0a0/subreq] (3) [perdir /var/www/app/webroot/] applying pattern '.*' to uri 'index.php' 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1ac0a0/subreq] (1) [perdir /var/www/app/webroot/] pass through /var/www/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (2) init rewrite engine with requested uri /usr/lib/cgi-bin/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (1) pass through /usr/lib/cgi-bin/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (3) [perdir /var/www/] add path info postfix: /var/www/php5.external -> /var/www/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (3) [perdir /var/www/] strip per-dir prefix: /var/www/php5.external/app/webroot/index.php -> php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (3) [perdir /var/www/] applying pattern '^$' to uri 'php5.external/app/webroot/index.php' 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (3) [perdir /var/www/] add path info postfix: /var/www/php5.external -> /var/www/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (3) [perdir /var/www/] strip per-dir prefix: /var/www/php5.external/app/webroot/index.php -> php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (3) [perdir /var/www/] applying pattern '(.*)' to uri 'php5.external/app/webroot/index.php' 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (2) [perdir /var/www/] rewrite 'php5.external/app/webroot/index.php' -> 'app/webroot/php5.external/app/webroot/index.php' 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (3) [perdir /var/www/] add per-dir prefix: app/webroot/php5.external/app/webroot/index.php -> /var/www/app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (2) [perdir /var/www/] strip document_root prefix: /var/www/app/webroot/php5.external/app/webroot/index.php -> /app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1aeb88/initial/redir#2] (1) [perdir /var/www/] internal redirect with /app/webroot/php5.external/app/webroot/index.php [INTERNAL REDIRECT] 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1a5770/initial/redir#3] (2) init rewrite engine with requested uri /app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1a5770/initial/redir#3] (1) pass through /app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1a5770/initial/redir#3] (3) [perdir /var/www/app/webroot/] add path info postfix: /var/www/app/webroot/php5.external -> /var/www/app/webroot/php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1a5770/initial/redir#3] (3) [perdir /var/www/app/webroot/] strip per-dir prefix: /var/www/app/webroot/php5.external/app/webroot/index.php -> php5.external/app/webroot/index.php 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1a5770/initial/redir#3] (3) [perdir /var/www/app/webroot/] applying pattern '.*' to uri 'php5.external/app/webroot/index.php' 
192.168.56.1 - - [09/Feb/2014:22:09:37 --0500] [company.local/sid#7fc4fe367678][rid#7fc4fe1a5770/initial/redir#3] (1) [perdir /var/www/app/webroot/] pass through /var/www/app/webroot/php5.external 

과 같은

/htaccess로

RewriteCond %{ENV:REDIRECT_STATUS} 200 
RewriteRule .* - [L] 

디버깅

위해 나는 펑키 URL을 재 작성 끝나는 것을 볼 수 있습니다 나는

요청 된 URL의 /app/webroot/php5.external/app/web을 찾을 수 없음 (404)를 얻을 수 이 서버에서는 root/index.php를 찾을 수 없습니다.

답변

2

그래서 이것이은/var/www가 두 개 이상 존재했다 루프로 전환

문제가 (이 경우,은/var/WWW)에서 아파치의 DocumentRoot 같은 경우 fastcgi 별명을 갖는이었다 밝혀 장소. 해결 방법은 fcgi PHP 설치를 올바르게 정의하는 것입니다. 예를 들어

:

FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock 
AddHandler php5-fcgi .php 
Action php5-fcgi /php5-fcgi 
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi 
관련 문제