503 Service Unavailable

#1
Just ran a default install, and when trying to access the admin pages or run the test PHP script, it throws up an "Error 503 Service Unavailable," and the errorlog says:


2003-08-04 12:12:16.167 [WARN] Start FCGI [fcgiAdminPHP]: failed to bind to localhost:7202, fast cgi might be running,

Any ideas?
 

mistwang

LiteSpeed Staff
#2
rebuild php binary

Can you please tell me more about your system? Which distrubtion? Redhat? Suse?
We were informed that our pre-built php binary does not work well on Redhat 9 because of newer version of glibc. So please rebuild php binary from source if you can.

Please use PHP 4.3.1, 4.3.2 is buggy. build it as following:

cd php-4.3.1
./configure --enable-fastcgi --with-config-file-path=../conf
make
cp -f sapi/cgi/php [lsws_home]/admin/fast-cgi/admin_php
cp -f sapi/cgi/php [lsws_home]/fast-cgi/php

Best regards,
Mistwang
 
#3
Thanks. I have Redhat 8, but have updated glibc since I first installed so I guess therein lies the problem.

Downloaded 4.3.1, but I get this error now during configure:

...
Updated php_version.h
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

Many thanks..
 

mistwang

LiteSpeed Staff
#4
compile PHP

You are welcome.

Did you install gcc?
Did you set PATH env correctly?

With the new glibc, you may also have problem during compilation. If it complains about "errno" in MySQL library, just modify

php-4.3.1/ext/mysql/libmysql/global.h

add a line at the beginning
Code:
#include <errno.h>
just after
Code:
#define _global_h
Best regards,
Gang
 

mistwang

LiteSpeed Staff
#5
try again

We just fixed a bug in PHP binary related to the new glibc library and it runs properly on redhat 9 now.
You can download our repackaged binary package and try again. See if it is fixed.

Best regards,
Mistwang
 
#6
Okay thanks for your help so far. Managed to build PHP as you instructed, still getting a 503 though. Error log throws up:

2003-08-04 20:50:40.600 [WARN] Start FCGI [fcgiAdminPHP]: failed to bind to localhost:7202, fast cgi might be running,

Any thoughts?
 

mistwang

LiteSpeed Staff
#7
change the port for fcgiAdminPHP

Two possible causes:

1. the old admin_php is still running:
use command:
Code:
ps -ef | grep php
to list running php processes, kill them all. and try again, the web server will create new php processes automatically. if it still does not work restart web server.

2. Port 7202 is use by other daemon process.
Use command:
Code:
netstat -an | grep 7202
to check whether port 7202 is used by other application. If it is in use, above command will produce some output. If it is, change the port for admin PHP by editing file
lsws/admin/conf/admin_config.xml
search for localhost:7202 and change it to a unused port.

Please post your result.

Mistwang
 
#8
This is just wierd and frustrating now...

Wasn't possibility number 1.

netstat -an | grep 7202 revealed it was being used, so I changed it to 5158 (which wasn't being used)

netstat -an | grep 5158 now reveals:

tcp 0 0 127.0.0.1:5158 0.0.0.0:* LISTEN

So its almost as if it is listening on this port then it tries to start listening (again?!) when a request is put through??
 

mistwang

LiteSpeed Staff
#9
Need to test your PHP binary.

Do not give up yet. :)

What you observed is normal. Once you try to access the admin interface, the web server will bind (use) port 5158 and start PHP, so when you do netstat again, it shows port 5158 is in use, if you kill all the running PHP processes, that port will be released.

For some reason the Fast CGI interface on PHP side is broken and no request can be completed, when that happens, web server will try to restart PHP engine and try again, but the port is still used by left over PHP processes. That is the reason why you saw that warning.

First we need to make sure your PHP binary is ok. Try it form command line first, see if there is any error messages, run "php -i" to make sure Fast CGI interface is enabled (configured with --enable-fastcgi).
If configuration file path for PHP is set to /usr/local/lib (it is the default value, my instrution change it to ../conf), make sure the notice logging is not enabled, it will break the fast CGI interface.

Then turn on server's debug logging by editing file "lsws/conf/httpd_config.xml", change "debugLevel" to 10. stop server, kill all PHP processes, start server again and access the PHP test page (not the admin interface).

If you still get 503, compress the error log and send it to bugs@litespeedtech.com.

We will try our best to help you.

Thank you for your patience.

Mistwang
 

mistwang

LiteSpeed Staff
#11
Problem solved

The problem is the configuration of IPTables (Linux Firewall), after adding rule

ALLOW INPUT from LO

PHP works fine.
 
#12
some trouble

I have a some trouble.

I compiled PHP 4.3.4 manually, and when I try to start server fastcgi create core dump in fcgi-bin

My system is Gentoo

Php compiled with

./configure --host=i686-pc-linux-gnu --sysconfdir=/etc --localstatedir=/var/lib --without-readline --with-ndbm=/usr --with-db4=/usr --with-mcrypt=/usr --with-mhash=/usr --with-gdbm=/usr --without-pgsql --with-xpm-dir=/usr/X11R6 --with-pdflib=/usr --with-gd --enable-gd-native-ttf --with-png --with-png-dir=/usr --with-jpeg --with-jpeg-dir=/usr --enable-exif --with-tiff --with-tiff-dir=/usr --with-mysql=/usr --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-freetype-dir=/usr --with-ttf=/usr --with-t1lib=/usr --with-gettext --with-qtdom=/usr/qt/3 --with-pspell=/usr --with-openssl=/usr --without-imap --without-ldap --with-dom=/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --without-kerberos --with-pam --disable-memory-limit --disable-ipv6 --without-curl --enable-dbx --with-zlib --with-zlib-dir=/usr --with-sablot=/usr --enable-xslt --with-xslt-sablot --with-xmlrpc --enable-wddx --with-xml --enable-mbstring=all --enable-mbregex --with-bz2=/usr --with-crack=/usr --with-cdb --enable-bcmath --enable-calendar --enable-dbase --enable-filepro --enable-ftp --with-mime-magic --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvipc --with-iconv --enable-shmop --enable-dio --enable-inline-optimization --enable-track-vars --enable-trans-sid --enable-versioning --with-config-file-path=/etc/php/apache2-php4 --enable-fastcgi --enable-discard-path --disable-path-info-check --with-config-file-path=../conf
 

mistwang

LiteSpeed Staff
#13
Some thing wrong with your PHP binary, maybe module conflictions, check the core file with gdb see if you can figure some thing out.

There are two "--with-config-file-path" parameters in your configuration.

I suggest You compile php with basic configuration,parameters, make sure it works, then add additional parameter gradually.

You can try "--enable-debug" as well.

Please keep us posted with the resolution.

Thanks for trying our product.
 
#14
I recompile with

'./configure' \
'--host=i686-pc-linux-gnu' \
'--sysconfdir=/etc' \
'--localstatedir=/var/lib' \
'--without-readline' \
'--with-ndbm=/usr' \
'--with-db4=/usr' \
'--with-mcrypt=/usr' \
'--with-mhash=/usr' \
'--with-gdbm=/usr' \
'--without-pgsql' \
'--with-xpm-dir=/usr/X11R6' \
'--with-pdflib=/usr' \
'--with-gd' \
'--enable-gd-native-ttf' \
'--with-png' \
'--with-png-dir=/usr' \
'--with-jpeg' \
'--with-jpeg-dir=/usr' \
'--enable-exif' \
'--with-tiff' \
'--with-tiff-dir=/usr' \
'--with-mysql=/usr' \
'--with-mysql-sock=/var/run/mysqld/mysqld.sock' \
'--with-freetype-dir=/usr' \
'--with-ttf=/usr' \
'--with-t1lib=/usr' \
'--with-gettext' \
'--with-pspell=/usr' \
'--with-openssl=/usr' \
'--without-imap' \
'--without-ldap' \
'--with-dom=/usr' \
'--with-dom-xslt=/usr' \
'--with-dom-exslt=/usr' \
'--without-kerberos' \
'--with-pam' \
'--disable-memory-limit' \
'--disable-ipv6' \
'--without-curl' \
'--enable-dbx' \
'--with-zlib' \
'--with-zlib-dir=/usr' \
'--with-sablot=/usr' \
'--enable-xslt' \
'--with-xslt-sablot' \
'--with-xmlrpc' \
'--enable-wddx' \
'--with-xml' \
'--enable-mbstring=all' \
'--enable-mbregex' \
'--with-bz2=/usr' \
'--with-crack=/usr' \
'--with-cdb' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-dbase' \
'--enable-filepro' \
'--enable-ftp' \
'--with-mime-magic' \
'--enable-sockets' \
'--with-iconv' \
'--enable-shmop' \
'--enable-dio' \
'--enable-inline-optimization' \
'--enable-track-vars' \
'--enable-trans-sid' \
'--enable-versioning' \
'--enable-fastcgi' \
'--enable-discard-path' \
'--disable-path-info-check' \
'--with-config-file-path=../conf' \
'--prefix=/usr' \
'--mandir=/usr/share/man' \
'--infodir=/usr/share/info' \
'--datadir=/usr/share' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--enable-sysvipc' \

and all OK;

but when I try

/opt/lsws/bin/lswsctrl stop
killall php
/opt/lsws/bin/lswsctrl start

I see this in 'ps axf'
[code:1:53873193d9]
PID TTY STAT TIME COMMAND
1 ? S 0:05 init
2 ? SW 0:00 [keventd]
3 ? SWN 0:00 [ksoftirqd_CPU0]
4 ? SW 0:08 [kswapd]
5 ? SW 0:00 [bdflush]
6 ? SW 0:02 [kupdated]
7 ? SW 0:00 [pagebufd]
8 ? SW 0:00 [xfslogd/0]
9 ? SW 0:00 [xfsdatad/0]
295 ? SW 0:00 [khubd]
327 ? SW 0:00 [kreiserfsd]
476 ? S 0:00 /sbin/devfsd /dev
1240 ? S 0:02 /usr/sbin/syslogd -m 0
1242 ? S 0:00 /usr/sbin/klogd -c 3 -2
1708 ? SW 0:00 [eth0]
1778 ? S 0:00 /usr/sbin/cron
1942 ? S 0:02 /usr/X11R6/bin/xfs -daemon -config /etc/X11/fs/config -droppriv -user xfs -port -1
1955 ? S 0:00 login -- root
1961 vc/1 S 0:00 \_ -bash
504 vc/1 S 0:00 \_ /bin/sh /usr/X11R6/bin/startx
515 vc/1 S 0:00 \_ xinit /etc/X11/xinit/xinitrc -- -nolisten tcp -deferglyphs 16
516 ? S< 2:07 \_ /etc/X11/X :0 -nolisten tcp -deferglyphs 16
522 vc/1 S 0:00 \_ /bin/sh /etc/X11/Sessions/kde-3.1.4
537 vc/1 S 0:00 \_ /bin/sh --login /usr/kde/3.1/bin/startkde
588 vc/1 S 0:00 \_ kwrapper ksmserver
1956 vc/2 S 0:00 /sbin/agetty 38400 tty2 linux
1957 vc/3 S 0:00 /sbin/agetty 38400 tty3 linux
1958 vc/4 S 0:00 /sbin/agetty 38400 tty4 linux
1959 vc/5 S 0:00 /sbin/agetty 38400 tty5 linux
1960 vc/6 S 0:00 /sbin/agetty 38400 tty6 linux
10867 ? SW 0:00
9822 ? SW 0:00 \_
10504 ? SW 0:00 \_
12157 ? SW 0:00 \_
13763 ? SW 0:00 \_
14700 ? SW 0:00 \_
15105 ? SW 0:00 \_
17067 ? SW 0:00 \_
18548 ? SW 0:00 \_
21074 ? SW 0:00 \_
25939 ? SW 0:00 \_
30352 ? SW 0:00 \_
31072 ? SW 0:00 \_
448 ? SW 0:00 \_
698 ? SW 0:00 \_
1051 ? SW 0:00 \_
2369 ? SW 0:00 \_
3208 ? SW 0:00 \_
5898 ? SW 0:00 \_
10390 ? SW 0:00 \_
12765 ? SW 0:00 \_
14570 ? SW 0:00 \_
16141 ? SW 0:00 \_
17565 ? SW 0:00 \_
18601 ? SW 0:00 \_
19783 ? SW 0:00 \_
21358 ? SW 0:00 \_
21394 ? SW 0:00 \_
21947 ? SW 0:00 \_
22958 ? SW 0:00 \_
24373 ? SW 0:00 \_
25392 ? SW 0:00 \_
26317 ? SW 0:00 \_
27069 ? SW 0:00 \_
27821 ? SW 0:00 \_
27827 ? SW 0:00 \_
28713 ? SW 0:00 \_
29287 ? SW 0:00 \_
31116 ? SW 0:00 \_
780 ? SW 0:00 \_
874 ? SW 0:00 \_
1792 ? SW 0:00 \_
3819 ? SW 0:00 \_
3955 ? SW 0:00 \_
4976 ? SW 0:00 \_
5063 ? SW 0:00 \_
5138 ? SW 0:00 \_
5235 ? SW 0:00 \_
6194 ? SW 0:00 \_
6278 ? SW 0:00 \_
7346 ? SW 0:00 \_
8599 ? SW 0:00 \_
9676 ? SW 0:00 \_
11544 ? SW 0:00 \_
13626 ? SW 0:00 \_
14711 ? SW 0:00 \_
15382 ? SW 0:00 \_
16983 ? SW 0:00 \_
18208 ? SW 0:00 \_
18784 ? SW 0:00 \_
19498 ? SW 0:00 \_
20338 ? SW 0:00 \_
20866 ? SW 0:00 \_
21397 ? SW 0:00 \_
22149 ? SW 0:00 \_
22626 ? SW 0:00 \_
22975 ? SW 0:00 \_
23513 ? SW 0:00 \_
24723 ? SW 0:00 \_
24921 ? SW 0:00 \_
28106 ? SW 0:00 \_
29696 ? SW 0:00 \_
30522 ? SW 0:00 \_
31782 ? SW 0:00 \_
719 ? SW 0:00 \_
1729 ? SW 0:00 \_
3006 ? SW 0:00 \_
3587 ? SW 0:00 \_
3971 ? SW 0:00 \_
4537 ? SW 0:00 \_
5341 ? SW 0:00 \_
6067 ? SW 0:00 \_
6893 ? SW 0:00 \_
7131 ? SW 0:00 \_
7514 ? SW 0:00 \_
8086 ? SW 0:00 \_
8497 ? SW 0:00 \_
9130 ? SW 0:00 \_
10024 ? SW 0:00 \_
10809 ? SW 0:00 \_
11747 ? SW 0:00 \_
12497 ? SW 0:00 \_
13323 ? SW 0:00 \_
13813 ? SW 0:00 \_
14736 ? SW 0:00 \_
15495 ? SW 0:00 \_
16803 ? SW 0:00 \_
18057 ? SW 0:00 \_
19361 ? SW 0:00 \_
19747 ? SW 0:00 \_
20464 ? SW 0:00 \_
21329 ? SW 0:00 \_
22579 ? SW 0:00 \_
24008 ? SW 0:00 \_
26586 ? SW 0:00 \_
30057 ? SW 0:00 \_
30319 ? SW 0:00 \_
30379 ? SW 0:00 \_
31418 ? SW 0:00 \_
31486 ? SW 0:00 \_
32443 ? SW 0:00 \_
1739 ? SW 0:00 \_
2884 ? SW 0:00 \_
4422 ? SW 0:00 \_
6051 ? SW 0:00 \_
6801 ? SW 0:00 \_
7842 ? SW 0:00 \_
8661 ? SW 0:00 \_
9689 ? SW 0:00 \_
11040 ? SW 0:00 \_
15460 ? SW 0:00 \_
17058 ? SW 0:00 \_
18102 ? SW 0:00 \_
21177 ? SW 0:00 \_
23600 ? SW 0:00 \_
25817 ? SW 0:00 \_
27614 ? SW 0:00 \_
29887 ? SW 0:00 \_
30377 ? SW 0:00 \_
31082 ? SW 0:00 \_
32195 ? SW 0:00 \_
3188 ? SW 0:00 \_
5700 ? SW 0:00 \_
9152 ? SW 0:00 \_
11194 ? SW 0:00 \_
12310 ? SW 0:00 \_
14588 ? SW 0:00 \_
16030 ? SW 0:00 \_
16088 ? SW 0:00 \_
16124 ? SW 0:00 \_
16163 ? SW 0:00 \_
16201 ? SW 0:00 \_
17338 ? SW 0:00 \_
18397 ? SW 0:00 \_
20408 ? SW 0:00 \_
21765 ? SW 0:00 \_
22992 ? SW 0:00 \_
23728 ? SW 0:00 \_
24698 ? SW 0:00 \_
25559 ? SW 0:00 \_
26296 ? SW 0:00 \_
27180 ? SW 0:00 \_
28066 ? SW 0:00 \_
29173 ? SW 0:00 \_
30639 ? SW 0:00 \_
32031 ? SW 0:00 \_
405 ? SW 0:00 \_
1091 ? SW 0:00 \_
2446 ? SW 0:00 \_
2733 ? SW 0:00 \_
3470 ? SW 0:00 \_
5776 ? SW 0:00 \_
10281 ? SW 0:00 \_
11670 ? SW 0:00
 
#15
See prev post

process with scrathed names replaced fast-cgi processes

then I reboot system and start lswhttp
all OK, no scratched processes
 
Top