ConPaaS-team / conpaas

ConPaaS: integrated runtime environment for elastic cloud applications
http://www.conpaas.eu
BSD 3-Clause "New" or "Revised" License
14 stars 3 forks source link

nginx server not configured to use php #44

Closed anaion closed 10 years ago

anaion commented 10 years ago

The nginx configuration file (/etc/nginx/sites-available/default) of a php agent doesn't enable the use of php. The lines below should not be commented.

location ~ .php$ {

    #       fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    #
    #       # With php5-cgi alone:
    #       fastcgi_pass 127.0.0.1:9000;
    #       # With php5-fpm:
    #       fastcgi_pass unix:/var/run/php5-fpm.sock;
    #       fastcgi_index index.php;
    #       include fastcgi_params;
    #}
gpierre42 commented 10 years ago

Hi Ana, I am starting to wonder if the image running services is actually a Debian 6 (squeeze) rather than a Debian 7 (wheezy). Could you maybe take a look and report here? This might also explain the MySQL problem you reported today.

anaion commented 10 years ago

Hi Guillaume,

It is Debian 6, indeed. It was built a few weeks ago from the master. I guess I need to upgrade it, sorry for the spamming.

Thanks for your prompt answer!

Edit: I just noticed the version is configurable. I'll remove the other issue and close this one.

gpierre42 commented 10 years ago

Wait a minute: Debian6 is the expected version. I was wondering whether the image had been moved to Debian7 by mistake, which might have created the effects you are seeing.

anaion commented 10 years ago

Oh, I understood the other way around. It is squeeze.

tcrivat commented 10 years ago

Hi Ana,

Short answer: You are not looking in the right place, nginx is not started with the default configuration file. Moreover, if you want to see nginx configured to use php, you should check the configuration of a proxy node, not of a php (backend) node.

Long answer: The php service uses three types of agents: proxy, web and php.

The proxy node acts as a load balancer and forwards the requests to the web nodes (for static content) and to the php nodes (for dynamic content). This load balancer functionality is implemented using ngnix, started with the following configuration file: /var/cache/cpsagent/nginx-proxy.conf. Look here and you will see that php is enabled and the requests are forwarded to the php node.

The web node serves static content and also uses nginx. Its configuration file is /var/cache/cpsagent/nginx-static.conf.

The php node runs just php, no nginx process is needed here. You can see the php configuration here: /var/cache/cpsagent/fpm.conf.

The php service (generally) works fine and the configuration is fine.