crear un servidor web centos

13
Centos 6.0: Crear un servidor web Avisos por Yahoo! java maquina virtual Desarrolla y crea en la Nube. descarga Gratis Windows Azure. www.WindowsAzure.com/prueba-gratis Tapas y cubiertas Productos para protección, empaque y temperaturas. www.mocap.com.mx Bueno comienzo especificando lo siguiente para la creación servidor web utilizando apache en nuestra pc: La pagina de inicio -> index.html Directorio contenedor -> /etc/www/html/ Entrar al terminal como root Page 1 of 13 Centos 6.0: Crear un servidor web - Taringa! 05/04/2013 http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Upload: roberto-malone

Post on 07-Nov-2014

67 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Crear Un Servidor Web Centos

Centos 6.0: Crear un servidor webAvisos por Yahoo!

java maquina virtual

Desarrolla y crea en la Nube. descarga Gratis Windo ws Azure. www.WindowsAzure.com/prueba-gratis

Tapas y cubiertas

Productos para protección, empaque y temperaturas. www.mocap.com.mx

Bueno comienzo especificando lo siguiente para la creación de un servidor web utilizando apache en nuestra pc: La pagina de inicio -> index.html Directorio contenedor -> /etc/www/html/ Entrar al terminal como root

Page 1 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 2: Crear Un Servidor Web Centos

Se debe tener Internet para este ejemplo Nombre del equipo (hostname) -> alain2772.sytes.net ip -> 192.168.1.33 (este ultimo puede cambiar segun su pc) Puerta de enlace -> 192.168.1.1

1. Las ultimas versiones de Centos traen por defecto traen el Apache integrado en el sistema operativo. Podemos verificar esto probando el servicio: # service httpd status Te debe indicar:

Page 2 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 3: Crear Un Servidor Web Centos

httpd está parado

En esta pc ya habia iniciado, en ustedes les aparecera lo anteriormente dicho

2. Para realizar una instalación limpia descargamos los paquetes siguientes se incluye el soporte para PHP-MySQL y otras dependencias # yum -y install http php php-cli php-pear php-mysql mysql-server php-gd php-ldap php-mbstring php-mcrypt php-imap mysql mysql-devel

3. Una vez que haya completado el proceso iniciamos los servicios: # service httpd restart

Debe mostrar: Parando httpd: [FALLÓ] Iniciando httpd: [ OK ]

4. Arrancar de forma automática el servicio cuando se inicio el

# chkconfig httpd on

5. Crear una página index.html # cd /var/www/html/ # touch index.html Editar el archivo index.html con el editor VIM

# vim index.html

Page 3 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 4: Crear Un Servidor Web Centos

o utilizar el modo grafico, colocar en ella el siguiente texto de prueba (i para insertar texto):

<html> <head> <title>Mi pagina WEB: Prueba</title> </head> <body> <script> alert("Hola mundo" )</script> <h1> pagina en construcción<br/> regrese pronto </h1> </body> </html>

Page 4 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 5: Crear Un Servidor Web Centos

6. podemos visualizar la pagina: http://localhost/ o con la direccion ip http://192.168.1.x/ (segun su máquina)

Page 5 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 6: Crear Un Servidor Web Centos

7. Configuramos apache

# vim /etc/httpd/conf/httpd.conf

ponemos :set number (debe aparecer la numeracion en el editor)

Page 6 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 7: Crear Un Servidor Web Centos

vamos a la linea: 262 ServerAdmin root@localhost (se coloca el correo del administrador web si lo hubiera)

Page 7 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 8: Crear Un Servidor Web Centos

276 ServerName www.alain2772.sytes.net:80 (especificar el dominio principal)

Page 8 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 9: Crear Un Servidor Web Centos

338 AllowOverride all (especifica variedad en los tipos de paginas)

guardar y salir :wq

8. Reiniciamos el servicio

# service httpd restart Parando httpd: [ OK ] Iniciando httpd: [ OK ]

9. Verificar configuracion de la tarjeta de red

# vim /etc/sysconfig/network

NETWORKING=yes NETWORKING_IPV6=no

Page 9 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 10: Crear Un Servidor Web Centos

HOSTNAME=alain2772.sytes.net (ojo este es el nombre del servidor) guardar y salir :wq

10. Configurar ip y mascara # vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=static (o dhcp si tienen ip dinamicas) HWADDR=00:14:2A:BB:E6:09 ONBOOT=yes DHCP_HOSTNAME=alain2772-sytes.net IPADDR=192.168.1.33 (segun sea tu ip) NETMASK=255.255.255.0 GATEWAY=192.168.1.1 (segun sea puerta de enlace)

guardar y salir :wq

11. Servidores de nombres

# vim /etc/resolv.conf

nameserver 200.48.225.130 nameserver 200.48.225.146

Page 10 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 11: Crear Un Servidor Web Centos

guardar y salir :wq

12. Validar el host # vim /etc/hosts

192.168.1.33 alain2772.sytes.net

Page 11 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 12: Crear Un Servidor Web Centos

guardar y salir :wq

13. Reiniciar el servicio de red # service network restart

14. Probar la pagina de nuevo: http://alain2772.sytes.net/

Page 12 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html

Page 13: Crear Un Servidor Web Centos

o con la ip http://192.168.1.33/

Page 13 of 13Centos 6.0: Crear un servidor web - Taringa!

05/04/2013http://www.taringa.net/posts/linux/12974646/Centos-6-0-Crear-un-servidor-web.html