Recent Notes

Displaying keyword search results 1 - 10
Created by nogeek on March 13, 2012 11:53:49    Last update: March 13, 2012 11:53:49
A. To configure Apache httpd to proxy Tomcat using HTTP: Load Apache httpd modules ( httpd.conf ): LoadModule proxy_module /usr/lib/apache2/modules/m... Configure Apache httpd proxy: <VirtualHost *:80> ServerAdmin webmaster@my... Configure Tomcat HTTP connector with appropriate proxyName and proxyPort : <Connector port="8080" protocol="HTTP/1.1"... Note: context path must be the same for httpd and Tomcat. B. To configure Apache httpd to proxy Tomcat using AJP: Load Apache httpd modules ( httpd.conf ): LoadModule proxy_module /usr/lib/apache2/modules/m... Configure Apache httpd proxy: <VirtualHost *:80> ServerAdmin webmaster@my... Configure Tomcat AJP connector: <Connector port="8009" protocol="AJP/1.3" redirect... You can try this if context path must be changed between Tomcat and httpd: <VirtualHost *:80> ServerAdmin webmaster@my... But this may not work in case the servlet context path is written in the HTML content. ProxyPassReverse only...
Created by Fang on January 31, 2012 15:40:34    Last update: January 31, 2012 15:41:28
This is a simple Hello World application with Spring 3 MVC. Like the default Apache HTTPd welcome page, it displays " It works! " when successfully deployed. The sole purpose is to show the minimum elements needed to setup Spring 3 MVC. I use Maven since it's so much easier than downloading the dependencies manually. Directory layout: ./src ./src/main ./src/main/webapp ./src/... pom.xml : <?xml version="1.0" encoding="UTF-8"?> <project... WEB-INF/web.xml : <?xml version="1.0" encoding="UTF-8"?> <web-app... WEB-INF/applicationContext.xml (empty, but needed): <?xml version="1.0" encoding="UTF-8"?> <beans x... WEB-INF/spring-servlet.xml : <?xml version="1.0" encoding="UTF-8"?> <beans x... WEB-INF/jsp/home.jsp : <!DOCTYPE html> <html> <head> <title>H... Build with: mvn clean package The resulting webapp is target/springmvc.war .
Created by Dr. Xi on January 04, 2012 16:28:27    Last update: January 04, 2012 16:28:27
Steps to enable SSI (Server Side Include) in Apache HTTPD: Enable mod_include . In httpd.conf , update directive: AllowOverride Options FileInfo In .htaccess : Options +Includes AddType text/html .shtml A... Files with extension .shtml will be processed with SSI. You may want to enable mod_cgi to include output from CGI programs: <!--#include virtual="/cgi-bin/counter.pl" --> To control caching : Use the XBitHack Full configuration. This tells Apache to determine the last modified date by looking only at the date of the originally requested file, ignoring the modification date of any included files. Use the directives provided by mod_expires to set an explicit expiration time on your files, thereby letting browsers and proxies know that it is acceptable to cache them.
Created by voodoo on April 14, 2011 13:16:18    Last update: April 14, 2011 13:17:48
From Fedora Project wiki : A security context , or security label , is the mechanism used by SELinux to classify resources, such as processes and files, on a SELinux-enabled system. This context allows SELinux to enforce rules for how and by whom a given resource should be accessed. A security context is typically shown as a string consisting of three or four words. Each word specifies a different component of the security context, namely, the user , role , type , and level of that file or process . Each word is separated by a colon. Use the -Z switch to display security context info. Display security context for Apache files: $ ls -Z /var/www/ drwxr-xr-x. root root system_... Display security for files under...
Created by voodoo on April 13, 2011 13:47:34    Last update: April 13, 2011 13:49:20
You get "permission denied" error from Apache HTTPD for a page. And you checked file/directory permissions (the whole directory path, not just the file) and everything in httpd.conf . If everything seemed right, then SELinux may be blocking the access. Open /var/log/httpd/error_log , you may see a line like this: [Wed Apr 13 15:50:35 2011] [notice] SELinux poli... These are the steps to fix: If the directory resides in a user home directory: # setsebool -P httpd_read_user_content 1 Create a policy package from the audit log: # grep httpd /var/log/audit/audit.log | audit2allo... Apply the policy package just created # semodule -i mypol.pp Restart apache httpd: # apachectl restart
Created by nogeek on March 09, 2011 09:10:55    Last update: March 09, 2011 09:10:55
Add three apache modules: mod_proxy, mod_proxy_ajp and mod_proxy_balancer. Add (uncomment) this in httpd.conf : LoadModule proxy_module modules/mod_proxy.so Lo... Assuming the JBoss servers are running AJP on port 8009 on host1 and host2, add these lines to VirtualHost : ProxyPass /appRoot balancer://appcluster/ stickyse...
Created by magnum on July 08, 2010 21:27:56    Last update: July 08, 2010 21:27:56
To redirect all HTTP traffic to HTTPS, add the Redirect directive to the HTTP VirtualHost: <VirtualHost _default_:80> Redirect permane... The general syntax is: Redirect [status] URL-path URL By the Apache httpd doc , any request beginning with URL-Path will return a redirect request to the client at the location of the target URL . However, the proxy directives does not seem to respect this rule. So it's best to place the proxy directives inside the HTTPS VirtualHost: <VirtualHost _default_:443> . . . Prox...
Created by magnum on July 01, 2010 15:38:49    Last update: July 01, 2010 15:39:53
From Apache HTTPD docs: When acting in a reverse-proxy mode (using the ProxyPass directive, for example), mod_proxy_http adds several request headers in order to pass information to the origin server. These headers are: X-Forwarded-For The IP address of the client. X-Forwarded-Host The original host requested by the client in the Host HTTP request header. X-Forwarded-Server The hostname of the proxy server. Be careful when using these headers on the origin server, since they will contain more than one (comma-separated) value if the original request already contained one of these headers. For example, you can use %{X-Forwarded-For}i in the log format string of the origin server to log the original clients IP address, but you may get more than one address if the request passes through...
Created by magnum on June 23, 2010 22:24:01    Last update: June 23, 2010 22:24:01
Required: Apache web server mod_proxy_html proxy_html.conf: # Load mod_proxy_html required SOs LoadFile /us... httod.conf # load proxy_html conf Include conf/extra/proxy...
Created by magnum on June 23, 2010 20:42:12    Last update: June 23, 2010 20:52:33
Compile mod_proxy_html from source code. Prerequisite: Apache httpd installed on system with header files. Command: # /usr/local/apache2/bin/apxs -i -c -I/usr/local/i... Output: /usr/local/apache2/build/libtool --silent --mode=c...
Previous  1 2 Next