{"id":43,"date":"2013-05-13T14:30:30","date_gmt":"2013-05-13T14:30:30","guid":{"rendered":"http:\/\/justmakeit.es\/?p=43"},"modified":"2013-05-13T14:30:30","modified_gmt":"2013-05-13T14:30:30","slug":"instalar-apache-2-4-en-amazon-web-services","status":"publish","type":"post","link":"http:\/\/justmakeit.es\/?p=43","title":{"rendered":"Instalar Apache 2.4 en Amazon Web Services"},"content":{"rendered":"<p>El objetivo es poder utilizar un \u00fanico dominio para acceder a distintas instalaciones de una misma o de varias aplicaciones web instaladas en diferentes m\u00e1quinas y servidores de aplicaciones; para ello hemos utilizado el\u00a0Apache httpd Web Server de tal manera que permita redirigir las peticiones a diferentes servidores de aplicaciones en funci\u00f3n de nuestras necesidades.<\/p>\n<p>La versi\u00f3n instalada de Apache httpd Web Server es la 2.4, ya que \u00e9sta incluye el m\u00f3dulo de proxy_html; si se quiere instalar la versi\u00f3n 2.2 de Apache, es necesario a\u00f1adir el m\u00f3dulo expresamente. Es necesario compilar el Apache con GCC e instalar el Apache Portable Runtime y una versi\u00f3n de Java 1.6 o superior.<\/p>\n<h3>Pasos en la instalaci\u00f3n:<\/h3>\n<h4 style=\"padding-left: 30px;\">Instalar JDK<\/h4>\n<pre style=\"padding-left: 60px;\">cd \/usr\/java\r\n.\/jdk-6u38-linux-x64.bin<\/pre>\n<h4 style=\"padding-left: 30px;\">Instalaci\u00f3n de APR (Apache Portable Runtime)<\/h4>\n<pre style=\"padding-left: 60px;\">sudo yum -y install arp apr-devel apr-util apr-util-devel pcre pcre-devel<\/pre>\n<h4 id=\"Apache-ConfigurarelproxydeApachepararedireccionamiento-Instalaci\u00f3ndeGCC(GNUCompilerCollection)\" style=\"padding-left: 30px;\">Instalaci\u00f3n de GCC (GNU Compiler Collection)<\/h4>\n<pre style=\"padding-left: 60px;\">sudo mkdir \/home\/ec2-user\/gcc\r\ncd \/home\/ec2-user\/gcc\r\nsudo yum install gcc<\/pre>\n<h4 id=\"Apache-ConfigurarelproxydeApachepararedireccionamiento-InstalarelApache\" style=\"padding-left: 30px;\">Instalar el Apache<\/h4>\n<pre style=\"padding-left: 60px;\">cd \/home\/ec2-user\/httpd****\r\n.\/configure\r\nsudo yum install make\r\nsudo make\r\nsudo make install<\/pre>\n<p style=\"padding-left: 60px;\">Apache httpd Web Server se instala por defecto en la ruta\u00a0\/usr\/local\/apache2\/<\/p>\n<h4 id=\"Apache-ConfigurarelproxydeApachepararedireccionamiento-ConfigurarelhttpdWebServer\" style=\"padding-left: 30px;\">Configurar el httpd Web Server<\/h4>\n<p style=\"padding-left: 60px;\">La configuraci\u00f3n del Apache se define en el fichero\u00a0\/usr\/local\/apache2\/conf\/httpd.conf. Antes de comenzar a realizar modificaciones es importante hacer una copia de este fichero para restaurarla en caso de ser necesario. Nuestro Apache recibe peticiones por el puerto 8009, que es uno de los que se habilitan en la pol\u00edtica de seguridad de Amazon para el Tomcat<\/p>\n<h4 style=\"padding-left: 30px;\">M\u00f3dulos que deben estar activos<\/h4>\n<h5 style=\"padding-left: 60px;\">Hemos activado todos los m\u00f3dulos excepto (configurar en funci\u00f3n de las necesidades)<\/h5>\n<pre style=\"padding-left: 90px;\"><span style=\"font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 18px;\">#LoadModule authz_host_module modules\/mod_authz_host.so<\/span>\r\n<span style=\"font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 18px;\">#LoadModule session_crypto_module modules\/mod_session_crypto.so<\/span><\/pre>\n<h5 style=\"padding-left: 60px;\">Es importante incluir estos m\u00f3dulos para poder configurar el proxy<\/h5>\n<pre style=\"padding-left: 90px;\"><span style=\"font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 18px;\">LoadFile \/usr\/lib64\/libxml2.so.2<\/span>\r\n<span style=\"font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 18px;\">LoadModule xml2enc_module modules\/mod_xml2enc.so<\/span>\r\n<span style=\"font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 18px;\">LoadModule proxy_html_module modules\/mod_proxy_html.so<\/span><\/pre>\n<h4 style=\"padding-left: 30px;\">Configuraci\u00f3n del fichero \/usr\/local\/apache2\/conf\/httpd.conf\/httpd.conf<\/h4>\n<pre>&lt;IfModule mod_proxy.c&gt;\r\n    ProxyPreserveHost On\r\n    ProxyHTMLEnable On\r\n\r\n    ProxyPass \/manager\/ http:\/\/1.2.3.4:8080\/manager\/\r\n    ProxyPass \/saas01\/a4j\/ http:\/\/1.2.3.4:8080\/myapp\/a4j\/\r\n    ProxyPass \/saas01\/ http:\/\/1.2.3.4:8080\/myapp\/\r\n    ProxyPass \/myapp\/ http:\/\/1.2.3.4:8080\/myapp\/\r\n    ProxyPass \/express\/ http:\/\/1.2.3.4:8080\/express\/\r\n    ProxyPassReverse \/saas01\/a4j\/ http:\/\/1.2.3.4:8080\/myapp\/a4j\/\r\n\r\n    ProxyPassReverse \/saas01\/a4j\/ http:\/\/1.2.3.4:8080\/myapp\/a4j\/\r\n    ProxyPassReverse \/saas01\/ http:\/\/1.2.3.4:8080\/myapp\/\r\n    ProxyPassReverse \/myapp\/ http:\/\/1.2.3.4:8080\/myapp\/\r\n    ProxyPassReverse \/express\/ http:\/\/1.2.3.4:8080\/express\/\r\n    ProxyHTMLURLMap http:\/\/1.2.3.4:8080\/myapp\/a4j\/ \/saas01\/a4j\/\r\n    ProxyHTMLURLMap http:\/\/1.2.3.4:8080\/myapp\/ \/saas01\/\r\n    ProxyHTMLURLMap http:\/\/1.2.3.4:8080\/express\/ \/express\/\r\n\r\n#peticiones AJAX\r\n&lt;Location \/saas01\/a4j\/&gt;\r\n    ProxyPassReverse http:\/\/1.2.3.4:8080\/saas01\/a4j\/\r\n    ProxyHTMLURLMap \/saas01\/a4j\/ \/saas01\/\r\n&lt;\/Location&gt;\r\n&lt;Location \/saas01\/&gt;\r\n    ProxyPassReverse \/myapp\/\r\n    ProxyHTMLURLMap \/myapp\/ \/saas01\/\r\n&lt;\/Location&gt;\r\n&lt;Location \/myapp\/a4j\/&gt;\r\n    ProxyPassReverse http:\/\/1.2.3.4:8080\/saas01\/a4j\/\r\n    ProxyHTMLURLMap \/saas01\/a4j\/ \/saas01\/a4j\/\r\n&lt;\/Location&gt;\r\n&lt;Location \/myapp\/&gt;\r\n    ProxyPassReverse http:\/\/1.2.3.4:8080\/saas01\/a4j\/\r\n    ProxyHTMLURLMap \/myapp\/a4j\/ \/saas01\/a4j\/\r\n&lt;\/Location&gt;\r\n&lt;Location \/express\/&gt;\r\n    ProxyPassReverse http:\/\/1.2.3.4:8080\/express\/\r\n    ProxyHTMLURLMap \/express\/ \/express\/\r\n&lt;\/Location&gt;\r\n&lt;\/IfModule&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>El objetivo es poder utilizar un \u00fanico dominio para acceder a distintas instalaciones de una misma o de varias aplicaciones &hellip; <a href=\"http:\/\/justmakeit.es\/?p=43\" class=\"btn btn-readmore\">Read More <span class=\"screen-reader-text\"> \u00abInstalar Apache 2.4 en Amazon Web Services\u00bb<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,14],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-aws","category-programacion"],"_links":{"self":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=43"}],"version-history":[{"count":34,"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":77,"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions\/77"}],"wp:attachment":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}