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

Your post is very helpful to get some effective tips to reduce weight properly. You have shared various nice photos of the same. I would like to thank you for sharing these tips. Surely I will try this at home. Keep updating more simple tips like this.  limited

online pharmacy reviews pharmacy online on line pharmacy

online mexico pharmacy best online pharmacies uk pharmacy online

online pharmacies without prescription buy medication without an rx online prescription free pharmacy

cialis coupon generic tadalafil 20mg cialis vs viagra

cialis coupon generic tadalafil 20mg cialis vs viagra

buy generic cialis online cheapest tadalafil cialis 10mg

buy generic cialis online cheapest tadalafil cialis 10mg

buy generic cialis online cheapest tadalafil cialis 10mg

buy generic cialis online cheapest tadalafil cialis 10mg

buy generic cialis online cheapest tadalafil cialis 10mg

buy viagra usa buy viagra pills online where buy viagra

online pharmacy canada best online pharmacy canadian pharmacy cialis

purchase sildenafil buy sildenafil online buy viagra pills

cialis without prescription interactions for lyrica acheter cialis

cialis from canada tadalafil tablets buy cialis now

cialis from canada tadalafil tablets buy cialis now

cialis from canada tadalafil tablets buy cialis now

cialis from canada tadalafil tablets buy cialis now

cialis from canada tadalafil tablets buy cialis now

best online pharmacy online pharmacy school walgreens online pharmacy

cialis from canada tadalafil tablets buy cialis now

viagra online buy viagra uk viagra online

buy viagra usa buy viagra buy viagra cheap

online pharmacy school canadian pharmacy review walmart pharmacy online

canadian pharmacy meds online canadian pharmacy online pharmacy

viagra without prescription viagra 50 mg natural viagra for men order viagra online roman viagra viagra

viagra online canadian pharmacy online pet pharmacy canadian pharmacy review

sildenafil 100 sildenafil online
male viagra
viagra walgreens hims ed
canadian pharmacy viagra
buy real viagra online generic viagra online for sale
http://viagraonlinemy.com/ - pfizer viagra

buy prinivil with no prescription generic prinivil buy prinivil uk

canadian online pharmacy non prescription online pharmacy reviews best online pharmacy

viagra price sildenafil citrate 100mg
buy viagra online
buy viagra sildenafil 50 mg
herbal viagra
cheap viagra over the counter ed pills
http://viagraonlinemy.com/ - female viagra pill

viagra side effects with alcohol guestbook.php?act=
http://viagrawithoutdoctorpres.net - viagra without doctor
viagra no perscription
viagra without a doctor prescription
- viagra tadalafil 20mg uk guestbook.pl
buy viagra online you cannot reply to topics in this forum

canadian pharmacies online online drugstore canadian online pharmacies

canada drugs no prescription needed canadian pharmacy online pharmacies

The misery that rite aid pharmacies allergies can create is something with viagra pro which unimaginable varieties of individuals know with. The reality is, however, that there are solutions available for those that seek them. Beginning using the ideas as well as tips in this item, and also you will certainly have the tools needed to dominate allergies, finally.
Screen plant pollen projections and plan as necessary. If you have accessibility to the internet, a number of the prominent weather forecasting websites have actually an area committed to allergic reaction forecasts including both air top quality and also plant pollen counts. On days when the matter is going to be high, maintain your home windows closed and limit your time outdoors.
Shower before bed, taking unique like wash your hair completely. basics Pollen, dirt, as well as what Google did to me various other irritants can obtain entraped on your skin and in your hair as you undergo your day. Take into consideration switching over to a night timetable if you generally bath in the early morning. This will certainly give you the possibility to eliminate these irritants before bed, permitting you to have a relaxed night's sleep.

cialis 20 mg buy real cialis order cialis online

cialis dosage the purple pill buy cialis

cialis dosage the purple pill buy cialis

cialis dosage the purple pill buy cialis

cialis dosage the purple pill buy cialis

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.