Skip to content

Instantly share code, notes, and snippets.

@epjuan21
Last active March 2, 2022 17:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save epjuan21/25bf88df640499c8b43c36c2e607bf88 to your computer and use it in GitHub Desktop.
Save epjuan21/25bf88df640499c8b43c36c2e607bf88 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>
@Alex-Santos1
Copy link

Hola, he seguido estos pasos y no me muestra mi proyecto de laravel, hay alguna actualización?

@ceszgdav
Copy link

Lo mismo por aca

@shvares
Copy link

shvares commented Mar 2, 2022

que tal hablo para decir que si funciono esta configuración para poder mostrar las urls de mi proyecto de laravel porque si lo mostraba en el iis pero me daba error las rutas gracias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment