USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

Optimize and secure apache

 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Administration and Security
View previous topic :: View next topic  
Author Message
sysconfig
New Member


Joined: 12 Oct 2025
Posts: 12

PostPosted: Thu Oct 12, 2025 1:00 pm    Post subject: Optimize and secure apache Reply with quote

Please find the wonderful how to on optimization and securing apache server:

Refrenced: http://forums.linuxwebadmin.info//topic,37.0.html

Apache parameter to be considered:

Timeout, this timeout is the amount of time apache will wait between successful writes of data before closing the connection.

Quote
Timeout
Apache Default 1200
Recommend 15

KeepAlive, this option if set to on will use the same apache child to fetch data for a website such as images, therefore there is no need to call upon another apache child for each image thus increasing site loading speed.

Quote
KeepAlive
Apache Default On
Recommend On

maxKeepAliveRequests, this is the number of items that may be requested by an apache child on KeepAlive, if you have a page with many images then setting this too low will case problems.

Quote
maxKeepAliveRequests
Apache Default 100
Recommend 64
KeepAliveTimeout, this is the amount of time an Apache child doing a KeepAlive request will sit doing nothing, if set low you will notice allot more spare Apache children available for requests.

Quote
KeepAliveTimeout
Apache Default 15
Recommend 1
MinSpareServers, this is the min amount of idle Apache child processes, if all your children are doing something then Apache will continue to spawn children until there are the amount you set in MinSpareServers free for requests.

Quote
MinSpareServers
Apache Default 5
Recommend 10
MaxSpareServers, this is the max amount of idle Apache child processes allowed, if there is more than this amount of apache children idle they will be killed off.

Quote
MaxSpareServers
Apache Default 10
Recommend 15

StartServers, the number of Apache child processes to be started when the Apache server is restarted.

Quote
StartServers
Apache Default 5
Recommend 15
MaxClients, this is the number of Apache child processes that will be allowed, if your apache constantly causes the server to start using swap then lower this number, I recommend for most servers to set this at 8 divided by amount of memory in MB.
Quote

MaxClients
Apache Default 256
Recommend 8/Ram in MB (e.g... 8/1024 = 128Max Clients for 1GB ram)

MaxRequestsPerChild, I find this to be one of the most sensitive Apache settings, to low and you will kill your server with load, to high and you can get memory errors... Unlike some people I recommend never setting this to 0, or a number above 1000, some servers with low amounts of ram may benefit from this being set low while others who have got high load but lots of ram may benefit from having this high. This option is the number of requests an Apache child will be allowed before it is killed off and another one takes its place.
Quote
MaxRequestsPerChild
Apache Default 0
Recommend 64

Ref: http://httpd.apache.org/docs/1.3/mod/core.html
Ref: WebhostignTalk.com

Quote
HostNameLookups Off

Turning HostNameLookups off provides better performance, as this ensures Apache will not try to resolve any IP addresses. It also slightly decreases the possibility of spoofing attacks.

Quote
ServerTokens Prod
ServerSignature Off

By default Apache will give out information about its version and configuration. Using ServerTokens Prod will only give out the string "Apache"; the less information someone can get about your server, the more secure it is likely to be. In versions of Apache prior to 2.0.44, ServerSignature could leak the version of your server, so we turn that off. In more recent versions this is controlled by the ServerTokens directive.

Thanks,

Thx


Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
crouse
Site Admin


Joined: 17 Apr 2025
Posts: 8985
Location: Iowa

PostPosted: Fri Oct 13, 2025 6:30 am    Post subject: Reply with quote

Quote:
MaxRequestsPerChild, I find this to be one of the most sensitive Apache settings, to low and you will kill your server with load, to high and you can get memory errors... Unlike some people I recommend never setting this to 0, or a number above 1000, some servers with low amounts of ram may benefit from this being set low while others who have got high load but lots of ram may benefit from having this high.


This is a very good observation.....which i learned by trial and error and reading tons of man pages and website pages .......worth noting Wink



_________________
Arch Linux 0.7.2 Gimmick Kernel 2.6.18-7-ARCH
OpenSUSE 10.1 Kernel 2.6.13-15.8-smp #1 SMP
Redhat Linux 3.0ES
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » Administration and Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All content © 2025 - Usa Linux Users Group
This forum is powered by phpBB. © 2025-2006 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse