Skip to content

Commit 8443b18

Browse files
committed
[symfony#2410] Minor tweaks for new web server documentation
1 parent d46e96c commit 8443b18

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

cookbook/configuration/web_server_configuration.rst

+15-11
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ Configuring a web server
66

77
The web directory is the home of all of your application's public and static
88
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`.
1110

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/``.
1513

1614
Apache2
1715
-------
@@ -20,7 +18,7 @@ For advanced Apache configuration options, see the official `Apache`_
2018
documentation. The minimum basics to get your application running under Apache2
2119
are:
2220

23-
.. code-block:: Apache2
21+
.. code-block:: apache
2422
2523
<VirtualHost *:80>
2624
ServerName www.domain.tld
@@ -40,8 +38,8 @@ are:
4038
.. note::
4139

4240
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.
4543

4644
Nginx
4745
-----
@@ -66,14 +64,14 @@ are:
6664
rewrite ^(.*)$ /app.php/$1 last;
6765
}
6866
69-
location ~ ^/(config|app|app_dev)\.php(/|$) {
67+
location ~ ^/(app|app_dev)\.php(/|$) {
7068
fastcgi_pass unix:/var/run/php5-fpm.sock;
7169
fastcgi_split_path_info ^(.+\.php)(/.*)$;
7270
include fastcgi_params;
7371
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
7472
fastcgi_param HTTPS off;
7573
}
76-
74+
7775
error_log /var/log/nginx/project_error.log;
7876
access_log /var/log/nginx/project_access.log;
7977
}
@@ -83,6 +81,12 @@ are:
8381
Depending on your PHP-FPM config, the ``fastcgi_pass`` can also be
8482
``fastcgi_pass 127.0.0.1:9000``.
8583

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+
8691
.. _`Apache`: http://httpd.apache.org/docs/current/mod/core.html#documentroot
8792
.. _`Nginx`: http://wiki.nginx.org/Symfony
88-

0 commit comments

Comments
 (0)