Skip to content

Instantly share code, notes, and snippets.

@talcual
Forked from epjuan21/InstallLaravelOnIIS.bash
Created February 8, 2021 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talcual/9f117492f5a3064d89f6c467b6e78cb5 to your computer and use it in GitHub Desktop.
Save talcual/9f117492f5a3064d89f6c467b6e78cb5 to your computer and use it in GitHub Desktop.
Instalar Laravel en Windows Server IIS
## Instalar Laravel 5.7 en Windows Server 2012 R2 Sobre Internet Information Services
# Nos ubicamos en la carpeta de IIS C:\inetpub\wwwroot
# Ejecutamos el siguiente comando en la terminal
composer create-project --prefer-dist laravel/laravel blog "5.7.*"
## Configurar el Proyecto en IIS
# En Internet Informacion Services
# Clic derecho en Sitios
# Agregar sitio web...
# En Agregar sitio web
# Nombre del sitio: ponemos el nombre que deseamos. Por ejemplo Laravel o laravel.local
# Grupo de aplicaciones: DefaultAppPool
# Ruta de acceso fisica: seleccionamos la ruta donde se encuentra la carpeta publica del proyecto. Por ejemplo C:\inetpub\wwwroot\laravel\public
# Enlace
# Tipo: http
# Dirección IP: Todas las no asignadas
# Puerto: 80
# Nombre del host: el nombre que deseamos, por ejemplo www.laravel.local
# Aceptar
## Configurar el nombre del host en el archivo host
# Ubicar la ruta C:\Windows\System32\drivers\etc
# Agregar en el archivos hosts el nombre del host que pusimos en el IIS
# En este caso seria
127.0.0.1 www.larevel.local
# Este debe coincidir con el nombre establecido en Nombre del host en IIS
## Establecer permisos a la carpeta storage de Laravel
# Ubicamos la ruta de la carpeta storage dentro del proyecto de Laravel
# Clic derecho en la carpeta storage
# Pestaña Seguridad
# Clic en Editar
# Seleccionamos el usuario IIS_IUSRS
# En la fila Permitir seleccionamos la casilla Control Total
# Por último Aplicar y Aceptar
## Establecer permisos a la carpeta bootstrap/cache de Laravel
# Ubicamos la ruta de la carpeta bootstrap/cache dentro del proyecto de Laravel
# Clic derecho en la carpeta cache
# Pestaña Seguridad
# Clic en Editar
# Seleccionamos el usuario IIS_IUSRS
# En la fila Permitir seleccionamos la casilla Control Total
# Por último Aplicar y Aceptar
## Crear archivo web.config en la carpeta del proyecto Laravel
# Nos ubicamos en la carpeta raiz del proyecto
# Creamos el archivo web.config con el siguiente contenido
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
<add value="default.aspx" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
<httpErrors errorMode="Detailed" />
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment