provides software and services that enable enterprises
Live Chat 1-888-673-6564

Open Source Software Technical Articles

  • Home
  • Search
  • Contact Us
  • Products and Support
  • Services
  • Enterprise OSS Blog
  • Wazi Technical Blog
  • About Wazi
  • Attributions and Licensing
  • Supply Chain Compliance
  • How to Contribute
  • Contributors
  • Resources Library
  • Cloud Services
  • Partners
  • Customers
  • Community
  • Company
  • Careers
  • News and Events

Subscribe to Wazi by Email

Your email:


Enterprise Developer Support 24 x 7, Get a Support Quote Now!


click-here-to-chat-with-an-online-representative

download-oss-discovery

Latest Posts

  • A more colorful LibreOffice unveiled
  • Toward a more colorful LibreOffice
  • Flexible administration with Puppet's Facter and templates
  • Knock for OpenSSH
  • Get more out of phpMyAdmin
  • Image annotation in GIMP, Dia, and OpenOffice Draw
  • Solr, Drupal 7, and faceted search
  • Using FreeNAS' new full disk encryption for ZFS
  • Create distributed storage with Gluster
  • How to set up Solr 4.2 on Drupal 7 with Apache

Connect with Us!

Current Articles | RSS Feed RSS Feed

Apache HTTP Server FAQ

Posted by Technical Support Team on Thu, Feb 12, 2009
  
Email This Email Article  
Tweet  
  
The OpenLogic Technical Support Team fields lots of questions on Apache HTTP Server and over 500 other open source packages. They've distilled decades of experience and hundreds of Apache support issues down to the most common questions.

19a98812-f823-48dc-841e-bf029c63c6d7


General Questions
How do I connect Apache 2.2 HTTP Server with two or more remote Tomcat servers? Create a ReverseProxy from Apache to Tomcat. The best way is to use mod_proxy, mod_proxy_ajp and mod_proxy_balancer. To do this, perform the following steps.

1. When you build Apache from source add these flags:

--enable-proxy-ajp --enable-proxy-balancer --enable-proxy


2. Set up your cluster by doing this:

<Proxy balancer://tomcat_cluster>
BalancerMember ajp://192.168.1.1:8009
BalancerMember ajp://192.168.1.2:8009
BalancerMember ajp://192.168.1.3:8009
</Proxy>


3. Then, add the Rewrite rule that will Proxy the request to your cluster.

RewriteEngine On
RewriteRule ^/(.*)$ balancer://tomcat_cluster%{REQUEST_URI}
[P,QSA,L]


How do I change the log settings to add a cookie?

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"\"%{Cookie}i\"" combined
What is the best way to add the server-status module to an Apache server if you have a local monitoring engine like Nagios or Hyperic or Tivoli? Complete the following:

1. Add the the status_module to your apache configuration.

2. Then configure a virtualhost for server-status only access, edit x as follows:

<VirtualHost 127.0.0.1:80>
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from localhost
Allow from 127.0.0.1
</Location>
</VirtualHost>

Now you can access the Apache status screen using this url http://127.0.0.1/server-status ONLY from localhost.
How should I configure mod_deflate? Perform the following steps:

1. Enable the deflate_module in your Apache configuration file (httpd.conf) OR build mod_deflate into the Apache binary using the Apache source and the configure script.

2. If you have an rpm install, add this in the httpd.conf:
LoadModule deflate_module modules/mod_deflate.so


3. If you have compiled Apache from source, recompile with these flags:

/configure --prefix=/usr/local/ --enable-deflate


4. To enable mod_deflate in the httpd.conf add this:

<IfModule deflate_module>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/x-httpd-eruby
AddOutputFilterByType DEFLATE text/html
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
DeflateFilterNote Input instream
DeflateFilterNote Output outstream
DeflateFilterNote Ratio ratio
LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
CustomLog logs/deflate_log deflate
</IfModule>

This will enable mod deflate for most text and XML files on your site, and, for debugging only, you will have a log file in logs/deflate_log that you can look at to see how effective the module is.
How do I rotate my Apache log files? Like many log file rotation applications, logrotate:(http://iain.cx/src/logrotate/) can be managed as follows:

1. Stop the server.

2. Rename the old log file (date.logfile or logfile.1, for example).

3. Compress the archived log.

4. Restart the server.

The current running log file will have the same name as the original so it should not be necessary to change your monitoring routines.

We typically recommend using a general purpose utility like logrotate (which is actually a shell script) rather than a custom script, as this centralizes all the log file rotation on the server to a common set of configuration files. This way you can leverage the support of the logrotate community as well as other system administrators.
Why is my Apache file size limited to 1.5MB? You can use the maxPostSize option to adjust this setting. Do not set your maxPostSize value to "=0" as this would expose you to malicious code execution (i.e., crash the server). Additionally, the maxPostSize setting should be set to a real number.

For instance,
     maxPostSize=1600000
would allow 16 megabyte files.
Follow @openlogic
Follow @CloudSwing

This work is licensed under a Creative Commons Attribution 3.0 Unported License
Creative Commons License.Follow @openlogic
Follow @OSCloudServices

This work is licensed under a Creative Commons Attribution 3.0 Unported License
Creative Commons License.
Tags: Apache, Technical, Web Server, FAQ

Comments

Currently, there are no comments. Be the first to post one!
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics

Loading...
Error sending email
Email sent successfully

Email article
Email To : 
Your name : 
Message : (maximum 200 characters)
Home | Search | Contact Us | Products and Support | Services | Enterprise OSS Blog | Wazi Technical Blog | Resources Library | Cloud Services | Partners | Customers | Community | Company | Careers | News and Events
Products
OpenLogic Exchange (OLEX)
License Compliance Module
OSS Discovery
OSS Deep Discovery
OpenUpdate
Services
Open Source Support
CentOS Support
Scanning & Compliance
Open Source Training
Professional Services
Solutions
Support & Indemnification
Open Source Governance
Open Source Scanning
Open Source Provisioning
Consulting & Training
Contact Us
1-888-673-6564


© 2013 OpenLogic, Inc. All rights reserved.
Site Map  |  Privacy Policy