Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [Apache2] VirtualHosts e /etc/hosts

    Salve,

    allora... testando in locale cakephp (che uso con successo sui server remoti) volevo fare due cosette..

    in pratica ho apache configurato per avere come DocumentRoot la cartella /Users/utente/Sites del mio computer (osx, se può interessare)

    per testare cake e per non avere problemi con il RewriteEngine suo (che non saprei modificare), ho approntanto un virtualhost di cui sotto riporto la configurazione:

    codice:
    <VirtualHost *:80>
            ServerAdmin     myname@myemail.ext
    
            ServerName      testcake.localhost
            ServerAlias     testcake.localhost
            ServerAlias     testcake
    
            DocumentRoot    "/Users/utente/Sites/test_cake/app/webroot"
    
            <Directory "/Users/utente/Sites/test_cake/app/webroot">     
                    Options Indexes FollowSymLinks
                    AllowOverride All
                    Order allow,deny
                    Allow from all
            </Directory>
    
            # Rewrites
            RewriteEngine On
    
    
    
    </VirtualHost>
    e aggiungendo in /etc/hosts la seguente linea:

    codice:
    127.0.0.1        testcake.localhost
    solo che ora, anche http://localhost punta a cake, invece vorrei che soltanto testcake.localhost ci puntasse e che il localhost continuti a puntare alla DocumentRoot di apache

    Idee?
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  2. #2
    ok ho risolto cambiando il nome del dns da testcake.localhost a testcake.localhst e aggiungendo

    codice:
    <VirtualHost *:80>
            ServerName localhost
            DocumentRoot "/Users/gmac/Sites"
    </VirtualHost>
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.