Optimizing Your NewsCloud Server

From Newscloud

Jump to: navigation, search

Installing mod_gzip compression

# Optional: If you want to optimize apache with gzip. Do the following
sudo apt-get install libapache-mod-gzip
# You'll need to add configuration settings to /etc/apache/httpd.conf
<IfModule mod_gzip.c>
mod_gzip_on                   Yes
mod_gzip_can_negotiate        Yes
mod_gzip_static_suffix        .gz
AddEncoding              gzip .gz
mod_gzip_update_static        No
mod_gzip_keep_workfiles       No
mod_gzip_minimum_file_size    500
mod_gzip_maximum_file_size    500000
mod_gzip_maximum_inmem_size   100000
mod_gzip_min_http             1000
mod_gzip_dechunk              Yes
mod_gzip_handle_methods        GET POST
mod_gzip_item_include         file       \.html$
mod_gzip_item_include         file       \.php$
mod_gzip_item_include         handler    ^cgi-script$
mod_gzip_item_include       mime       ^text/.*
mod_gzip_item_include       mime       ^application/x-httpd-php$
mod_gzip_item_include       mime       ^httpd/unix-directory$
mod_gzip_item_exclude         reqheader  "User-agent: Mozilla/4.0[678]"
mod_gzip_item_exclude       mime       ^image/.*
mod_gzip_item_exclude         file       \.js$
mod_gzip_item_exclude         file       \.css$
# Extended log format (for testing the compression effect)
LogFormat                     "%h %l %u %t \"%V %r\" %<s %b mod_gzip: %{mod_gzi$
# Create additional log file
CustomLog                     /var/log/mod_gzip.log common_with_mod_gzip_info2
# Volume computation of the delivered files inside the Apache access_log:
# count HTTP header size (in bytes) as part of total output size
mod_gzip_add_header_count     Yes
# sending a 'Vary' HTTP header
mod_gzip_send_vary            On
</IfModule>
Personal tools