miércoles, 1 de julio de 2015

Instalar Apache en solaris/Linux para crear paginas web


Para crear paginas web dentro de un entorno Solaris o Linux (Redhat 6.4 Santiago) es necesario instalar y habilitar Apache, para ello hacemos lo siguiente:

***ESTE EJEMPLO SE REALIZO DESDE MAQUINAS VIRTUALES SOLARIS/REDHAT  Y LAS PAGINAS WEB SE ABRIERON DESDE LA PC FISICA CON WINDOWS***


Instalacion en Solaris

-->Agregar el paquete
pkgadd -d /cdrom/sol_10_113_x86/Solaris_10/Product  SUNWapchr SUNWapchu SUNWapchd

-->Deshabilitar el START y STOP del run control que se instala como parte del SUNWapchr package
Listar los scripts de runcontrol del Apache
Renombrar los scripts de runcontrol del Apache
Verificar que todos los scripts sean renombrados

ls -1 /etc/rc?.d/*apache

mv /etc/rc0.d/K16apache  /etc/rc0.d/k16apache
mv /etc/rc1.d/K16apache  /etc/rc1.d/k16apache
mv /etc/rc2.d/K16apache  /etc/rc2.d/k16apache
mv /etc/rc3.d/S50apache  /etc/rc3.d/s50apache
mv /etc/rcS.d/K16apache  /etc/rcS.d/k16apache


-->>copiar las carpetas con otro nombre

cp -p /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf

cp -p /etc/apache/httpd.conf-example /etc/apache/httpd.conf

-->>Para revisar estatus/iniciar/deshabilitar los servicios de http

svcs http
svcadm enable http
svcadm disable http


-->Agregar al /etc/hosts un nombre para la ip 127.0.0.1 y asi ingresar a firefox con ese nombre

127.0.0.1 lnxsgcpdev --por ejemplo

-->> o en su defecto

10.6.100.113     lnxsgcpdev.com      loghost


-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-


Instalacion en linux

-->Ingresar a la unidad de instalacion para ver los paquetes

[root@lnxsgcpdev Packages]# pwd
/mnt/cdrom/Packages


-->Agregar los siguientes paquetes

 rpm -ivh apr-1.3.9-5.el6_2.x86_64.rpm
 rpm -ivh apr-util-1.3.9-3.el6_0.1.x86_64.rpm
 rpm -ivh apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm
 rpm -ivh httpd-tools-2.2.15-26.el6.x86_64.rpm
 rpm -ivh httpd-2.2.15-26.el6.x86_64.rpm


-->Para habilitar los servicios de http

 chkconfig httpd on

 /etc/init.d/httpd start


 --->verificar el etc/hosts de linux y windows y agregar la linea del host 10.6.100.113     lnxsgcpdev.com      loghost

 [root@lnxsgcpdev Packages]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.6.100.113     lnxsgcpdev.com      loghost


En Windows


C:\Windows\System32\drivers\etc

Abrir el archivo hosts y editarlo



# localhost name resolution is handled within DNS itself.
# 127.0.0.1       localhost
# ::1             localhost
10.6.100.113        lnxsgcpdev.com


--->Ingresar desde el browser (Chrome,Firefox,etc)

http://lnxsgcpdev.com


--->Comentar las lineas del /etc/httpd/conf.d/welcome.conf

vi /etc/httpd/conf.d/welcome.conf

#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
#<LocationMatch "^/+$">
#    Options -Indexes
#    ErrorDocument 403 /error/noindex.html
#</LocationMatch>
#
~


--->Agregar en /var/www/html una pagina web

[root@lnxsgcpdev html]# ls -ltrh
total 60K
-rw-r--r-- 1 root root 56K Jul  1 10:06 ichii.jpg
-rw-r--r-- 1 root root 674 Jul  1 10:07 some.html

--->EntraR desde el browser indicando la pagina que acabamos de agregar anteponiendo una "/"


http://lnxsgcpdev.com/some.html








No hay comentarios:

Publicar un comentario