Pregunta

I have installed xampp on my mavericks, I have come through the configuration of virtual hosts even when I thought I would do it by myself, but it still doesn't work. I can't find the problem anywhere, I have looked in all files that could have something to do with it, rewritten the /etc/hosts file the ../xamppfiles/etc/extra/httpd-vhosts.conf and the ../xamppfiles/etc/httpd.conf but when I go to browser and I type my vhosts specified address it doesnt work, it throws me a google search. I also tried to add another vhost but the same happens.

My vhosts file looks like this: NameVirtualHost *:80

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


# My custom host
<VirtualHost *:80>
ServerName "site1.local"
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/site1"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/site1">
    Options Indexes FollowSymLinks Includes ExecCGI
    Order allow,deny
    Allow from all
    AllowOverride All
    Require all granted
</Directory>
ErrorLog "Applications/XAMPP/xamppfiles/htdocs/site1/site1.local-error_log"
</VirtualHost>

I have also added this line to the bottom of the hosts file:

# XAMPP VirtualHost mappings
127.0.0.1 site1.local

And uncommented the line in httpd.conf

Include etc/extra/httpd-vhosts.conf

I have disabled the .htaccess file by renaming it to htaccess and commenting out all the stuff.

I really dont know what else to do and it still doesnt work :-/

I didnt forget to restart the apache server respectively.

¿Fue útil?

Solución

Your vhost file is missing backslashes. It should looks like:

# localhost
<VirtualHost *:80>
ServerName "localhost"
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/xampp"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/xampp/">
    Options Indexes FollowSymLinks Includes execCGI
    AllowOverride All
    Allow From All
    Order Allow,Deny
</Directory>
</VirtualHost>
# My custom host
<VirtualHost *:80>
ServerName "site1.local"
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/site1"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/site1/">
    Options Indexes FollowSymLinks Includes ExecCGI
    Order allow,deny
    Allow from all
    AllowOverride All
    Require all granted
</Directory>
ErrorLog "Applications/XAMPP/xamppfiles/htdocs/site1/site1.local-error_log"
</VirtualHost>

put to your browser http://site1.local/ and it should be working.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top