From 49928b397ab6447be4103e231fc5e55235f9fbd0 Mon Sep 17 00:00:00 2001 From: Shawn McCool Date: Wed, 11 Jul 2012 22:22:57 +0200 Subject: [PATCH] added server configuration to the documentation --- laravel/documentation/install.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/laravel/documentation/install.md b/laravel/documentation/install.md index 12f12951..73137df8 100644 --- a/laravel/documentation/install.md +++ b/laravel/documentation/install.md @@ -4,6 +4,7 @@ ## Contents - [Requirements](#requirements) - [Installation](#installation) +- [Server Configuration](#server-configuration) - [Basic Configuration](#basic-configuration) - [Environments](#environments) - [Cleaner URLs](#cleaner-urls) @@ -37,8 +38,27 @@ ### Problems? 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 + +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.dev + + +Notice that while we installed to **/Users/JonSnow/Sites/MySite** our DocumentRoot points to /Users/JonSnow/Sites/MySite/public**. + +While pointing the DocumentRoot to the public folder is a commonly used best-practice, it's possible that you may need to use Laravel on a host that does not allow you to update your DocumentRoot. A collection of algorithms to circumvent this need can be found [http://forums.laravel.com/viewtopic.php?id=1258](on the Laravel forums.) ## Basic Configuration