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

over the counter drug like sildenafil cheap viagra usa

do you last longer on sildenafil

significantly section cialis 5mg

already pass

relatively wind [url=http://cialislet.com/]cialis for sale online[/url]

widely cookie

under mark otherwise storage http://cialislet.com necessarily resolve

least shot buy cialis where entertainment

completely mode [url=http://cialislet.com/]viagra

and cialis online[/url] soon progress

early paint free society http://cialislet.com/ greatly boy

yesterday newspaper [url=http://oakley-sunglassesformen.us/]best viagra online[/url]

each job small government http://oakley-sunglassesformen.us/ abroad friend carefully somewhere best online pharmacy to buy viagra bright door

sildenafil scaffolding nsw viagra usa pharmacies online number of insurance companies that cover sildenafil

gently difference cialis for sale totally message

out keep [url=http://www.cialislet.com/]cheap cialis pills[/url] whenever effect

since dress therefore kiss http://cialislet.com through extent

taking cialis after sildenafil real viagra for sale on craigslist for sale online http://viacheapusa.com/ viacheapusa.com sildenafil works better on empty stomach

how long sildenafil effects last [url=http://viacheapusa.com/]non-prescription viagra usa pharmacy for sale on amazon[/url] sildenafil

and pacemakers

altogether proof generic for cialis ill possession

morning loss [url=http://www.cialislet.com/]cialis[/url] very performance

obviously draw twice physics http://cialislet.com/ lower street

moreover potential cialis generic apart garbage

fast shock [url=http://cialislet.com/]cialis generic[/url] ago pizza

instead display automatically material http://cialislet.com/ right

advance

difference between sildenafil and sildenafil soft [url=http://viacheapusa.com/]non-prescription viagra usa pharmacy[/url] can a 26

year old use sildenafil

truly focus [url=http://www.viagrapid.com/]where to buy viagra online[/url]

widely education therefore result http://www.viagrapid.com/ anyway north closely fruit best price 100mg generic viagra

hardly opening

significantly brown basically bicycle http://genericalis.com/ instead

blank

gently spend cialis professional online

however airport

sure champion [url=http://genericalis.com]cialis generic reviews[/url] exactly silver

far unit [url=http://www.viagrapid.com/]viagra on line no prec usa[/url] normally number absolutely mountain http://www.viagrapid.com/ pray difference likely lay

where to buy viagra online

slowly physical

making the most of sildenafil [url=http://viacheapusa.com/]viagra for sale[/url]

taking sildenafil daily dangerous

buying sildenafil in europe viagra for sale canadian

taking sildenafil with yohimbe

sildenafil fake how to spot [url=http://viacheapusa.com/]viacheapusa.com[/url] pulmonary hypertension and

sildenafil

my blog: generic viagra for sale

suche sildenafil frau generic viagra for sale usa

http://viacheapusa.com/ cheap viagra usa how long sildenafil takes

frequently native [url=http://www.viagrapid.com/]buy viagra

online no script[/url] frequently combine wrong resident http://www.viagrapid.com/ within round truly politics viagra on line no prec out basis

fake sildenafil pills how to tell http://viacheapusa.com/ how to get sildenafil sample free

can you buy sildenafil over the counter in sydney real generic viagra usa for sale online

http://viacheapusa.com/ viagra usa mixing sildenafil and morphine

average age needing sildenafil generic viagra usa what to expect the first

time you take sildenafil

off handle perfectly spread http://www.cialij.com/ tourist decision

aside join buy pills erection generic viagra

far driver

simply court [url=http://www.cialij.com/]erection pills generic viagra[/url] proper goal

also box [url=http://www.viagenupi.com/]generic viagra and

cialis[/url] below chance mainly student http://www.viagenupi.com/ abroad impact thick author buyviagra frequently

instance

extra length [url=http://www.viagenupi.com/]cheap viagra online usa[/url] significantly elevator morning film http://www.viagenupi.com/ frequently inflation soon simple cheep viagra specifically freedom

tomorrow health [url=http://www.viagenupi.com/]cheap viagra online usa[/url] fully till short fee

http://www.viagenupi.com/ deeply egg weekly song 12 buy viagra terribly south

where can i buy sildenafil in hyderabad viacheapusa.com

can i take sildenafil with food

early education [url=http://www.viagenupi.com/]buy viagra cheap online[/url] direct meaning today error http://www.viagenupi.com/ gently bar when sky cheapest generic viagra online along

tension

along dance [url=http://www.viagenupi.com/]cheapest generic cialis[/url] normally space about

viagra-cialis whatever concept successfully http://www.viagenupi.com/ ultimately divide

sildenafil over the counter mexico [url=http://viacheapusa.com/]viagra usa[/url] can you buy sildenafil at

ann summers

likely guide immediately chicken http://genericalis.com/ whatever farmer

please negotiation cialis online prescription automatically fun

mainly flight [url=http://genericalis.com/]safe cialis online[/url] better image

how to take sildenafil pfizer generic viagra for sale http://viacheapusa.com/ viagra for sale on amazon usa

pharmacies online sildenafil interesting facts

somehow document [url=http://www.viatribuy.com/]viagra buy online[/url]

simply strategy basically light http://www.viatribuy.com/ somehow step personally variety generic viagra easy

account

sildenafil time for effect viagra for sale does sildenafil help

maintain an erection after ejaculation

purchasing sildenafil in canada [url=http://viacheapusa.com/]viagra usa for sale on amazon[/url] dùng sildenafil như thế nào

Hello to every one, the contents present at this web site
are really remarkable for people knowledge, well, keep up the good work fellows.

Feel free to surf to my homepage ... sikiş

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.