@@ -6,12 +6,10 @@ Configuring a web server
6
6
7
7
The web directory is the home of all of your application's public and static
8
8
files. Including images, stylesheets and JavaScript files. It is also where the
9
- front controllers live. For more details, see the chapter about
10
- :ref: `the-web-directory `.
9
+ front controllers live. For more details, see the :ref: `the-web-directory `.
11
10
12
- The web directory is the one that you will need to configure in your webserver
13
- as the documentroot. In the examples below, this directory is in
14
- ``/var/www/project/web/ ``.
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/ ``.
15
13
16
14
Apache2
17
15
-------
@@ -20,7 +18,7 @@ For advanced Apache configuration options, see the official `Apache`_
20
18
documentation. The minimum basics to get your application running under Apache2
21
19
are:
22
20
23
- .. code-block :: Apache2
21
+ .. code-block :: apache
24
22
25
23
<VirtualHost *:80>
26
24
ServerName www.domain.tld
40
38
.. note ::
41
39
42
40
For performance reasons, you will probably want to set
43
- ``AllowOverride None `` and implement your `` .htaccess `` into the
44
- vhost config.
41
+ ``AllowOverride None `` and implement the rewrite rules in the `` web/ .htaccess ``
42
+ into the virtualhost config.
45
43
46
44
Nginx
47
45
-----
66
64
rewrite ^(.*)$ /app.php/$1 last;
67
65
}
68
66
69
- location ~ ^/(config| app|app_dev)\.php(/|$) {
67
+ location ~ ^/(app|app_dev)\.php(/|$) {
70
68
fastcgi_pass unix:/var/run/php5-fpm.sock;
71
69
fastcgi_split_path_info ^(.+\.php)(/.*)$;
72
70
include fastcgi_params;
73
71
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
74
72
fastcgi_param HTTPS off;
75
73
}
76
-
74
+
77
75
error_log /var/log/nginx/project_error.log;
78
76
access_log /var/log/nginx/project_access.log;
79
77
}
83
81
Depending on your PHP-FPM config, the ``fastcgi_pass `` can also be
84
82
``fastcgi_pass 127.0.0.1:9000 ``.
85
83
84
+ .. tip ::
85
+
86
+ This executes **only ** ``app.php `` and ``app_dev.php `` in the web directory.
87
+ All other files will be served as text. If you have other PHP files in
88
+ your web directory, be sure to include them in the ``location `` block
89
+ above.
90
+
86
91
.. _`Apache` : http://httpd.apache.org/docs/current/mod/core.html#documentroot
87
92
.. _`Nginx` : http://wiki.nginx.org/Symfony
88
-
0 commit comments