Juan Carlos Clemente
1986-06-13
zetta
Website Photo
zetta

Crear un virtualHost

Por lo general cuando estamos haciendo pruebas o creando nuevos programas en LAMP recurrimos a guardarlos dentro de carpetas (localhost/prueba1; localhots/test; localhost/player; etc) por lo menos yo lo hice durante muchisimo tiempo. Ahora ya me acostumbre a que por cada proyecto realizado me genero un virtualhost diferente, un nombre de usuario mysql diferente (esto lo veremos en otro post).

Hacelo es una tarea sencilla:

Iniciamos creando un archivo nuevo dentro de nuestra carpeta de sites-available (uso gedit pero pueden usar el que deseen=

1
$ sudo mined /etc/apache2/sites-available/test

y le guardamos unos datos similares a estos =)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<virtualhost *>
    ServerAdmin zetaweb@gmail.com
    #carpeta donde se encuentran nuestros archivos
    DocumentRoot /home/zetta/sites/test/public_html
    #url para accesar desde el navegador
    ServerName test.lc
    #Aqui se definen las reglas como si de un .htacces se tratara =)
    <directory /home/zetta/sites/test/public_html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </directory>
    #donde guardara el error log
    ErrorLog /home/zetta/sites/test/logs/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined
    ServerSignature On
</virtualhost>

Ya creado lo habilitamos con el comando Apache 2 Enable Site

1
$ a2ensite test

y reiniciamos apache

1
$ sudo /etc/init.d/apache2 restart

- Actualización –
Se me olvidaba, una vez creado el virtual host hay que decirle a nuestra maquina que busque test.lc en nuestro mismo localhost
Abrimos el archivo hosts

1
$ sudo mined /etc/hosts

y Agregamos la linea

127.0.0.1 test.lc (claro si no es en localhost pues cambien la IP)

7 Responses to “Crear un virtualHost”

  1. Reborn Babies Says:

    Hey there, You’ve done an incredible job. I will certainly digg it and personally suggest to my friends. I am sure they’ll be benefited from this website.

  2. Mihalev Says:

    ????? ?????? ??????, ????? ????? ??????????? ?? RSS !

  3. Sammie Wirth Says:

    iPod touch and nano are still last year’s models

  4. Estrella Arvayo Says:

    Another thing I’ve noticed is that for many people, poor credit is the reaction of circumstances further than their control. As an example they may be really saddled by having an illness and because of this they have large bills for collections. It can be due to a employment loss or the inability to do the job. Sometimes breakup can truly send the money in the undesired direction. Thank you for sharing your opinions on this blog site.

  5. here Says:

    I wanted to put you a bit of word to be able to say thanks yet again for your pleasant ideas you’ve shared at this time. It has been so tremendously generous of you to allow freely exactly what a lot of folks would have made available as an ebook to earn some dough for their own end, certainly now that you could possibly have done it if you considered necessary. Those good ideas additionally worked as the fantastic way to fully grasp other individuals have the same fervor much like mine to know a little more with regard to this issue. I think there are thousands of more pleasant periods in the future for many who go through your site.

  6. Cheap London Escort Says:

    Really enjoy that post. It’s tricky to sort the good from the negative at times, but I believe you’ve nailed it!

  7. Gerry Regas Says:

    I believe that is one of the most vital info for me. And i am satisfied studying your article. However want to observation on few basic issues, The website taste is wonderful, the articles is really great : D. Just right task, cheers

Leave a Reply