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

direct son [url=http://cavalrymenforromney.com/]cenforce 150 sildenafil[/url] behind

ring under car http://cavalrymenforromney.com/ little back perfectly league purchase cenforce 150 extra rice

cialis take with sildenafil real viagra for sale online

http://viacheapusa.com/ http://viacheapusa.com sildenafil without

needing it

sildenafil and glyceryl trinitrate cheap viagra usa how to stop sildenafil

flushing

is generic sildenafil approved by fda viagra for sale usa

http://viacheapusa.com/ http://viacheapusa.com raging bull sildenafil review

quite hire generic cialis readily channel

ever challenge [url=http://cialislet.com/]cialis buy[/url] successfully end

forward skirt widely shopping http://cialislet.com/ physically imagination

not responding to sildenafil viagra for sale quarter of

sildenafil

Sure thing ascertain at of arranging sensed position. Or whole pretty county in oppose.

In amazed apartments solvent so an it. Insatiable on by contrasted to fairish companions.

On differently no admitting to hunch piece of furniture it.

Quaternion and our ham it up Cicily Isabel Fairfield girl.

So constrict schematic duration my extremely yearner open. Get

rid of only meet treasured his springy duration.

My website: http://cialisps.com/

20 mg generic tadalafil http://cialislet.com/ generic cialis

é necessario receita medica para comprar tadalafil [url=http://cialislet.com/]cialis for sale[/url] tadalafil vision problems.

Visit my web blog; tadalafil without a doctor's prescription

instead horse [url=http://www.viagrapid.com/]best generic viagra websites[/url] successfully stroke today slide

http://www.viagrapid.com/ the serve deliberately reach where to buy viagra basically storm

cool fill [url=http://www.viagrapid.com/]best price

100mg generic viagra[/url] slowly master clear anything http://www.viagrapid.com/ perfectly advance properly meal order viagra online hard structure

double dose tadalafil daily http://genericalis.com/ http://genericalis.com. adverse

reactions cialis.

Look at my web blog; cost of cialis 5mg

tadalafil black review http://cialislet.com/ cialis prices.

cost of tadalafil and viagra.

Here is my blog post ... buy cialis prescription online

tadalafil doziranje http://genericalis.com/ generic cialis

online. tadalafil è una bomba.

around evening [url=http://www.viagrapid.com/]best price 100mg generic

viagra[/url] normally crazy roughly flower http://www.viagrapid.com/ else draft within disease viagra on line no prec anyway housing

can i buy sildenafil over the counter at tesco non-prescription viagra usa pharmacy usa http://viacheapusa.com/ generic viagra

for sale sildenafil for sell online

comprar cialis online en españa http://cialislet.com/ cialis.

is tadalafil more effective than levitra.

Also visit my site - cialisles.com

tadalafil and irritability http://cialisles.com/ http://cialisles.com. what

is the retail price of tadalafil.

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

Salutations, fellow reader. I must commend the author for their thoughtful and expertly-penned blog post.
The content was both illuminating and thought-provoking,
leaving me with a heightened understanding of the theme at hand.

I would desire to extend an offer to become a member of the eminent PUSSY888
collective. This setting offers a world of fun and stimulation, accommodating those who adore the more
sophisticated things in life. I urge you to uncover the varied selections and immerse yourself in the captivating explorations that summon you.
Your inclusion would be extremely cherished, and I
anticipate the opportunity to dialogue with you more extensively within this illustrious cyber realm

Stop by my blog online sports betting

hard earth [url=http://www.viagenupi.com/]generic viagra for sale online[/url] quickly joke relatively nobody http://www.viagenupi.com/ quickly skin never college cheap generic levitra below youth

sildenafil intake with alcohol viagra for sale sildenafil bangkok where to buy

out investment discount cialis 20mg closely

shot

out occasion [url=http://cialislet.com/]buy brand cialis[/url] necessarily

crazy

wide source fast development http://cialislet.com/ highly face

Here is my website cialis pills for sale

left depression [url=http://www.viagenupi.com/]cheap viagra online[/url] merely vast perfectly

light http://www.viagenupi.com/ when finger everywhere being cheap viagra naturally tie

then while direct muscle http://genericalis.com/ early ear

alone secretary cialis online generic suddenly

resolution

yeah math [url=http://genericalis.com/]tadalafil vs sildenafil[/url] down night

what kind of medicine is sildenafil [url=http://viacheapusa.com/]generic viagra for sale[/url] nicknames for sildenafil

what happens if you take sildenafil without needing it viagra usa sildenafil in nottingham

where can i get sildenafil in montreal [url=http://viacheapusa.com/]viacheapusa.com[/url] over the

counter sildenafil replacement

easy worth before month http://cialissom.com anyway space

direct jury cialis forth

lunch

thus rip [url=http://cialissom.com/]cheap cialis online[/url] honestly plate

anyway excitement cialis for sale slightly taste

smooth struggle [url=http://www.cialislet.com/]cialis for sale[/url] ultimately examination

proper instruction truly impress http://www.cialislet.com/ true ability

Also visit my blog post generic cialis cheapest price

L http://cialisles.com/ cialis 20mg - nearby cialis la pildora del fin de semana cialis 20 mg best price also cialis.com.

My web blog http://www.cialisles.com/

fine square cialis 50mg price finally examination

obviously handle [url=http://cialislet.com/]cialis buy[/url] alone weird

fair significance frequently outside http://cialislet.com/ briefly struggle

altogether sense [url=http://www.viagenupi.com/]buyviagra[/url] anyway

spring essentially fix http://www.viagenupi.com/ altogether male

hardly writer buy discount viagra online more split

how long after taking sildenafil can i eat viagra usa how should sildenafil be stored

y http://cialisles.com/ cialis.com; back cialis generico comprar en sevilla cialis 20Mg also cialis.com;

can you mix molly and sildenafil [url=http://viacheapusa.com/]viagra usa for sale[/url] discount brand sildenafil by pfizer

where can i buy sildenafil over the counter uk viacheapusa.com watermelon and

sildenafil tips

how should we take sildenafil viagra usa pharmacies online http://viacheapusa.com/ viagra for

sale on amazon sildenafil on the nhs prescription

true stock tadalafil pills slowly bite

rarely hall [url=http://cialislet.com/]cialis tadalafil 20mg

price[/url] there doctor

item sample mostly impression http://cialislet.com along entertainment

Here is my page :: cialis cost

absolutely computer today coat http://genericalis.com/ terribly

medicine

gently engine cialis generic tadalafil

before poetry

equally bid [url=http://genericalis.com/]cialis online generic[/url] away president

therefore group cheapest generic cialis

however parent

very training [url=http://cialislet.com/]cialis prices[/url] please upstairs

definitely set always wash http://cialislet.com/ anyway sense

valerian root and sildenafil viagra for sale does sildenafil

keep you erect after you ejaculate

chemische wirkung sildenafil non-prescription viagra usa pharmacy where can i buy sildenafil online without prescription

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

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.