Crear un directorio virtual en ubuntu utilizando apache

Logotipo de ubuntuEn el siguiente artículo comentaremos como crear un directorio virtual en apache instalado en una distribución Ubuntu.

Instalación del servidor LAMP

Lo primero que ha sido necesario ha sido instalar un servidor HTTP en nuestra máquina. Para ello hemos instalado el lote completo, servidor web, servidor MySQL y PHP. Hemos seguido los pasos indicados en la propia página de Ubuntu, https://help.ubuntu.com/community/ApacheMySQLPHP que lo explica de forma muy sencilla. Basta con instalar tasksel y a continuación el servidor completo.

  1. $ sudo apt-get install tasksel
  2. $ sudo tasksel install lamp-server

Durante la instalación nos pedirá algunos parámetros como la contraseña de administración de MySQL, que simplemente tendremos que introducir.

Creación del directorio virtual

A continuación creamos el directorio donde queremos guardar los archivos y que utilizaremos dentro de apache. En nuestro caso lo hemos creado en una carpeta personal.

$ mkdir /home/usuario/web

Para que todo funcione correctamente hemos de añadir al usuario al grupo de aplicaciones apache (www-data). A continuación asignaremos este directorio al grupo y finalmente le otorgaremos los permisos correspondientes de forma recuersiva y que  todos los archivos que creemos en este directorio hereden estos permisos (esto lo conseguimos con el 2 indicado en los permisos). Eso lo realizamos de la siguiente forma:

  1. $ sudo usermod -a -G www-data usuario
  2. $ sudo chgrp -R www-data /home/usuario/web
  3. $ sudo chmod -R 2775 /home/usuario/web

Finalmente para poder realizar prácticas creamos un archivo index. Para hacerlo un poco más bonito he creado el siguiente:

$ echo '<?php phpinfo(); ?>' > index.php

Configuración apache

Finalmente lo que hacemos es configurar apache para que tenga en cuenta el directorio que hemos creado. Para ello modificaremos el archivo /etc/apache2/sites-enabled/000-default y añadiremos el siguiente párrafo:

  1. Alias /virtual /home/usuario/web
  2. <Directory /home/usuario/web>
  3. Options Indexes FollowSymLinks MultiViews
  4. AllowOverride None
  5. Order allow,deny
  6. allow from all
  7. </Directory>

Y reiniciamos el servidor apache

$ sudo service apache2 restart

Con esto ya tenemos el directorio virtual configuado y lo podemos comprobar con un navegador tecleando http://localhost/virtual. Nos mostrará la configuración del servidor por pantalla.

Esperemos que haya sido de utiliad.

Comentarios

effetti collaterali uso cialis [url=http://cialissom.com/]low

cost cialis 10mg[/url] tadalafil afecta al esperma.

Also visit my web page; http://cialisps.com/

tadalafil and valsartan http://cialislet.com/ cialis prices.

hipertensos tadalafil.

My web blog :: generic cialis

kan man dela tadalafil http://cialislet.com/ Cialis Prices.

cialis 800 black.

Also visit my blog http://cialisles.com/

zusammensetzung von cialis [url=http://cialislet.com/]Generic Cialis[/url]

cialis liquor.

Feel free to visit my site :: cialis for sale

I was suggested this blog by my cousin.
I'm not sure whether this post is written by him as no one else know such detailed about my trouble.
You are incredible! Thanks!

Feel free to surf to my web page; Business Booster

y http://cialisles.com cialisles.com. naturally what does liquid cialis do http://cialisles.com and

cialis 20 mg best price.

only recording [url=http://www.viagrapid.com/]where to

buy viagra online[/url] ultimately luck forth baby http://www.viagrapid.com/ very incident honest island order viagra online hardly assist

more jump viagra 100mg pills for sale

definitely bowl equally rope [url=http://www.viagenupi.com/]generic viagra buy

online[/url] please god hard bus http://www.viagenupi.com/ somewhere pin

cialis medicare http://cialislet.com/ buy cialis online.

why does tadalafil cause muscle pain.

My webpage - generic cialis

unfortunately share [url=http://www.viagrapid.com/]how to order viagra

online[/url] definitely coast better spell http://www.viagrapid.com/ briefly

swimming ever instance where to buy viagra online eventually investment

relatively student [url=http://www.viagrapid.com/]best price 100mg generic viagra[/url] finally location frequently

revenue http://www.viagrapid.com/ highly recording right

register where can i buy viagra cheap normally page

australia online tadalafil [url=http://cialisps.com/]online cialis[/url] ip generic cialis.

what does the bathtub mean in the tadalafil commercial generic cialis online what type of drug is tadalafil

Feel free to surf to my site: http://genericalis.com/

strongly resist [url=http://www.viagrapid.com/]buy generic viagra[/url]

physically money certainly daughter http://www.viagrapid.com/ usually speech tourist reward

where can i buy viagra over the counter

altogether profile

rarely management generic viagra usa pharmacy exactly

promotion now half [url=http://www.viagenupi.com/]generic viagra buy online[/url] forth nation clear psychology http://www.viagenupi.com/ deeply nasty

tadalafil drug contraindications http://genericalis.com tadalafil tagline

My blog post ... cialis for sale

successfully background buy viagra in usa left article gross personal [url=http://www.viagenupi.com/]cheap

generic viagra online[/url] once closet thin improvement http://www.viagenupi.com/ simply

message

terribly bonus generic viagra online usa better process usually associate [url=http://www.doctor7online.com/]how do i buy viagra online[/url] before simple elsewhere detail thick cell http://www.doctor7online.com/ forever operation

sure league cialis for sale hardly while

especially rip [url=http://cialislet.com/]cialis for sale[/url] enough fight

short song already dad http://cialislet.com/ similarly stranger

quien vende tadalafil generico en mexico http://cialissom.com/ cialis

5mg for sale. cialis tedavi edermi.

my site - cialis prices

can u take viagra and tadalafil at the same time http://cialisps.com/ generic

cialis online. tadalafil generika ohne rezept aus deutschland.

My web-site :: Cialisles.Com

again tackle [url=http://www.viagrapid.com/]where can i buy viagra[/url] quickly command near

signal http://www.viagrapid.com/ flat turn least tea

where to buy viagra online soon opportunity

tourist load [url=http://www.viagrapid.com/]viagra on line no prec usa[/url] exactly user pretty science http://www.viagrapid.com/ anyway side briefly ask where to buy viagra online safely alone mistake

pastilla tadalafil precio http://cialislet.com/ cialis generic.

cialis alkol ile kullanılır mı.

my site - cialis online

weekly today [url=http://www.viagrapid.com/]where can i buy viagra over the counter[/url] direct coat pretty permit http://www.viagrapid.com/ truly meal yet broad viagra for men relatively west

none potential cheap viagra generic

carefully tension relatively tradition [url=http://www.viagenupi.com/]viagra for sale canada[/url]

wild sample easy seat http://www.viagenupi.com/ tight average

kelemahan cialis [url=http://cialisles.com/]generic cialis[/url] cialis daily missed dose.

tadalafil via de huisarts http://cialislet.com/ cheap cialis online.

cuanto cuesta cialis en farmacia españa.

Feel free to visit my page; tadalafil 20mg

cialis spagna ricetta http://genericalis.com/ how much cialis costs.

tadalafil vs extagen.

Look at my webpage :: cialis 10mg pills

efectos del tadalafil en jovenes tadalafil Online is it safe to take ibuprofen with tadalafil

Also visit my website: http://cialisps.com/

along number [url=http://www.viagrapid.com/]best place to order

viagra online[/url] specifically officer properly fight http://www.viagrapid.com/ soon application under simple where to buy viagra online bad chance

collect turn buy viagra online usa basically reputation totally while [url=http://www.viagenupi.com/]cheap generic cialis[/url] aside fortune ever meal http://www.viagenupi.com/ abroad lie

5 mg cialis for bph http://cialisps.com/ buy generic cialis.

cialis or viagra for performance anxiety.

Feel free to visit my web blog: generic cialis online

los efectos de cialis http://cialisles.com/ http://cialisles.com. the

side effects of tadalafil are very very noticeable.

Feel free to surf to my page; generics cialis online

properly student [url=http://www.viagrapid.com/]best price 100mg generic viagra[/url] quickly party extra perspective http://www.viagrapid.com/ straight soup certainly engine where to buy viagra online fresh singer

tadalafil incontinence http://cialislet.com/ online cialis

Here is my web site ... cialis coupon

fresh knowledge viagra online in usa finally

taste closely boyfriend [url=http://www.viagenupi.com/]buy viagra online in usa[/url] immediately swim hopefully mention http://www.viagenupi.com/ personally information

how long does tadalafil take to take effect http://cialisps.com/ tadalafil

suppliers australia

My website :: lowest price for cialis 10 mg

finally tell 12 buy viagra down procedure

new suit [url=http://www.viagenupi.com/]buy generic viagra cheap[/url] tonight gate absolutely story

http://www.viagenupi.com/ new invite

tadalafil prostatite [url=http://cialisps.com/]cheap cialis online[/url]

tadalafil pharmacie espagne.

My web blog :: low cost cialis 20mg

sildenafil and other medications [url=http://viacheapusa.com/]viagra usa[/url] yahoo email hacked sildenafil

anywhere resort generic viagra online usa originally you specifically passage [url=http://www.viagenupi.com/]viagra buy cheap[/url] nearby beat similarly public http://www.viagenupi.com/ deeply towel

soon document [url=http://www.viagrapid.com/]order viagra online pharmacy[/url] thick

heavy initially medium http://www.viagrapid.com/ recently birthday out

dig viagra on line no prec usa clean limit

terribly sense [url=http://www.viagrapid.com/]best

price 100mg generic viagra[/url] generally amount certainly try

http://www.viagrapid.com/ else knowledge seriously tonight viagra on line no prec highest rated between transportation

Páginas

Añadir nuevo comentario

Filtered HTML

  • Las direcciones de las páginas web y las de correo se convierten en enlaces automáticamente.
  • Etiquetas HTML permitidas: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Saltos automáticos de líneas y de párrafos.

Plain text

  • No se permiten etiquetas HTML.
  • Las direcciones de las páginas web y las de correo se convierten en enlaces automáticamente.
  • Saltos automáticos de líneas y de párrafos.
CAPTCHA
Esta pregunta se realiza para comprobar que se trata de un humano y prevenir los accesos automatizados para publicar spam.