Installando Symfony : virtualhost

Questo post ha piu' di 5 mesi. Gli url dei link potrebbero essere inattivi e i dati riportati potrebbero essere superati.

Visto che il blog serve anche a me per ricordare come fare certe cose e magari serve a qualcuno che si mette a cercare come farle, oggi mi segno come ho fatto per creare un virtualhost su apache2.
Questo mi serve perchè creando progetti tramite symfony è utile avere un riferimento virtuale alla cartella reale per evitare url lunghi chilometri!

  • Primo: Aprire il file “/etc/apache2/sites-enabled/000-default”.
    Alla fine di questo file inseriamo il seguente codice

    <virtualhost symfony>
    ServerName 127.0.1.1
    DocumentRoot “<indirizzo_cartella_progetto_symfony>/web”
    DirectoryIndex index.php
    Alias /sf /$sf_symfony_data_dir/web/sf
    <directory “/$sf_symfony_data_dir/web/sf”>
    AllowOverride All
    Allow from All
    </directory>
    <directory “<indirizzo_cartella_progetto_symfony>/web”>
    AllowOverride All
    Allow from All
    </directory>
    </virtualhost>

  • Secondo: Aprire il file “/etc/hosts” e scrivere la seguente riga sotto quelle già presenti (ci dovrebbe essere almeno quella per il localhost):

    127.0.1.1 symfony

  • Terzo: Riavviare apache2 “/ets/init.d/apache2 restart”

Con queste due modifiche il mio browser puntando alla pagina http://symfony/ restituisce esattamente la root del progetto symfony creato.

Se ovviamente non si sa come creare un progetto symfony o non si sa cosa è symfony potete visitare il sito www.symfony-project.org.

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribuzione-Non commerciale-Condividi allo stesso modo 2.5 Italia License.
This entry was posted in come fare cosa, planet-sprite, web development and tagged . Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>