| 
4 | 4 | Configuring a Web Server  | 
5 | 5 | ========================  | 
6 | 6 | 
 
  | 
7 |  | -The web directory is the home of all of your application's public and static  | 
8 |  | -files. Including images, stylesheets and JavaScript files. It is also where the  | 
9 |  | -front controllers live. For more details, see the :ref:`the-web-directory`.  | 
 | 7 | +The preferred way to develop your Symfony2 application is to use  | 
 | 8 | +:doc:`PHP's internal web server </cookbook/web_server/built_in>`. However,  | 
 | 9 | +when using an older PHP version or when running the application in the production  | 
 | 10 | +environment, you'll need to use a fully-featured web server. This article  | 
 | 11 | +describes several ways to use Symfony with Apache2 or Nginx.  | 
10 | 12 | 
 
  | 
11 |  | -The web directory services as the document root when configuring your web  | 
12 |  | -server. In the examples below, this directory is in ``/var/www/project/web/``.  | 
 | 13 | +When using Apache2, you can configure PHP as an  | 
 | 14 | +:ref:`Apache module <web-server-apache-mod-php>` or with FastCGI using  | 
 | 15 | +:ref:`PHP FPM <web-server-apache-fpm>`. FastCGI also is the preferred way  | 
 | 16 | +to use PHP :ref:`with Nginx <web-server-nginx>`.  | 
 | 17 | + | 
 | 18 | +.. sidebar:: The Web Directory  | 
 | 19 | + | 
 | 20 | + The web directory is the home of all of your application's public and  | 
 | 21 | + static files, including images, stylesheets and JavaScript files. It is  | 
 | 22 | + also where the front controllers live. For more details, see the :ref:`the-web-directory`.  | 
 | 23 | + | 
 | 24 | + The web directory services as the document root when configuring your  | 
 | 25 | + web server. In the examples below, the ``web/`` directory will be the  | 
 | 26 | + document root. This directory is ``/var/www/project/web/``.  | 
 | 27 | + | 
 | 28 | +.. _web-server-apache-mod-php:  | 
13 | 29 | 
 
  | 
14 | 30 | Apache2 with mod_php/PHP-CGI  | 
15 | 31 | ----------------------------  | 
@@ -63,6 +79,8 @@ following configuration snippet:  | 
63 | 79 |  Require all granted  | 
64 | 80 |  </Directory>  | 
65 | 81 | 
  | 
 | 82 | +.. _web-server-apache-fpm:  | 
 | 83 | + | 
66 | 84 | Apache2 with PHP-FPM  | 
67 | 85 | --------------------  | 
68 | 86 | 
 
  | 
@@ -164,6 +182,8 @@ instead:  | 
164 | 182 | 
  | 
165 | 183 |  FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization  | 
166 | 184 | 
  | 
 | 185 | +.. _web-server-nginx:  | 
 | 186 | + | 
167 | 187 | Nginx  | 
168 | 188 | -----  | 
169 | 189 | 
 
  | 
 | 
0 commit comments