Loading...
 

Changing the web server configuration

Generally, you shouldn't need to change your httpd.conf, but if you do, this page is to share tips & tricks about Tiki-related configs.

Note also that some hosting services do not allow you to change the httpd.conf file, because it may be shared between different accounts running on the same web server. In those cases, some of the configuratesions suggested below can still be done by putting them in the .htaccess file.

Exploiting caches for static resource files

There are many files on your site that never change. Things like image files for icons and logos, CSS files for styles, javascript, etc. Yet, if your web server is not configured properly, each request made by a user will redownload them everytime, without looking in any cache.

On some slow servers (or heavily shared server farms like BlueHost), this can add several seconds to the loading time of every page. To avoid this, you must set an expiry date on files which are of a static type. On this type of server, this technique has been known to shave off a couple of seconds from the loading time of pages.

For example:

Copy to clipboard
ExpiresActive On # dont cache html as people wont get page updates: # ExpiresByType text/html "access plus 1 month" ExpiresByType text/css "access plus 6 month" ExpiresByType text/javascript "access plus 6 month" ExpiresByType image/gif "access plus 6 month" ExpiresByType image/jpeg "access plus 6 month" ExpiresByType image/png "access plus 6 month" Header append Cache-Control "public"

Dealing with scripts that take too long to run

Copy to clipboard
# time out connections earlier, 300 is too much Timeout 150 # clients may keep alive existing connections KeepAlive On MaxKeepAliveRequests 120 KeepAliveTimeout 15 !Starting more than one children # switch off hostname lookups, that needs some time HostnameLookups Off MinSpareServers 6 MaxSpareServers 8 StartServers 10 # 10 clients should be enough, but for peaks 50 might be good. # depends on your memory, 50 works for 2GB memory MaxClients 50 # dont set this to a value too low: MaxRequestsPerChild 1500


Virtual Host Settings


Limit connections from one ip to a given number.

Homepage of mod_limitipconn

Copy to clipboard
Customlog /var/log/nameofvirtualhost-access-denied.log combined env=LIMITIP MaxConnPerIP 10 NoIPLimit img/*

List Slides