From 5a4d622bb71482631d2b142163d6b9601162b289 Mon Sep 17 00:00:00 2001 From: Jeffrey Way Date: Sat, 23 Jun 2012 14:32:27 -0300 Subject: [PATCH 1/2] Fix small typo in validation docs. --- laravel/documentation/validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/documentation/validation.md b/laravel/documentation/validation.md index 49401439..4da4683c 100644 --- a/laravel/documentation/validation.md +++ b/laravel/documentation/validation.md @@ -12,7 +12,7 @@ ## The Basics -Almost every interactive web application needs to validate data. For instance, a registration form probably requires the password to be confirmed. Maybe the e-mail address must be unique. Validating data can be a cumbersome process. Thankfully, it isn't in Laravel. The Validator class provides as awesome array of validation helpers to make validating your data a breeze. Let's walk through an example: +Almost every interactive web application needs to validate data. For instance, a registration form probably requires the password to be confirmed. Maybe the e-mail address must be unique. Validating data can be a cumbersome process. Thankfully, it isn't in Laravel. The Validator class provides an awesome array of validation helpers to make validating your data a breeze. Let's walk through an example: #### Get an array of data you want to validate: From d08db5c26bb0a078463370dd1a3af85d086690d0 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Mon, 25 Jun 2012 13:45:29 +0200 Subject: [PATCH 2/2] added server configuration to install docs --- laravel/documentation/contents.md | 1 + laravel/documentation/install.md | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/laravel/documentation/contents.md b/laravel/documentation/contents.md index 1d5ce11e..5a512ad1 100644 --- a/laravel/documentation/contents.md +++ b/laravel/documentation/contents.md @@ -4,6 +4,7 @@ - [Installation & Setup](/docs/install) - [Requirements](/docs/install#requirements) - [Installation](/docs/install#installation) + - [Server Configuration: Why Public?](/docs/install#server-configuration) - [Basic Configuration](/docs/install#basic-configuration) - [Environments](/docs/install#environments) - [Cleaner URLs](/docs/install#cleaner-urls) diff --git a/laravel/documentation/install.md b/laravel/documentation/install.md index 12f12951..b3312366 100644 --- a/laravel/documentation/install.md +++ b/laravel/documentation/install.md @@ -4,6 +4,7 @@ - [Requirements](#requirements) - [Installation](#installation) +- [Server Configuration: Why Public?](#server-configuration) - [Basic Configuration](#basic-configuration) - [Environments](#environments) - [Cleaner URLs](#cleaner-urls) @@ -37,8 +38,30 @@ Installing the following goodies will help you take full advantage of Laravel, b If you are having problems installing, try the following: -- Make sure the **public** directory is the document root of your web server. +- Make sure the **public** directory is the document root of your web server. (see: Server Configuration below) - If you are using mod_rewrite, set the **index** option in **application/config/application.php** to an empty string. +- Verify that your storage folder and the folders within in are writable by your web server. + + +## Server Configuration: Why Public? + +Like most web-development frameworks, Laravel is designed to protect your application code, bundles, and local storage by placing only files that are necessarily public in the web server's DocumentRoot. This prevents some types of server misconfiguration from making your code (including database passwords and other configuration data) accessible through the web server. It's best to be safe. + +In this example let's imagine that we installed Laravel to the directory **/Users/JonSnow/Sites/MySite**. + +A very basic example of an Apache VirtualHost configuration for MySite might look like this. + + + DocumentRoot /Users/JonSnow/Sites/MySite/public + ServerName mysite.local + + +Notice that while we installed to **/Users/JonSnow/Sites/MySite** our DocumentRoot points to **/Users/JonSnow/Sites/MySite/public**. + +Pointing the DocumentRoot to the public folder is a commonly used best-practice. However, you may need to use Laravel on a host that does not allow you to update your DocumentRoot. This is possible, but before resigning to this option it's best to contact your host and verify that you are unable to change your DocumentRoot to increase the security of your application. + +More information about how to use the public folder can be found on the [Laravel Forums](http://forums.laravel.com/viewtopic.php?pid=10023#p10023). + ## Basic Configuration @@ -70,7 +93,7 @@ Next, create an **application/config/local** directory. Any files and options yo ); -In this example, the local **URL** option will override the **URL** option in **application/config/application.php**. Notice that you only need to specify the options you wish to override. +In this example, the local **URL** option will override the **URL** option in **application/config/application.php**. Notice that you only need to specify the options you wish to override. Isn't it easy? Of course, you are free to create as many environments as you wish!