XAMPP - configuración del servidor virtual


Descargar XAMPP

XAMPP ver. 1.8.3-3 para Mac OS X ver. 10.9.2


Configuración inicial


XAMPP inicialmente tiene una dirección, localhost
Al cargar: se debe abrir una página con información sobre el servidor, la versión de PHP con enlaces a phpmyadmin, etc.

Para crear su host Apache VirtualHosts

1. Abra el archivo de configuración - /Applications/XAMPP/xamppfiles/etc/httpd.conf

1.1. Cambiar usuario daemon a nombre de usuario (p. 173)

171 #running httpd, as with most system services. 172 # 173 User daemon 174 Group daemon 175 </IfModule> 

donde nombre de usuario es el nombre de su usuario en Mac OS X

 171 #running httpd, as with most system services. 172 # 173 User username 174 Group daemon 175 </IfModule> 

1.2. Active VirtualHosts - sin comentarios (p. 488)

  • Incluir etc / extra / httpd-vhosts.conf

 487 #Virtual hosts 488 #Include etc/extra/httpd-vhosts.conf 

eliminar la cuadrícula antes de incluir

 487 #Virtual hosts 488 Include etc/extra/httpd-vhosts.conf 


2. Agregando sus hosts - abra el archivo - /Applications/XAMPP/etc/extra/httpd-vhosts.conf

2.1. Para mantener el host local trabajando sin cambios

 #localhost <VirtualHost *:80> ServerName localhost DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs" <Directory "/Applications/XAMPP/xamppfiles/htdocs"> Options Indexes FollowSymLinks Includes execCGI AllowOverride All Allow From All Order Allow,Deny </Directory> </VirtualHost> 

2.2. Conecte su sitio: cree una carpeta de sitio site.local (ejemplo)
nombre de usuario es su nombre de usuario de Mac OS X
carpeta: déjelo en la carpeta del sitio
site.local - carpeta del sitio

 #My custom host <VirtualHost *:80> ServerName site.local DocumentRoot "/Users/username/folder/site.local" <Directory "/Users/username/folder/site.local"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted </Directory> ErrorLog "logs/site.local-error_log" </VirtualHost> 

La directiva AllowOverride None debe reemplazarse por AllowOverride All; de lo contrario, el servidor Apache no leerá el archivo .htaccess.

3. Debe decirle a Mac OS X dónde están los sitios virtuales.
En la terminal, ingrese el comando:

sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit / etc / hosts

Agregue la línea al final del archivo de hosts: 127.0.0.1 site.local

 #XAMPP VirtualHost 127.0.0.1 site.local 

Reiniciamos XAMPP y se agregan hosts virtuales.

por localhost - abre XAMPP
por site.local : nuestro sitio ya está abierto.

Hecho

Source: https://habr.com/ru/post/439994/


All Articles