Instalación de servidor web Apache2 sobre Linux Ubuntu 12.04
sudo apt-get updatesudo apt-get upgrade
sudo apt-get install apache2
http://localhost
It works!
/var/www
La página web por defecto es:
index.html
sudo service apache2 status
sudo service apache2 stop
sudo service apache2 start
sudo service apache2 restart
sudo /etc/init.d/apache2 status
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 restart
http://www.youtube.com/watch?
Instalación automática desde consola.
http://www.youtube.com/watch?
Instalación manual desde consola.
http://www.youtube.com/watch?
http://www.youtube.com/watch?
http://www.youtube.com/watch?
http://www.youtube.com/watch?
http://www.youtube.com/user/lpguerrero#p/c/8A5CF75BA846684D/5/CEkVjXuzdWw
http://www.youtube.com/watch?v=CssviWVbtOw&feature=mfu_in_order&list=UL
http://www.youtube.com/watch?v=usAS9OaHmJM
http://www.youtube.com/watch?v=72T6xh6yQsM
http://www.youtube.com/watch?v=_uxM-Gl41y0&feature=related
http://www.youtube.com/watch?v=p1kDRqd_JHg&feature=related
http://www.youtube.com/watch?v=VxBHT_cwlA0&feature=fvst
http://www.youtube.com/user/lpguerrero
http://www.youtube.com/watch?
http://www.youtube.com/watch?
http://www.youtube.com/watch?
http://www.youtube.com/watch?
http://www.youtube.com/watch?
http://www.youtube.com/watch?
http://www.youtube.com/user/
---------------------------------------------------------------------------------------------------------------------------------------------------------
sudo apt-get install apache2
http://localhost
It works!
cd /etc/apache2/mods-enabled
ls userdir*
ls: no se puede acceder a userdir*: No existe el fichero o el directorio
http://localhost
It works!
cd /etc/apache2/mods-enabled
ls userdir*
ls: no se puede acceder a userdir*: No existe el fichero o el directorio
Dos directorios:
- Los módulos disponibles (mods-available)
- Los módulos activados(mods-enabled) con enlace a los disponibles
sudo ln -s /etc/apache2/mods-available/userdir* .
ls userdir*
userdir.conf userdir.load
ls -la userdir*
lrwxrwxrwx 1 root root 40 nov 23 22:31 userdir.conf -> /etc/apache2/mods-available/userdir.conf
lrwxrwxrwx 1 root root 40 nov 23 22:31 userdir.load -> /etc/apache2/mods-available/userdir.load
ls userdir*
userdir.conf userdir.load
ls -la userdir*
lrwxrwxrwx 1 root root 40 nov 23 22:31 userdir.conf -> /etc/apache2/mods-available/
lrwxrwxrwx 1 root root 40 nov 23 22:31 userdir.load -> /etc/apache2/mods-available/
lrwxrwxrwx 1 root root 40 nov 23 22:31 userdir.conf -> /etc/apache2/mods-available/userdir.conf
lrwxrwxrwx 1 root root 40 nov 23 22:31 userdir.load -> /etc/apache2/mods-available/userdir.load
mkdir public_html
editar index.html dentro de /home/mariano/public_html
<html>
<body>
<h1>Usuario mariano en ai4pc1??</h1>
<h1> /home/mariano/public_html</h1>
<h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body>
</html>
sudo /etc/init.d/apache2 restart
En el navegador
http://localhost/~mariano/
lrwxrwxrwx 1 root root 40 nov 23 22:31 userdir.load -> /etc/apache2/mods-available/
mkdir public_html
editar index.html dentro de /home/mariano/public_html
<html>
<body>
<h1>Usuario mariano en ai4pc1??</h1>
<h1> /home/mariano/public_html</h1>
<h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
</body>
</html>
sudo /etc/init.d/apache2 restart
En el navegador
http://localhost/~mariano/
--------------------------------------------------------------------------------------------------------------------------------------------------------
Con virgulilla ~ funciona
http://localhost/~mariano/
Sin virgulilla ~ NO funciona
http://localhost/mariano/
http://localhost/~mariano/
Sin virgulilla ~ NO funciona
http://localhost/mariano/
Se crea el alias para que funciones en ambos casos.
sudo gedit /etc/apache2/mods-available/alias.conf
<IfModule alias_module>
#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So "/icons" isn't aliased in this
# example, only "/icons/". If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
# We include the /icons/ alias for FancyIndexed directory listings. If
# you do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/usr/share/apache2/icons/"
<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /mariano/ "/home/mariano/public_html/"
<Directory "/home/mariano/public_html">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</IfModule>
En terminal o consola:
sudo /etc/init.d/apache2 restart
En el navegador :
http://localhost/mariano/
http://localhost/~mariano
<IfModule alias_module>
#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So "/icons" isn't aliased in this
# example, only "/icons/". If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
# We include the /icons/ alias for FancyIndexed directory listings. If
# you do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/usr/share/apache2/icons/"
<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /mariano/ "/home/mariano/public_html/"
<Directory "/home/mariano/public_html">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</IfModule>
En terminal o consola:
sudo /etc/init.d/apache2 restart
En el navegador :
http://localhost/mariano/
http://localhost/~mariano
----------------------------------------------------------------------------------------------------------------------------------------------------------
Userdir
Cada usuario tiene su sitio web en su carpeta personal public_html
Ir a la carpeta de configuración de Apache
cd /etc/apache2
profe02@profe02-laptop:/etc/apache2$ ls
apache2.conf envvars magic mods-enabled sites-available
conf.d httpd.conf mods-available ports.conf sites-enabled
apache2.conf es el archivo de configuración de apache,
conf.d es un directorio con configuraciones también,
httpd.conf para que el administrador del sistema agregue sus configuraciones.
mods-enabled y mods-available contienen los módulos disponibles y los que se cargan (Estas dos carpetas son con las que vamos a trabajar),
sites-available y sites-enabled, sitios disponibles y activados, cumplen una función similar a las carpetas de los mods o modulos,
envvars son variables de entorno
ports.conf es de puertos
cd /etc/apache2/mods-available
ls userdir*
userdir.conf userdir.load
estos archivos del módulo están disponibles pero no activados, para activarlos debemos meternos dentro del directorio mods-enabled y crear enlaces simbólicos hacia estos dos archivos.
cd /etc/apache2/mods-enabled
profe02@profe02-laptop:/etc/apache2/mods-enabled$ ls userdir*
ls: no se puede acceder a userdir*: No existe el archivo o directorio
crea un enlace simbólico (ln -s)
(¡atención después del asterisco: espacio punto (directorio actual) !)
profe02@profe02-laptop:/etc/apache2/mods-enabled$ sudo ln -s /etc/apache2/mods-available/userdir* .
profe02@profe02-laptop:/etc/apache2/mods-enabled$ ls userdir*
userdir.conf userdir.load
ls -la userdir*
sudo /etc/init.d/apache2 restart
En el directorio home o carpeta de usuario y creamos una carpeta llamada public_html, es ahí donde guardamos nuestros archivos web, vamos a crear una página sencilla con el nombre de index.html en esa carpeta.
Lo siguiente es abrir nuestro navegador de internet y en la barra de direcciones poner lo siguiente: http://localhost/~profe02/
el carácter virgulilla ~ indica la ruta de la carpeta home
Cada usuario tiene su sitio web en su carpeta personal public_html
Ir a la carpeta de configuración de Apache
cd /etc/apache2
profe02@profe02-laptop:/etc/
apache2.conf envvars magic mods-enabled sites-available
conf.d httpd.conf mods-available ports.conf sites-enabled
apache2.conf es el archivo de configuración de apache,
conf.d es un directorio con configuraciones también,
httpd.conf para que el administrador del sistema agregue sus configuraciones.
mods-enabled y mods-available contienen los módulos disponibles y los que se cargan (Estas dos carpetas son con las que vamos a trabajar),
sites-available y sites-enabled, sitios disponibles y activados, cumplen una función similar a las carpetas de los mods o modulos,
envvars son variables de entorno
ports.conf es de puertos
cd /etc/apache2/mods-available
ls userdir*
userdir.conf userdir.load
estos archivos del módulo están disponibles pero no activados, para activarlos debemos meternos dentro del directorio mods-enabled y crear enlaces simbólicos hacia estos dos archivos.
cd /etc/apache2/mods-enabled
ls: no se puede acceder a userdir*: No existe el archivo o directorio
crea un enlace simbólico (ln -s)
profe02@profe02-laptop:/etc/
profe02@profe02-laptop:/etc/
userdir.conf userdir.load
ls -la userdir*
sudo /etc/init.d/apache2 restart
En el directorio home o carpeta de usuario y creamos una carpeta llamada public_html, es ahí donde guardamos nuestros archivos web, vamos a crear una página sencilla con el nombre de index.html en esa carpeta.
Lo siguiente es abrir nuestro navegador de internet y en la barra de direcciones poner lo siguiente: http://localhost/~profe02/
No hay comentarios:
Publicar un comentario