We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

need for speed | Forum

Topic location: Forum home » Support » General Questions
tammy harris
tammy harris Aug 23 '14
i have read lots on slow servers and have fixed a couple of oxwall users servers 
its very simple in whm panel or if you dont have whm ask your hosting to put this in for you 
apache configeration. includes editor/pre virtualhost includes

add this to make your server work less to achieve more

# Cache Control Settings for one hour cache

<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">

Header set Cache-Control "max-age=3600, public"

</FilesMatch>


<FilesMatch ".(xml|txt)$">

Header set Cache-Control "max-age=3600, public, must-revalidate"

</FilesMatch>


<FilesMatch ".(html|htm)$">

Header set Cache-Control "max-age=3600, must-revalidate"

</FilesMatch>


# Mod Deflate performs data compression

<IfModule mod_deflate.c>

<FilesMatch ".(js|css|html|php|xml|jpg|png|gif)$">

SetOutputFilter DEFLATE

BrowserMatch ^Mozilla/4 gzip-only-text/html

BrowserMatch ^Mozilla/4.0[678] no-gzip

BrowserMatch bMSIE no-gzip

</FilesMatch>


</IfModule>

<IfModule mod_expires.c>


    # Enable expirations

    ExpiresActive On


    # Default directive

    ExpiresDefault "access plus 1 month"


    # My favicon

    ExpiresByType image/x-icon "access plus 1 year”


    # Images

    ExpiresByType image/gif "access plus 1 month"

    ExpiresByType image/png "access plus 1 month"

    ExpiresByType image/jpg "access plus 1 month"

    ExpiresByType image/jpeg "access plus 1 month"


    # CSS

    ExpiresByType text/css "access 1 month”


    # Javascript

    ExpiresByType application/javascript "access plus 1 year"


</IfModule>

add this to stop hungry bad bots from attacking your server 
one server went from 100% cpu usage from bots trying to get in the server down to 23% in 10 seconds after adding this 

add this to htpd,config file may work in above file not shove never tryed it 

SetEnvIfNoCase User-Agent "^Wget" bad_bot

SetEnvIfNoCase User-Agent "^EmailSiphon" bad_bot

SetEnvIfNoCase User-Agent "^EmailWolf" bad_bot

SetEnvIfNoCase User-Agent "^libwww-perl" bad_bot

 

<Location />

 Order allow,deny

 Allow from all

 Deny from env=bad_bot

</Location>


them restart apache 

The Forum post is edited by tammy harris Aug 23 '14
tammy harris
tammy harris Aug 23 '14
the modules mod expires mod deflate etc ask host to recompile apche to get them working 
tammy harris
tammy harris Aug 25 '14
a good guide on htacess to stop bad bots
 http://corz.org/server/tricks/htaccess2.php

anti hammer 
http://corz.org/server/tools/anti-hammer/