开发者

What is causing Apache2 to display PHP as plain text in this config file?

I am trying to run PHP and Rails in the same virtual host, however, PHP is being displayed as plain/text. When I create a test host without all the rewrites and proxy-ing, Apache2 will process the PHP as desired. Where in my config file have I gone wrong?

<VirtualHost *:80>
  #ServerName staging.domain.com
  #ServerAlias www.domain.com

  DocumentRoot /home/demo/vhosts/domain/public

  开发者_Python百科<Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>

  <Directory /home/demo/vhosts/domain/public>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
  </Directory>

  RewriteEngine On

  <Proxy balancer://thinservers>
    BalancerMember http://127.0.0.1:5000
    BalancerMember http://127.0.0.1:5001
    BalancerMember http://127.0.0.1:5002
  </Proxy>

  # Redirect all non-static requests to thin
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L]

  ProxyPass / balancer://thinservers/
  ProxyPassReverse / balancer://thinservers/
  ProxyPreserveHost on

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  # Custom log file locations
  ErrorLog  /home/demo/vhosts/domain/log/error.log
  CustomLog /home/demo/vhosts/domain/log/access.log combined

</VirtualHost>


Check your httpd.conf file and make sure it is loading the php5 module or if you use mod_suphp, make sure youre not loading both.

<Directory "/var/www/myrailsapp/public/">
        Options Indexes +ExecCGI FollowSymLinks 
        Order allow,deny
        Allow from all
</Directory>

This is more of a http://www.serverfault.com question ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜