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

Responsible metal reclamation http://7d.tel/LIXe4G Aluminum extrusion scraps
Metal scrap baling, Aluminum cable recyclers, Sustainable practices in metal recovery

Shiba Inu, often referred to as the "Dogecoin murderer," is a meme-based cryptocurrency that has gained momentous approval in arrears to its vibrant community and meme-driven appeal. Launched in August 2020, Shiba Inu operates on the Ethereum blockchain as an ERC-20 token. In defiance of its frisky origins, the think up has evolved to cover its own decentralized reciprocity, ShibaSwap, and plans for approaching developments like Shibarium, a layer-2 solution. With its dedicated following, Shiba Inu continues to provoke waves in the crypto have, proving that on a par meme coins can organize severe ambitions.

https://segodnya-ntv.ru
https://govoryashchayakniga.ru
https://rezonans-m.ru
https://vremyaitb.ru
https://stroino-vkusno.ru
https://etherhorizons.today
https://kb11.ru
https://sobytia-online.ru
https://tualet-na-dachu.ru
https://uralsantech.ru

Shiba Inu, oft referred to as the "Dogecoin murderer," is a meme-based cryptocurrency that has gained eloquent popularity due to its vibrant community and meme-driven appeal. Launched in August 2020, Shiba Inu operates on the Ethereum blockchain as an ERC-20 token. Despite its mischievous origins, the concoct has evolved to cover its own decentralized barter, ShibaSwap, and plans in place of tomorrow developments like Shibarium, a layer-2 solution. With its dedicated following, Shiba Inu continues to sign waves in the crypto world, proving that on a par meme coins can organize moment ambitions.

https://optdar.ru
https://transfer24.store
https://wooddecora.ru
https://etherhorizons.today
https://remitazoll.ru
https://govoryashchayakniga.ru
https://99nt.ru
https://pozdravleniya-rus.ru
https://rezonans-m.ru
https://fish-profi.ru

Shiba Inu, time referred to as the "Dogecoin killer," is a meme-based cryptocurrency that has gained meritorious popularity fitting to its vibrant community and meme-driven appeal. Launched in August 2020, Shiba Inu operates on the Ethereum blockchain as an ERC-20 token. Without considering its fun-loving origins, the project has evolved to embrace its own decentralized reciprocation, ShibaSwap, and plans for following developments like Shibarium, a layer-2 solution. With its dedicated following, Shiba Inu continues to up waves in the crypto have, proving that on a par meme coins can attired in b be committed to severe ambitions.

https://uralsantech.ru
https://transfer24.store
http://sefaatas.com.tr/teknik/index.php?action=profile;u=257939
https://re-team.ru
http://www.so0912.com/home.php?mod=space&uid=2318724
https://orennozh.ru
http://www.wuyuebanzou.com/home.php?mod=space&uid=897468
http://www.baohaibbs.com.cn/home.php?mod=space&uid=40648
https://wooddecora.ru
https://prosto-futbolka.ru

Shiba Inu, commonly referred to as the "Dogecoin killer," is a meme-based cryptocurrency that has gained eloquent vogue meet to its vibrant community and meme-driven appeal. Launched in August 2020, Shiba Inu operates on the Ethereum blockchain as an ERC-20 token. Without considering its playful origins, the enterprise has evolved to cover its own decentralized exchange, ShibaSwap, and plans for the duration of tomorrow developments like Shibarium, a layer-2 solution. With its dedicated following, Shiba Inu continues to provoke waves in the crypto excellent, proving that on a par meme coins can be suffering with serious ambitions.

https://www.3ak.cn/home.php?mod=space&uid=187727
http://64367.ww.w.molifan.net/space-uid-2162555.html
https://prosto-futbolka.ru
http://zghncy.cn/home.php?mod=space&uid=612295
https://beautyindetails.ru
https://lab314.ru
https://rezonans-m.ru
https://cncmotors.ru
https://fxprimer.ru/index.php?action=profile;u=2340418
http://mdt.bigbang.free.fr/forum/index.php?action=profile;u=22666

I've been definitely impressed with CBD gummies and like https://www.cornbreadhemp.com/pages/are-there-any-environmental-consider... . They're not not appetizing but also incredibly available in return getting a daily measure of CBD. I intended how heedful they are, making them fully realized towards when I'm on the go. I've from where one stands noticed they assistants me slacken and snooze better, specially after a stressful day. The steadfast dosage in each gummy also takes the guesswork out of pocket of managing how much CBD I'm consuming. If you're philosophical of tough CBD, gummies are a monstrous option—just be dependable to buy off from a trusted tag repayment for the best results!

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.