Webmaster Forum

Go Back   Webmaster Forum > Web Development > Web Hosting Forum > Dedicated Servers

Dedicated Servers Dedicated server help.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 01-08-2004, 08:11 AM
QT_'s Avatar
QT_ QT_ is offline
v7n Mentor
 
Join Date: 10-13-03
Location: San Antonio, Tx
Posts: 327
iTrader: 0 / 0%
[Linux] Compile Apache with a higher FD_SETSIZE

** Note: These instructions are for a Red Hat Linux 9 server. They will work on other versions of Red Hat Linux, but some of the RPM package names will be different.

1. Login to your server and "su -" to root.

2. Download and install the source RPM. You can find this file at any official Red Hat Linux mirror.

# wget ftp://mirrors.kernel.org/redhat/redh...0-21.9.src.rpm
# rpm -Uvh httpd-2.0.40-21.9.src.rpm

3. You need to edit a couple system include files to increase the FD_SETSIZE. Since we don't want this change to apply to everything we compile, make backup copies of the files before modifying them.

# cp /usr/include/bits/types.h /usr/include/bits/types.h-bak
# cp /usr/include/linux/posix_types.h /usr/include/linux/posix_types.h-bak

4. Edit those two files and change the "#define __FD_SETSIZE" lines:

#define __FD_SETSIZE 1024 # <- change this
#define __FD_SETSIZE 16384 # <- to this

5. You also need to adjust the httpd init script to allow more open files. Open /usr/src/redhat/SOURCES/httpd.init in your favorite editor and add the following line right above "Source function library".

ulimit -n 16384 # <- add this line
# Source function library
. /etc/rc.d/init.d/functions

6. Rebuild the RPM. The build process may take a while.

# rpmbuild -bb /usr/src/redhat/SPECS/httpd.spec

7. When the build process is complete, you will see several lines that begin with "Wrote:" and list the .rpm files which were created. You can now install those RPMs.

# rpm -Uvh --force /usr/src/redhat/RPMS/i386/httpd*2.0.40-21.5.i386.rpm /usr/src/redhat/RPMS/i386/mod_ssl-2.0.40-21.5.i386.rpm

8. You must perform a full restart of httpd for the changes to take effect.

# /sbin/service httpd stop
# /sbin/service httpd start

9. Check your httpd error log (/var/log/httd/error_log) and try to connect to a site on your server to make sure httpd is running properly.

10. Replace the include files that we modified.

# mv /usr/include/bits/types.h-bak /usr/include/bits/types.h
# mv /usr/include/linux/posix_types.h-bak /usr/include/linux/posix_types.h
 
Reply With Quote

Advertisement

Advertisement

Go Back   Webmaster Forum > Web Development > Web Hosting Forum > Dedicated Servers

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Domain Parking [Linux, Plesk, Apache] Rob Dedicated Servers 5 12-06-2008 01:41 AM
php and apache livecoder Coding Forum 3 09-06-2007 09:29 PM
[Linux] Set up Virtual Hosts on Apache QT_ Dedicated Servers 0 01-08-2004 08:03 AM
[Linux/SSH] Add sites to Apache. QT_ Dedicated Servers 0 01-08-2004 07:32 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 05:25 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC