Help - Search - Members - Calendar
Full Version: HOWTO: 4 Primary Areas For Tuning Your Server
The Planet Forums > System Administration > HOWTOs
EOC_Jason
I just thought I would add my two cents in for everyone. I posted an old howto with some sysctl.conf, but I think that was when I was running on my previous server using and older version of redhat. So here's a fresh howto that is a little more complete.

These configs are based on my server specs, which is a Dual 2.0GHz Xeon with 2GB of RAM running RedHat Enterprise. Depending on your server's RAM you might have to reduce some of the settings, which I'll try make notes with each section.

-------------------------------------------

First, is the /etc/sysctl.conf file. Most people overlook tweaking these settings, always thinking it is a mysql or apache problem. You can get a tremendous boost in throughput by adjusting these settings. These are the settings I use on my server, and have come about by constantly adjusting and monitoring performance, and this is what works best for me, your mileage may vary based on server specs and traffic. I suggest finding some guides and reading up about what each seting does before you make changes. (Note: most out there are pretty dated unfortunatly). Also, some people out there like to have tcp_window_scaling, sack, fack, etc, turned off, but I leave them on. I guess it is just a personal preference thing. So don't complain, but feel free to leave your comments, testing, and results.

/etc/sysctl.conf
CODE
# Kernel sysctl configuration file for Red Hat Enterprise Linux



# Controls IP packet forwarding

net.ipv4.ip_forward = 0



# Controls source route verification

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.all.rp_filter = 1





# Disables IP source routing

net.ipv4.conf.default.accept_source_route = 0

net.ipv4.conf.all.accept_source_route = 0



# Controls the System Request debugging functionality of the kernel

kernel.sysrq = 0



# Controls whether core dumps will append the PID to the core filename.

# Useful for debugging multi-threaded applications.

kernel.core_uses_pid = 1



# Increase maximum amount of memory allocated to shm

# Only uncomment if needed!

# kernel.shmmax = 67108864



# Disable ICMP Redirect Acceptance

net.ipv4.conf.default.accept_redirects = 0

net.ipv4.conf.all.accept_redirects = 0





# Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets

net.ipv4.conf.default.log_martians = 1

net.ipv4.conf.all.log_martians = 1



# Decrease the time default value for tcp_fin_timeout connection

net.ipv4.tcp_fin_timeout = 25



# Decrease the time default value for tcp_keepalive_time connection

net.ipv4.tcp_keepalive_time = 1200



# Turn on the tcp_window_scaling

net.ipv4.tcp_window_scaling = 1



# Turn on the tcp_sack

net.ipv4.tcp_sack = 1



# tcp_fack should be on because of sack

net.ipv4.tcp_fack = 1



# Turn on the tcp_timestamps

net.ipv4.tcp_timestamps = 1



# Enable TCP SYN Cookie Protection

net.ipv4.tcp_syncookies = 1



# Enable ignoring broadcasts request

net.ipv4.icmp_echo_ignore_broadcasts = 1



# Enable bad error message Protection

net.ipv4.icmp_ignore_bogus_error_responses = 1



# Make more local ports available

# net.ipv4.ip_local_port_range = 1024 65000



# Set TCP Re-Ordering value in kernel to '5'

net.ipv4.tcp_reordering = 5



# Lower syn retry rates

net.ipv4.tcp_synack_retries = 2

net.ipv4.tcp_syn_retries = 3



# Set Max SYN Backlog to '2048'

net.ipv4.tcp_max_syn_backlog = 2048



# Various Settings

net.core.netdev_max_backlog = 1024



# Increase the maximum number of skb-heads to be cached

net.core.hot_list_length = 256



# Increase the tcp-time-wait buckets pool size

net.ipv4.tcp_max_tw_buckets = 360000



# This will increase the amount of memory available for socket input/output queues

net.core.rmem_default = 65535

net.core.rmem_max = 8388608

net.ipv4.tcp_rmem = 4096 87380 8388608

net.core.wmem_default = 65535

net.core.wmem_max = 8388608

net.ipv4.tcp_wmem = 4096 65535 8388608

net.ipv4.tcp_mem = 8388608 8388608 8388608

net.core.optmem_max = 40960


After you make the changes to the file, you can make them effective immediately by typing in /sbin/sysctl -p

Also, you will need to issue /sbin/sysctl -w net.ipv4.route.flush=1 to flush the routing table to make some of these changes happen instantly.

Here's some URLs with useful info, benchmarks, etc... (I believe one was posted from someone below)
http://www.aarnet.edu.au/engineering/netwo.../mtu/local.html
http://sverre.home.cern.ch/sverre/TenGBE_w...er_04232003.pdf
http://www.hep.ucl.ac.uk/~ytl/tcpip/linux/...en/datatag-tcp/
http://www-didc.lbl.gov/TCP-tuning/TCP-tuning.html
http://ipsysctl-tutorial.frozentux.net/chu...html/index.html

-------------------------------------------

Second is the MySQL /etc/my.cnf settings file. A lot of people just leave this file with its default settings until they notice problems with their server performance. Please note that I'm not including the datadir or socket settings since those can vary based on your server setup. Also I'm only including the base [mysqld] section and not any of the [safe_mysqld], [mysqldump], or [myisamchk] sections.

Also, update your MySQL to the latest version, if you are still running 3.x you should be dragged out into the street and beaten with a stick, seriously. Just download the MySQL RPMs from the MySQL website, it takes 30 seconds to upgrade. They usually release a new version every month. Be aware of the difference between 4.0.x and 4.1.x (or higher).

CODE
[mysqld]

connect_timeout=15

interactive_timeout=100

join_buffer_size=1M

key_buffer=256M

max_allowed_packet=16M

max_connections=500

max_connect_errors=10

myisam_sort_buffer_size=64M

read_buffer_size=2M

read_rnd_buffer_size=2M

sort_buffer_size=2M

table_cache=1024

thread_cache_size=100

thread_concurrency=4

wait_timeout=300

query_cache_size=128M

query_cache_limit=1M

query_cache_type=1

skip-innodb


For people with a single CPU be sure to set thread_concurrency to 2 (4 is for Dual CPUs). People with 1GB of RAM, you might want to consider lowering the key_buffer to 64M and the myisam_sort_buffer_size to 32M. This really just depends on how much free memory your system has during peak traffic hours. If you increase these too much and your system runs out of physical RAM and starts swapping to disk, your system is going to eat it hard.

For more information about Mysqld variables, please read the following articles as they explain all the settings in-depth and how to fine-tune them: Article 1 and Article 2 and Article 3


-------------------------------------------

Third is Apache. Some people run 1.x, and some run 2.x, me personally I run 2.x because of the better performance. But some people are tied to the older version because of other software packages.

The first thing to do if you are running 1.x is to get mod_gzip and use it. If you are running 2.x then use mod_deflate (it is included). This compresses all your HTML/TXT/XML data before it is sent, saving you bandwidth, and faster load times for your users.

If you are serving up pages + images then you *probably* want to set your keepalive to on, and have your settings something like this:

Timeout 60
KeepAlive On
MaxKeepAliveRequests 1000
KeepAliveTimeout 10

By setting the KeepAliveTimeout low you won't have all those lingering connections. You can probably set it even lower if you like.

If you are only serving up html (or php or whatever) pages, and using another web server for your images (like tux). Then you probably want to set your KeepAlive to Off since the user will only be requesting 1 file at a time.

Most people have the bad habit of instantly increasing their MaxClients to 256. This can be BAD if you don't take into account memory availability. You need to determine how much memory you have free, how much each apache process consumes, then do the math to figure out what you can safely set the MaxClients to. If you exceed your physical memory then once again the server will swap to the HD and the server will take a dive in performance.

Comment out / remove and Dynamic Shared Object (DSO) modules that you do not use! There are a ton loaded by default, most which you will never use. I commented out 20+ personally! Read the apache documentation on what each one does, the apache docs are very detailed.

If possible, set the AllowOverride option to None. This prevents apache from checking for the .htaccess file in every directory whenever a request is made. However if you use .htaccess files then you have to leave the setting there, but if you can limit it down to certain directories, then do it.

Mask your Apache version by using the following settings:
ServerSignature Off
ServerTokens ProductOnly


That's just good practice, you can also hide your PHP info by setting expose_php = Off in your /etc/php.ini file.

-------------------------------------------
EOC_Jason
Fourth is PHP. One thing to do is use a program like eAccelerator which caches pre-compiled versions of your php files to help reduce overhead and increase performance. It is a free download from sourceforge, but it will require a little know-ho on your part to install. There are plenty of other guides on how to install this. It is very simple and quick.

A lot of people use the redhat PHP RPMs, which can be quite bloated. My libphp4.so module is only 2.07MB in size. (I don't remember what the default redhat one is, but I'm willing to bet it is larger). Also Redhat never seems to keep up to date with the latest PHP (or MySQL) version, I always recommend updating as soon as a new release is published.

Here's my configure line. There's a lot of settings you may not use, and they could be ones that you use that I don't. You can view your current configure line via the phpinfo() function. These include all the big things such as GD, XML, SHM, etc.. Some people maybe want to enable a certain memory-limit to prevent PHP from eating too much memory per process.

Also, I don't use mm simply because I found it would crash apache on an almost daily basis. I had problems with session storage, and also it would not restart after rotating logs...

CODE
./configure

--prefix=/usr

--exec-prefix=/usr

--bindir=/usr/bin

--sbindir=/usr/sbin

--sysconfdir=/etc

--datadir=/usr/share

--includedir=/usr/include

--libdir=/usr/lib

--libexecdir=/usr/libexec

--localstatedir=/var

--sharedstatedir=/usr/com

--mandir=/usr/share/man

--infodir=/usr/share/info

--disable-cgi

--disable-debug

--disable-rpath

--disable-memory-limit

--disable-ipv6

--disable-safe-mode

--enable-pic

--enable-discard-path

--enable-inline-optimization

--enable-gd-native-ttf

--enable-gd-imgstrttf

--enable-magic-quotes

--enable-sysvsem

--enable-sysvshm

--enable-sysvmsg

--enable-shmop

--enable-track-vars

--enable-exif

--enable-wddx

--enable-bcmath

--enable-calendar

--enable-ftp

--enable-inline-optimization

--with-apxs2=/usr/sbin/apxs

--with-mysql=/usr

--with-pear

--with-config-file-path=/etc

--with-exec-dir=/usr/bin

--with-gd

--with-png-dir=/usr

--with-jpeg-dir=/usr

--with-freetype-dir=/usr

--with-gettext

--with-openssl

--with-regex

--with-ttf=/usr

--with-expat-dir=/usr

--with-dom=/usr

--with-dom-xslt=/usr

--with-dom-exslt=/usr

--with-iconv

--with-db4=/usr

--with-gdbm=/usr

--with-zlib=/usr

--with-zlib-dir=/usr

--with-xmlrpc

--with-xml

--with-bz2=/usr

--with-cdb

--enable-mbstring


-------------------------------------------

When compiling programs (like PHP, eaccelerator, etc..), you can fine-tune some of your compile-options to enhance performance for your CPU's capabilities (and remove excess stuff like debug info)

As mentioned before, I run dual xeon's (P4's for all practical purposes). If you are using a different CPU then you might have to go look up the proper flags at the GCC website.

Before compiling a program, you can set the following flags:

CODE
export CFLAGS="-O3 -pipe -mcpu=pentium4 -march=pentium4 -fomit-frame-pointer"

export CXXFLAGS="${CFLAGS}"

export CHOST="i686-pc-linux-gnu"

export MAKEOPTS="-j2"

export LDFLAGS="-Wl,-O1"


These flags are considered "stable" and should enhance performance a little for software that you compile with these options. There are tons of other flags, however some reduce precision for certain math (which can cause problems in certain software) and others may reduce stabililty.

-------------------------------------------

I guess that's about it... Use the information at your own risk. Hopefully it will help some people out, or at least point them in the right direction.

Please don't post questions that are like: "here's my config, can you optimize it for X server?". I don't check these forums that often, so I probably won't reply to your question.

Server tuning is more of an art than just entering X setting to Y number. Before making changes, keep your old configs. Also get a monitoring program so you can graph out your server load and other vitals. That way you can see before & after results. Also, if you run a forum, let your users know that you are going to make changes, and get their feedback on response time and such from them.

Enjoy.
lordo
Thanks. What about lower specs? Intel Celeron 1.3 GHz
512 RAM - 60 GB Hard Drive. I mean I can not estimate the right values for your parameters by myself.

Thanks.
EOC_Jason
Oops.. I forgot to post somewhere that I updated the sysctl.conf info some, I think the only things I changed / added were:

added:
- net.ipv4.tcp_max_syn_backlog = 2048

and I changed one of these two:
- net.ipv4.tcp_fin_timeout = 1800
- net.ipv4.tcp_keepalive_time = 1800

I also added those other links (even though some of that information is outdated, it's still good reading).
JLChafardet
I just noticed that the skip innodb on plesk servers makes plesk to fail.
CODE
[mysqld]

datadir=/var/lib/mysql (original psa mysql lines)

socket=/var/lib/mysql/mysql.sock (original psa mysql lines)

#query_cache_type=1 (original psa mysql lines)

#query_cache_size=10m (original psa mysql lines)

## Here start the modifications

max_allowed_packet=16M

max_connections=500

max_connect_errors=10

myisam_sort_buffer_size=64M

read_buffer_size=1M

read_rnd_buffer_size=768K

sort_buffer_size=1M

table_cache=1024

thread_cache_size=100

thread_concurrency=2

wait_timeout=300

query_cache_size=32M

query_cache_limit=1M

query_cache_type=1

##

#skip-innodb

## Here ends.


with the innodb line uncomented the results are:
CODE
Starting psa-spamassassin service:                         [  OK  ]

Mysql error: Can't find file: 'key_history.MYI' (errno: 2)

Key register failed

/usr/local/psa/admin/bin/httpsdctl: line 227:  4192 Terminated              $HTTPD

/usr/local/psa/admin/bin/httpsdctl start: httpd could not be started

Starting Plesk:                                            [FAILED]

[root@hve01 root]# service psa stopall


without it starts perfectly.

on the first part! well i am not sure to do steep 2 and 4 (i think plesk has something with php wich drives me to do not try it. the other one just seems to be too complex for my little administration time.)

any way EOC_Jason i will give a try and read as you say to see what does each option does, to see if i can boost up my server. thanks a lot for all your help.
dervisoglu
Great how to
I have the same server specs as yours with scsi disks

You did not mention about what kind of sites you host, basically what is your load on the server,

I host 2 major sites:

One VB board with max 400 users ( cookie 900sec)
And one PHP site servering free pictures with 7k hits daily

DO you think your configuration will help me to serve my visitors with fast and online server?

I hope i can make myself clear,
EOC_Jason
The server is strictly to host my site (well, and a couple friends really small sites, but their traffic is minimal).

http://www.extremeoverclocking.com/

The main site is a mix of HTML & PHP.
The forums are vBulletin with usually around 300-600+ people online at any given time (Peak has been a hair over 900.)
The adserver is PHP & MySQL (phpadsnew).
The folding stats are PHP & MySQL and can get very intensive when updating.
I also have a file downloads section, but the downloads are handled by tux, not apache.

All the kernel tweaks (sysctl.conf settings) generally increase your throughput and decrease the page load time for the end users. The MySQL tweaks came about because of the heavy forum and folding stats usage. And I build my own PHP module because I like to keep up to date and also I use some configuration settings that are not included in the Redhat RPM.

There really isn't any "fixed" settings that are perfect for everyone. Each server is unique in what it is used for, and thus you have to tailor various settings to maximize your performance.
Marcus Wendel
EOC_Jason,

Thanks for this how to, just one quick question:
For those of us who use Red Hat Linux rather than Red Hat Enterprise Linux, will those sysctl.conf setting work?

/Marcus
EOC_Jason
They should work for any distro of linux since they are all generic kernel based tweaks.

However, there are additional settings that you should check and possibly tweak. I didn't include them because RH ES already had them set at the proper numbers, however older versions of RedHat didn't.

I'll try to dig up a list of additional settings to check and adjust, give me a couple days and I'll post it in this thread.
rfxn
- net.ipv4.tcp_fin_timeout = 1800
- net.ipv4.tcp_keepalive_time = 1800

The above noted rules would create an undesired situation allowing attackers to easily D/DoS a system and overflow the network table with absurd amount of connections before they even begin to timeout.

I would recommend the following sysctl networking paramters:

# Decrease time between keepalives
net.ipv4.tcp_keepalive_time = 1200

# Decrease the time default value for tcp_fin_timeout connection
net.ipv4.tcp_fin_timeout = 25

# Allow more SYN backlog
net.ipv4.tcp_max_syn_backlog = 1048

# Lower syn retry rates
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 3


As with regards to rpfilter, source route, icmp, martians and similar you do not need to add the context for every interface -- simply add it for default and all so it will auto adapt to all interfaces on the system.

Beyond that nice set of sysctl rules; minus the later performance related sysctl rules which one would be advised to express caution when setting up.
madsere
Setting sticky!
PhilG
First, Great howto!

Now, I have a question. You mention that its important to set your max clients correctly and you say that you need to know how much ram you have free. Well Usually my box runs at about 95% usuage with ram but most of it is just cached. Can you give us a working example of how to work this out?

Lets say, I have a p4 2.4Ghz, 1GB Ram, apache 2. Now how would I work out the maxclients? And how do I work out how much an apache process is using - it seems that the longer apache runs the more it takes...

Any suggestions would be appreciated!
sushil2000
QUOTE
Originally posted by PhilG
First, Great howto!
Lets say, I have a p4 2.4Ghz, 1GB Ram, apache 2. Now how would I work out the maxclients? And how do I work out how much an apache process is using - it seems that the longer apache runs the more it takes...

Any suggestions would be appreciated!


MaxClients = RAM available for web server / MAX child's process size

So if you can afford 500Mb of RAM of the 1GB for apache, with the average process size 2.5Mb, you can probably set MaxClients to 200.
PhilG
Ah, that helps alot. Just to fine tune what you said. If i want to accurately measure the size of an apache process can I use top:

CODE
 PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND

16343 root      15   0  6264  296   188 S    99.9  0.0   0:10   0 httpd


Does that mean the http process is 6.2 MB?
sushil2000
It looks like that particular process is CPU intensive and you should find out what is it exactly doing with `lsof -sp `.
PhilG
Oops! I had pressed H while in top (some how) and it was in a grouped process mode instead of the threaded mode show individual processes.

Here is a better output of httpd processes:

CODE
 PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND

8855 nobody    17   0  9208 5848  2516 S     1.3  0.5   0:00   0 httpd

8406 root      15   0  1204 1204   864 R     0.1  0.1   0:00   0 top

8702 nobody    15   0 11888 8884  4008 S     0.1  0.8   0:00   0 httpd

8856 nobody    15   0  8424 5004  2136 S     0.1  0.4   0:00   0 httpd

8866 nobody    16   0  7516 3864  1400 S     0.1  0.3   0:00   0 httpd

8868 nobody    20   0  7540 3480  1420 S     0.1  0.3   0:00   0 httpd

   1 root      15   0   108   76    52 S     0.0  0.0   0:14   0 init

   2 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 keventd

   3 root      34  19     0    0     0 SWN   0.0  0.0   0:00   0 ksoftirqd_CPU0

   8 root      25   0     0    0     0 SW    0.0  0.0   0:00   0 bdflush

   4 root      15   0     0    0     0 SW    0.0  0.0   0:10   0 kswapd

   5 root      15   0     0    0     0 SW    0.0  0.0   0:00   0 kscand/DMA


Are they relatively large httpd processors?
EOC_Jason
Thanks for the info, I just updated the first post with your recommendations.

(I don't check in here often, so it's a little late updating.)

QUOTE
Originally posted by rfxn
As with regards to rpfilter, source route, icmp, martians and similar you do not need to add the context for every interface -- simply add it for default and all so it will auto adapt to all interfaces on the system.

Beyond that nice set of sysctl rules; minus the later performance related sysctl rules which one would be advised to express caution when setting up.
Realist
Done the below but saved the original just in case. It did not work so good so I put back the original file and executed the below commands to force the install.

The problem I have now is apache has failed?

Any ideas why and how I can get it backup?

Laters

QUOTE
Originally posted by EOC_Jason
First, is the /etc/sysctl.conf file. Most people overlook tweaking these settings, always thinking it is a mysql or apache problem. You can get a tremendous boost in throughput by adjusting these settings. These are the settings I use on my server, and have come about by constantly adjusting and monitoring performance, and this is what works best for me, your mileage may vary based on server specs and traffic. I suggest finding some guides and reading up about what each seting does before you make changes. (Note: most out there are pretty dated unfortunatly). Also, some people out there like to have tcp_window_scaling, sack, fack, etc, turned off, but I leave them on. I guess it is just a personal preference thing. So don't complain, but feel free to leave your comments, testing, and results.

/etc/sysctl.conf
CODE
# Kernel sysctl configuration file for Red Hat Enterprise Linux



# Controls IP packet forwarding

net.ipv4.ip_forward = 0



# Controls source route verification

# Default should work for all interfaces

net.ipv4.conf.default.rp_filter = 1

# net.ipv4.conf.all.rp_filter = 1

# net.ipv4.conf.lo.rp_filter = 1

# net.ipv4.conf.eth0.rp_filter = 1





# Disables IP source routing

# Default should work for all interfaces

net.ipv4.conf.default.accept_source_route = 0

# net.ipv4.conf.all.accept_source_route = 0

# net.ipv4.conf.lo.accept_source_route = 0

# net.ipv4.conf.eth0.accept_source_route = 0





# Controls the System Request debugging functionality of the kernel

kernel.sysrq = 0



# Controls whether core dumps will append the PID to the core filename.

# Useful for debugging multi-threaded applications.

kernel.core_uses_pid = 1



# Increase maximum amount of memory allocated to shm

# Only uncomment if needed!

# kernel.shmmax = 67108864



# Disable ICMP Redirect Acceptance

# Default should work for all interfaces

net.ipv4.conf.default.accept_redirects = 0

# net.ipv4.conf.all.accept_redirects = 0

# net.ipv4.conf.lo.accept_redirects = 0

# net.ipv4.conf.eth0.accept_redirects = 0





# Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets

# Default should work for all interfaces

net.ipv4.conf.default.log_martians = 1

# net.ipv4.conf.all.log_martians = 1

# net.ipv4.conf.lo.log_martians = 1

# net.ipv4.conf.eth0.log_martians = 1



# Decrease the time default value for tcp_fin_timeout connection

net.ipv4.tcp_fin_timeout = 25



# Decrease the time default value for tcp_keepalive_time connection

net.ipv4.tcp_keepalive_time = 1200



# Turn on the tcp_window_scaling

net.ipv4.tcp_window_scaling = 1



# Turn on the tcp_sack

net.ipv4.tcp_sack = 1



# tcp_fack should be on because of sack

net.ipv4.tcp_fack = 1



# Turn on the tcp_timestamps

net.ipv4.tcp_timestamps = 1



# Enable TCP SYN Cookie Protection

net.ipv4.tcp_syncookies = 1



# Enable ignoring broadcasts request

net.ipv4.icmp_echo_ignore_broadcasts = 1



# Enable bad error message Protection

net.ipv4.icmp_ignore_bogus_error_responses = 1



# Make more local ports available

# net.ipv4.ip_local_port_range = 1024 65000



# Set TCP Re-Ordering value in kernel to '5'

net.ipv4.tcp_reordering = 5



# Lower syn retry rates

net.ipv4.tcp_synack_retries = 2

net.ipv4.tcp_syn_retries = 3



# Set Max SYN Backlog to '2048'

net.ipv4.tcp_max_syn_backlog = 2048



# Various Settings

net.core.netdev_max_backlog = 1024



# Increase the maximum number of skb-heads to be cached

net.core.hot_list_length = 256



# Increase the tcp-time-wait buckets pool size

net.ipv4.tcp_max_tw_buckets = 360000



# This will increase the amount of memory available for socket input/output queues

net.core.rmem_default = 65535

net.core.rmem_max = 8388608

net.ipv4.tcp_rmem = 4096 87380 8388608

net.core.wmem_default = 65535

net.core.wmem_max = 8388608

net.ipv4.tcp_wmem = 4096 65535 8388608

net.ipv4.tcp_mem = 8388608 8388608 8388608

net.core.optmem_max = 40960


After you make the changes to the file, you can make them effective immediately by typing in /sbin/sysctl -p

Also, you will need to issue sysctl -w net.ipv4.route.flush=1 to flush the routing table to make some of these changes happen instantly.
EOC_Jason
What is the error apache gives? (check your messages or apache error log).

QUOTE
Originally posted by Realist
Done the below but saved the original just in case. It did not work so good so I put back the original file and executed the below commands to force the install.

The problem I have now is apache has failed?

Any ideas why and how I can get it backup?

Laters
blackmoont
Hi Jason
I am running heavy ibp forum ( 600m database , 130K registered member , 600+ K post ) around 500user online in 15minute ) and my server is dual opteron 242 4G ram ,2x73G SCSI . But my load alway around 8 and burst to 10+ in peak time , mostly cause by mysql process . Could you help me tweak mySQL and apache ?

This is my my.cnf :
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
query_cache_limit=2M
query_cache_size=128M
query_cache_type=1
max_connections=512
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=1024M
join_buffer=8M
max_allowed_packet=16M
table_cache=1024
record_buffer=2M
sort_buffer_size=4M
key_buffer_size=4M
read_buffer_size=4M

tmp_table_size=128M
max_connect_errors=10
thread_concurrency=4
myisam_sort_buffer_size=128M
server-id=1

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=32M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=128M
sort_buffer=128M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=128M
sort_buffer=128M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout

---------
And my apache setting is :
timeout : 300
KeepAlive : off
MaxKeepAliveRequests 100
KeepAliveTimeout 10
MinSpareServers 15
MaxSpareServers 45
StartServers 10
MaxClients 512
MaxRequestsPerChild 50

------------
Best Regard
Ken.
blackmoont
I forgot to mention that i'v tweak sysctl.conf as same as your sysctl.conf .
And this i my SQL System Variables :
back_log 50
basedir /
binlog_cache_size 32768
bulk_insert_buffer_size 8388608
character_set latin1
character_sets latin1 big5 czech euc_kr gb2312 gbk latin1_de sjis
tis620 ujis dec8 dos german1 hp8 koi8_ru latin2
swe7 usa7 cp1251 danish hebrew win1251 estonia
hungarian koi8_ukr win1251ukr greek win1250 croat
cp1257 latin5 latin5_x
concurrent_insert ON
connect_timeout 10
convert_character_set
datadir /var/lib/mysql/
default_week_format 0
delay_key_write ON
delayed_insert_limit 100
delayed_insert_timeout 300
delayed_queue_size 1000
flush OFF
flush_time 0
ft_boolean_syntax + -><()~*:""&|
ft_min_word_len 4
ft_max_word_len 254
ft_max_word_len_for_sort 20
ft_stopword_file (built-in)
have_bdb NO
have_crypt YES
have_innodb DISABLED
have_isam YES
have_raid NO
have_symlink YES
have_openssl NO
have_query_cache YES
init_file
innodb_additional_mem_pool_size 1048576
innodb_autoextend_increment 8
innodb_buffer_pool_size 8388608
innodb_data_file_path
innodb_data_home_dir
innodb_file_io_threads 4
innodb_force_recovery 0
innodb_thread_concurrency 8
innodb_flush_log_at_trx_commit 1
innodb_fast_shutdown ON
innodb_flush_method
innodb_lock_wait_timeout 50
innodb_log_arch_dir
innodb_log_archive OFF
innodb_log_buffer_size 1048576
innodb_log_file_size 5242880
innodb_log_files_in_group 2
innodb_log_group_home_dir
innodb_mirrored_log_groups 1
innodb_max_dirty_pages_pct 90
innodb_max_purge_lag 0
innodb_table_locks ON
interactive_timeout 100
join_buffer_size 8384512
key_buffer_size 4194304
language /usr/share/mysql/english/
large_files_support ON
license GPL
local_infile ON
locked_in_memory OFF
log OFF
log_update OFF
log_bin OFF
log_slave_updates OFF
log_slow_queries OFF
log_warnings 1
long_query_time 10
low_priority_updates OFF
lower_case_file_system OFF
lower_case_table_names 0
max_allowed_packet 16776192
max_binlog_cache_size 4294967295
max_binlog_size 1073741824
max_connections 512
max_connect_errors 10
max_delayed_threads 20
max_insert_delayed_threads 20
max_heap_table_size 16777216
max_join_size 4294967295
max_relay_log_size 0
max_seeks_for_key 4294967295
max_sort_length 1024
max_user_connections 0
max_tmp_tables 32
max_write_lock_count 4294967295
myisam_max_extra_sort_file_size 268435456
myisam_max_sort_file_size 2147483647
myisam_repair_threads 1
myisam_recover_options OFF
myisam_sort_buffer_size 134217728
net_buffer_length 16384
net_read_timeout 30
net_retry_count 10
net_write_timeout 60
new OFF
open_files_limit 2570
pid_file /var/lib/mysql/vn99.blackmoont.net.pid
log_error
port 3306
protocol_version 10
query_alloc_block_size 8192
query_cache_limit 2097152
query_cache_size 134217728
query_cache_type ON
query_cache_wlock_invalidate OFF
query_prealloc_size 8192
range_alloc_block_size 2048
read_buffer_size 4190208
read_only OFF
read_rnd_buffer_size 262144
rpl_recovery_rank 0
server_id 1
slave_net_timeout 3600
skip_external_locking ON
skip_networking OFF
skip_show_database OFF
slow_launch_time 2
socket /var/lib/mysql/mysql.sock
sort_buffer_size 4194296
sql_mode 0
table_cache 1024
table_type MYISAM
thread_cache_size 128
thread_stack 126976
tx_isolation REPEATABLE-READ
timezone HKT
tmp_table_size 134217728
tmpdir /tmp/
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
version 4.0.24-standard
version_comment Official MySQL RPM
version_compile_os pc-linux-gnu
wait_timeout 100


-------------------------------------
and this is my SQL Runtime Information
Aborted_clients 0
Aborted_connects 0
Bytes_received 57745306
Bytes_sent 3826149574
Com_admin_commands 0
Com_alter_table 0
Com_analyze 0
Com_backup_table 0
Com_begin 0
Com_change_db 22561
Com_change_master 0
Com_check 0
Com_commit 0
Com_create_db 0
Com_create_function 0
Com_create_index 0
Com_create_table 0
Com_delete 12496
Com_delete_multi 0
Com_drop_db 0
Com_drop_function 0
Com_drop_index 0
Com_drop_table 0
Com_flush 2
Com_grant 1
Com_ha_close 0
Com_ha_open 0
Com_ha_read 0
Com_insert 11678
Com_insert_select 0
Com_kill 0
Com_load 0
Com_load_master_data 0
Com_load_master_table 0
Com_lock_tables 8
Com_optimize 0
Com_purge 0
Com_rename_table 0
Com_repair 0
Com_replace 1349
Com_replace_select 0
Com_reset 0
Com_restore_table 0
Com_revoke 0
Com_rollback 0
Com_savepoint 0
Com_select 111833
Com_set_option 22
Com_show_binlog_events 0
Com_show_binlogs 1
Com_show_create 1
Com_show_databases 22
Com_show_fields 36
Com_show_grants 3
Com_show_keys 6
Com_show_logs 0
Com_show_master_status 0
Com_show_new_master 0
Com_show_open_tables 0
Com_show_processlist 16
Com_show_slave_hosts 0
Com_show_slave_status 0
Com_show_status 1
Com_show_innodb_status 0
Com_show_tables 180
Com_show_variables 2
Com_slave_start 0
Com_slave_stop 0
Com_truncate 0
Com_unlock_tables 8
Com_update 25310
Com_update_multi 1
Connections 22581
Created_tmp_disk_tables 16
Created_tmp_tables 90
Created_tmp_files 24
Delayed_insert_threads 0
Delayed_writes 0
Delayed_errors 0
Flush_commands 1
Handler_commit 0
Handler_delete 11652
Handler_read_first 77
Handler_read_key 8573449
Handler_read_next 16272971
Handler_read_prev 40317888
Handler_read_rnd 2032515
Handler_read_rnd_next 854737999
Handler_rollback 0
Handler_update 114734
Handler_write 1824736
Key_blocks_used 3896
Key_read_requests 28750195
Key_reads 196109
Key_write_requests 77880
Key_writes 69015
Max_used_connections 83
Not_flushed_key_blocks 3
Not_flushed_delayed_rows 0
Open_tables 468
Open_files 553
Open_streams 0
Opened_tables 478
Questions 417226
Qcache_queries_in_cache 715
Qcache_inserts 100105
Qcache_hits 209116
Qcache_lowmem_prunes 0
Qcache_not_cached 11725
Qcache_free_memory 131326160
Qcache_free_blocks 372
Qcache_total_blocks 1881
Rpl_status NULL
Select_full_join 0
Select_full_range_join 0
Select_range 4040
Select_range_check 0
Select_scan 63741
Slave_open_temp_tables 0
Slave_running OFF
Slow_launch_threads 10
Slow_queries 30
Sort_merge_passes 12
Sort_range 1019
Sort_rows 2278246
Sort_scan 25193
Table_locks_immediate 192747
Table_locks_waited 21117
Threads_cached 77
Threads_created 84
Threads_connected 7
Threads_running 3
Uptime 4138
JLChafardet
This is my my.cnf on a Plesk 7.5.2 Reloaded server with 1 GB ram.

Edited as i added more ram to my box, my.cnf tweaked for PSA 7.5.3 with 1GB ram.
[EDIT]

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
#skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_concurrency=2
thread_cache_size=50
key_buffer=150M
table_cache=512
sort_buffer_size=1M
read_buffer_size=1M
read_rnd_buffer_size=768K
join_buffer=1M
max_allowed_packet=16M
record_buffer=1M
max_connect_errors=10
set-variable=key_buffer=128M
set-variable=max_allowed_packet=2M
set-variable=table_cache=128
set-variable=sort_buffer=32M
set-variable=join_buffer=32M
set-variable=record_buffer=2M
set-variable=thread_cache=8
set-variable=read_buffer=1M
set-variable=max_connections=300
set-variable=thread_concurrency=2
set-variable=myisam_sort_buffer_size=128M
set-variable=read_rnd_buffer_size=1M
skip-show-database
myisam_sort_buffer_size=64M
log-bin
server-id=1
#log_slow_queries=/var/log/slow-queries.log

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout

[/EDIT]
---------------------

httpd

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
MaxClients 250


StartServers 5
MinSpareServers 5
MaxSpareServers 32
MaxClients 250
MaxRequestsPerChild 100



StartServers 5
MaxClients 250
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0

#
# To reduce memory usage in the worker MPM, the thread guard page
# can be disabled, at the expense of some protection against stack
# overflow.
#
#ThreadGuardArea off



Mod_security and Mod_dosevasive

regards,
Dyego
I have a server
Intel Xeon 2x2.8/2048MB/36SCSI/FreeBSD 5.3

I have in the server a website with 60 a thousand unicas visits per day and a forum ipb (DB with 129MB, 50 a thousand users, 80 a thousand post, 300 users for each 15 minutes).

Which the configuration that I must place in the APACHE and the MYSQL?

The server this slow one.

Please, it helps to me to configure it the server so that it is better.

Thanks. Dyego.
mr_dizzle
my /etc/my.conf looks like this:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


yes, i am still running version 3.x.x
is this the reason [mysqld] has so little under it compared to your:

[mysqld]
connect_timeout=15
interactive_timeout=100
join_buffer_size=1M
key_buffer=128M
max_allowed_packet=16M
max_connections=500
max_connect_errors=10
myisam_sort_buffer_size=64M
read_buffer_size=1M
read_rnd_buffer_size=768K
sort_buffer_size=1M
table_cache=1024
thread_cache_size=100
thread_concurrency=4
wait_timeout=300
query_cache_size=32M
query_cache_limit=1M
query_cache_type=1
skip-innodb

or is it safe for me to just add that stuff?

thanks
EOC_Jason
FYI, I updated several parts of the guide:

1. Better MySQL settings and a couple links to good guides explaining each variable and how to fine-tune them for your system.

2. Cleaned up sysctl.conf settings some.

3. Updated php configure statement

4. Added some cflags for compiling your own software with more optimized compiler settings.
JLChafardet
my sysctl.conf is as follows

CODE
### Kernel sysctl configuration file for Red Hat Linux

###

### For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and

### sysctl.conf(5) for more details.



### Controls IP packet forwarding

###net.ipv4.ip_forward = 0



### Controls source route verification

###net.ipv4.conf.default.rp_filter = 1



### Controls the System Request debugging functionality of the kernel

###kernel.sysrq = 0



### Controls whether core dumps will append the PID to the core filename.

### Useful for debugging multi-threaded applications.

###kernel.core_uses_pid = 1



#Kernel sysctl configuration file for Red Hat Linux

#

# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and

# sysctl.conf(5) for more details.



# Disables packet forwarding

net.ipv4.ip_forward=0



# Disables IP source routing

net.ipv4.conf.all.accept_source_route = 0

net.ipv4.conf.lo.accept_source_route = 0

net.ipv4.conf.eth0.accept_source_route = 0

net.ipv4.conf.default.accept_source_route = 0



# Enable IP spoofing protection, turn on source route verification

net.ipv4.conf.all.rp_filter = 1

net.ipv4.conf.lo.rp_filter = 1

net.ipv4.conf.eth0.rp_filter = 1

net.ipv4.conf.default.rp_filter = 1



# Disable ICMP Redirect Acceptance

net.ipv4.conf.all.accept_redirects = 0

net.ipv4.conf.lo.accept_redirects = 0

net.ipv4.conf.eth0.accept_redirects = 0

net.ipv4.conf.default.accept_redirects = 0



# Enable Log Spoofed Packets, Source Routed Packets, Redirect Packets

net.ipv4.conf.all.log_martians = 0

net.ipv4.conf.lo.log_martians = 0

net.ipv4.conf.eth0.log_martians = 0



# Disables IP source routing

net.ipv4.conf.all.accept_source_route = 0

net.ipv4.conf.lo.accept_source_route = 0

net.ipv4.conf.eth0.accept_source_route = 0

net.ipv4.conf.default.accept_source_route = 0



# Enable IP spoofing protection, turn on source route verification

net.ipv4.conf.all.rp_filter = 1

net.ipv4.conf.lo.rp_filter = 1

net.ipv4.conf.eth0.rp_filter = 1

net.ipv4.conf.default.rp_filter = 1



# Disable ICMP Redirect Acceptance

net.ipv4.conf.all.accept_redirects = 0

net.ipv4.conf.lo.accept_redirects = 0

net.ipv4.conf.eth0.accept_redirects = 0

net.ipv4.conf.default.accept_redirects = 0



# Disables the magic-sysrq key

kernel.sysrq = 0



# Decrease the time default value for tcp_fin_timeout connection

net.ipv4.tcp_fin_timeout = 15



# Decrease the time default value for tcp_keepalive_time connection

net.ipv4.tcp_keepalive_time = 1800



# Turn off the tcp_window_scaling

net.ipv4.tcp_window_scaling = 0



# Turn off the tcp_sack

net.ipv4.tcp_sack = 0



# Turn off the tcp_timestamps

net.ipv4.tcp_timestamps = 0



# Enable TCP SYN Cookie Protection

net.ipv4.tcp_syncookies = 1



# Enable ignoring broadcasts request

net.ipv4.icmp_echo_ignore_broadcasts = 1



# Enable bad error message Protection

net.ipv4.icmp_ignore_bogus_error_responses = 1



# Log Spoofed Packets, Source Routed Packets, Redirect Packets

net.ipv4.conf.all.log_martians = 1



# Increases the size of the socket queue (effectively, q0).

net.ipv4.tcp_max_syn_backlog = 1024



# Increase the tcp-time-wait buckets pool size

net.ipv4.tcp_max_tw_buckets = 1440000



# Allowed local port range

net.ipv4.ip_local_port_range = 16384 65536



#Ignores all ICMP packets

net.ipv4.icmp_echo_ignore_all = 1
top500
QUOTE (dervisoglu)
Great how to
I have the same server specs as yours with scsi disks

You did not mention about what kind of sites you host, basically what is your load on the server,

I host 2 major sites:

One VB board with max 400 users ( cookie 900sec)  
And one PHP site servering free pictures with 7k hits daily

DO you think your configuration will help me to serve my visitors with fast and online server?

I hope i can make myself clear,


I have a single site serving max 9999 users and UP to 100k hits/day (average is 30-50k / day, consuming 4-5GB/day on a 900mhz Duron with 512MB Ram.

MOST of the tweaks I have found here have helped a LOT but I've installed them over the years as needed (i.e.: If it works, don't fix it!).
bigboy
Server Optimization Request
I have a server
Intel Xeon 2.8GHz/2048MB/160SATA/FreeBSD 5.4
Controlpanel Directadmin
Webserver

http.conf
Timeout 60
KeepAlive On
MaxKeepAliveRequests 1024
KeepAliveTimeout 15

#StartServers 5
#MinSpareServers 5
#MaxSpareServers 10
#MaxClients 150
#MaxRequestsPerChild 0
ServerLimit 1024
StartServers 10
MinSpareServers 32
MaxSpareServers 64
MaxClients 1024
MaxRequestsPerChild 0



my.cnf

[mysqld]
#default_character_set = tis620
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
log-bin
server-id=1

[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout
geeshock
good thread, thanks to all that inputed this one, a definate bookmark icon_smile.gif
bigboy
[PHP]sysctl.conf[/PHP]

Don't optimize
al0000
Hello everyone,

I have a P4 1.7ghz 1gb RAM cPanel server.
I host a mambo portal receiving about 2.500hits/day.

However, the server is very slow. On peak hours CPU gets up to 15 or even higher, and services start to shut down.
I haven't figured out a way to speed up things. I know similar setups with even higher traffic and they run smooth and fast.

Any suggetions are welcomed.

These are my settings:

[httpd.conf]
Timeout 30
KeepAlive On
MaxKeepAliveRequests 300
KeepAliveTimeout 15
MinSpareServers 20
MaxSpareServers 40
StartServers 10
MaxClients 150 (lower clients, but apache wont hang)
MaxRequestsPerChild 1000

[my.cnf]

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=120
interactive_timeout=100
wait_timeout=15
connect_timeout=10
thread_cache_size=64
key_buffer=128M
join_buffer=1M
max_allowed_packet=16M
table_cache=512
record_buffer=1M
sort_buffer_size=1M
read_buffer_size=1M
max_connect_errors=10
read_rnd_buffer_size=1M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
#log-bin
server-id=1

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
primo
Hello, after substitute of sysctl.conf with one on the first page of this thread and after reboot the server don't came back up.
Can anyone tell me why? The server is RH release 4.
Best regards.
systron
In RHES 4 :

cat: /proc/sys/vm/kswapd: No such file or directory

How to manage this Important aspect of Virtual Memory?

Is there any other changes in RHES 4 ? to effectively manage Physical memory, as one of My RHES 4+ Plesk 7.5 , is contantly trying to swap just after 200-300 MB of physical memory when Apache loads shoots up, Any advice minimsing Apache load and avoiding contant Swapping to Swap memory ( KSWAD0) shall be highly appreciated.
casparus
Thanks a lot EOC_Jason! Appreciate. Next time, post a paypal account when providing such details. Your links were very helpful. Nice howto! Registered to say thanks!
MakeMeShine
this is great! thanks!
Pinchas
Great info, it has really got me started with Kernel optimization.
Perhaps you've seen this after entering your suggestions in sysctl.conf
and executing sysctl -p followed by: /sbin/sysctl -w net.ipv4.route.flush=1
I receive these errors when I do a /sbin/sysctl -a

error: "Operation not permitted" reading key "net.ipv6.route.flush"
error: "Operation not permitted" reading key "net.ipv4.route.flush"

Any suggestions??
ChuFuong
thanks for that... it was LONG... ;-p
wgl1
Obviosly below parameters are enought for sysctl:
CODE
net.ipv4.tcp_syncookies = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1

net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.accept_source_route = 0

net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.all.send_redirects = 0

net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1800

Reference: Hardening existing Linux server via sysctl parameters

Secure OpenSSH:
CODE
Protocol 2

PermitRootLogin without-password
StrictModes yes
Banner /etc/sshd_banner

LoginGraceTime 60
MaxAuthTries 3
MaxStartups 10

PermitEmptyPasswords no
PrintLastLog yes
AllowTcpForwarding no

IgnoreRhosts yes
IgnoreUserKnownHosts yes
HostbasedAuthentication no


Reference: Secure existing OpenSSH installation

Secure ProFTPd:
CODE
ServerType standalone
ServerName "SysAdmin.MD secured FTP server"
ServerIdent on "FTP server"
DeferWelcome on

UseIPv6 off
IdentLookups off

MaxInstances 30
MaxClients 10
MaxLoginAttempts 10 "Maximum number of allowed users are already connected (%m)"

DefaultRoot ~
AllowFilter "^[a-zA-Z0-9 ,]*$"


Reference: Secure existing ProFTPd server installation

Finally, install CSF
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.