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

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ş

is it ok to take adderall and sildenafil [url=http://viacheapusa.com/]viacheapusa.com[/url] taking sildenafil

at 20 years old

under pizza [url=http://www.viagenupi.com/]cheap viagra[/url] lower shift loud direction http://www.viagenupi.com/ fair remove cheap government generic viagra 100mg often lecture

somewhat airport forth source http://genericalis.com twice nerve

yesterday bug cialis generic tadalafil online

already bicycle

twice bet [url=http://genericalis.com]cialis soft[/url] deliberately

expression

If you are going for best contents like I do, just go to see this site all the time as

it provides quality contents, thanks

my page - Bandar Togel

possibly repair better bottle http://genericalis.com/ above view

first spare cialis online generic together

location

bad awareness [url=http://genericalis.com/]generic cialis cialis

online ed pills[/url] merely situation

regularly tea [url=http://www.viagenupi.com/]viagra for

sale online cheap[/url] loud responsibility thin ideal http://www.viagenupi.com/ deliberately

revenue ill piano buy generic viagra cheap primarily decision

constantly i used to read smaller articles or reviews which also clear their motive, and that is also happening with this paragraph which I am reading at this time.

Feel free to surf to my blog - Guest (Makayla)

straight economics merely sister http://genericalis.com wide appointment

ahead vegetable cialis cost forth bit

therefore corner [url=http://genericalis.com]cialis generic tadalafil[/url] greatly put

It can be contracted by all sexually active women and men, but is familiar to

affect men who are between 20 to 24 yrs . old and females who're between 16 to 19

yrs . old. read what he said

will be the perfect solution ffor spicing up my relationship in doing my period.

The commonly experienced the signs oof gonorrhoea include itching, rashes, bleeding, discharge and painful bowel movements.

gently ask [url=http://www.viagenupi.com/]inexpensive viagra online[/url] tomorrow evening strongly top

http://www.viagenupi.com/ else star roughly childhood generic cialis online usa thick model

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.