Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to view websites due to file limit issue.
#1

When trying to access any web sites or webmail on a plesk server i kept getting the following.

 

Forbidden

You don't have permission to access / on this server.

 

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

 

I bounced the server but httpd didnt restart.

 

did some digging and it looks like it was a file limit issue, this was the output of ulimit -a

 

core file size (blocks, -c) 0

data seg size (kbytes, -d) unlimited

file size (blocks, -f) unlimited

max locked memory (kbytes, -l) unlimited

max memory size (kbytes, -m) unlimited

open files (-n) 1024

pipe size (512 bytes, -p) 8

stack size (kbytes, -s) 8192

cpu time (seconds, -t) unlimited

max user processes (-u) 7168

virtual memory (kbytes, -v) unlimited

 

I increased open files limit to 2048 and restarted httpd ok but still couldnt view websites.

 

Checked the error log and found

 

[warn] new file descriptor 1160 is too large; you pro

bably need to rebuild Apache with a larger FD_SETSIZE (currently 1024)

 

 

And now i am stuck were do i go from here and how?

 

Thanks in advance.

Reply
#2

This isn't a global open file limit issue (hence playing with the kernel won't help), instead its a fixed value inside apache's source. For instance, I have here apache 2.0.58 and checking inside the source:

 



Code:
$ grep -ri FD_SETSIZE *
os/tpf/os.h:#define FD_SETSIZE    2048
....




 

So to increase this value you would need to manually edit that file and set it. Then build apache and install from there. You might note that my value is 2048 by default, so maybe simply upgrading your apache to a newer value would help.

 

If you want a hand building apache, just as more.

 

PS: welcome to the forums!

Reply
#3

Thanks for the response and the welcome

 

The os is redhat 9 and the apache version is 2.0.40.

 

I dont have a clue how to rebuild apache, would it affect any existing websites on there or webmail accounts?

 

And yes any help is more than welcome.

 

I've had a load of linux based dns, radius, netsaint and webservers dumped on me to support so i'm having to learn fast :)

 

 

But i have to admit linux is pretty cool :)

Reply
#4

rh9 is not supported anymore

 

please move to fedora core release 6 (free) or consider another up to date linux os

 

chances are, your issue will go bye bye in the process

 

cheers

anyweb

Reply
#5

Quote:The os is redhat 9 and the apache version is 2.0.40.
 

Hrmm, well its not too old an install of apache but RH9 is very outdated :P So if you have the ability, upgrade the system.

 

Quote:I dont have a clue how to rebuild apache, would it affect any existing websites on there or webmail accounts?
 

Well lets be honest, if it isn't working right now, it can't get any worse? By rights a rebuild of apache, if you install it in a different path, then copy your configuration over, it should "just work" the way it did.

 

Quote:I've had a load of linux based dns, radius, netsaint and webservers dumped on me to support so i'm having to learn fast :)
 

Oh fun!

 

Quote:But i have to admit linux is pretty cool :)
 

[img]<___base_url___>/uploads/emoticons/default_ph34r.png[/img] the linux one! :P

 

You are going to be in a bit of an awkward position, installing from source we would need to know what additional packages options you need (for instance php/python/perl .. or ssl .. or various other options).

 

So do this:



Code:
apache2ctl -V




 

It will tell us the version and compiled options, here is mine as an example:



Code:
# apache2ctl -V
Server version: Apache/2.0.58
Server built:   Dec 22 2006 20:56:17
Server's Module Magic Number: 20020903:12
Server loaded:  APR 0.9.12, APR-UTIL 0.9.12
Compiled using: APR 0.9.12, APR-UTIL 0.9.12
Architecture:   32-bit
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D HTTPD_ROOT="/usr"
-D SUEXEC_BIN="/usr/sbin/suexec2"
-D DEFAULT_PIDLOG="/var/run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="/var/run/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="/etc/apache2/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache2/httpd.conf"




 

So hopefully the info you get, will allow us to build an apache that can directly replace your current apache setup but with the minor modification.

 

So in conclusion,

 

What is the options to a complete system replacement with a newer (and thus less bugs)?

If that is impossible, then what is your apache setup?

Reply
#6

Here is the version and options info

 

# apachectl -V

Server version: Apache/2.0.40

Server built: Nov 27 2003 11:04:06

Server's Module Magic Number: 20020628:0

Architecture: 32-bit

Server compiled with....

-D APACHE_MPM_DIR="server/mpm/prefork"

-D APR_HAS_SENDFILE

-D APR_HAS_MMAP

-D APR_HAVE_IPV6

-D APR_USE_SYSVSEM_SERIALIZE

-D APR_USE_PTHREAD_SERIALIZE

-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT

-D APR_HAS_OTHER_CHILD

-D AP_HAVE_RELIABLE_PIPED_LOGS

-D HTTPD_ROOT="/etc/httpd"

-D SUEXEC_BIN="/usr/sbin/suexec"

-D DEFAULT_PIDLOG="logs/httpd.pid"

-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"

-D DEFAULT_LOCKFILE="logs/accept.lock"

-D DEFAULT_ERRORLOG="logs/error_log"

-D AP_TYPES_CONFIG_FILE="conf/mime.types"

-D SERVER_CONFIG_FILE="conf/httpd.conf"

 

The problem is that this is a live server with 850 email accounts on, allthough they are getting by just using pop3 at the moment.

 

Plus the email/webmail/hosting packages are auto setup, i think this server has a indirect odbc connection to one of my hpux servers so when sales add a new customer it is auto setup.

 

I will be building a new server in a month or two but this one needs to be up and running so i can figure out what the hell i'm migrating. :P

 

Plus hopefully i'll know a bit more about linux then as well.

Reply
#7

Quote:Plus hopefully i'll know a bit more about linux then as well.
 

Lets hope so, ok so .. well it looks a little odd with the HTTPD_ROOT="/etc/httpd" (doesn't that mean your apache is in /etc/httpd ?!?) anyway other than that .. nothing special is there, so lets just do the basic.

 

By the way, I will be doing this "properly", that is we will not be simply installing from source, we will build a RPM and install that :)

 

In preparation put this into a file in ~/.rpmmacros



Code:
%_topdir      %(echo $HOME)/rpmbuild




 

Then continue with this:



Code:
# mkdir ~/rpmbuild/{RPMS,SOURCES,SPECS,SRPMS,BUILD}
# wget http://apache.rmplc.co.uk/httpd/httpd-2.0.59.tar.gz -O ~/rpmbuild/SOURCES/
# cd ~/rpmbuild/SOURCES/
# tar -xzf httpd-2.0.59.tar.gz
# cd httpd-2.0.59
# cp httpd.spec ~/rpmbuild/SPECS




 

Now edit the file that I told you about os/tpf/os.h (or maybe just check that its larger than the 1024 that you seen). Look for the line #define FD_SETSIZE 2048 if it is 2048, then its fine, if its smaller then you need to make it bigger and save the file.

 

IF YOU CHANGE IT, do this:



Code:
# cd ~/rpmbuild/SOURCES
# rm httpd-2.0.59.tar.gz
# tar -cvf httpd-2.0.59.tar httpd-2.0.59/
# gzip -9v httpd-2.0.59.tar




 

If you haven't changed it, then skip that bit above.

 

OK So next!

 



Code:
# cd ~/rpmbuild/SOURCES
# rm -fr http-2.0.59/
# cd ~/rpmbuild/
# rpmbuild -ba SPECS/httpd.spec




 

It should just go away and make a RPM at this point! Lets hope so at least. Once that is done then you should have an RPM you can install.

 

You should BACKUP BACKUP BACKUP, if I haven't made that clear .. backup! hehe. You should do something like this:

 



Code:
# tar cvf /root/backup-apache.tar /etc/httpd/ /var/www




 

I don't know your exact layout, nor the size of your setup so you should consider whatever is the most valid method of backup you do. At minimum you should backup the /etc/httpd directory, it will be the configuration of your of your apache (most important).

 

It might also be worthy of hunting for your original apache RPM, that way you can reinstall it if you find this one provides more issues! heh ;)

 

Ok, so if its gone well and built the RPM. To install it you do this (become root first!):

 



Code:
# cd ~user/rpmbuild/RPMS/
# ls */*
i686/httpd-2.0.59.i686.rpm
# rpm -ivh i686/httpd-2.0.59.i686.rpm




 

That is an example, you might find your arch is different and its not i686, so just look for the entry from the ls command.

 

Any assistance, any issues, just ask more questions.

 

Good luck!

Reply
#8

I'll try this on Tuesday when i can get the go ahead to do it.

 

In the meantime i think i will try to build a duplicate system so i can test and learn a bit more in the process.

 

Thanks for the responses they are greatly appreciated. :)

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)