PDA

View Full Version : Zeus+FastCGI+PHP


nuno
12-22-02, 00:59
Hey :)
About our thread at vB.com Paul, i'm wondering about all that aliases and handlers, are they relative to docroot or zeushome?
Damn, i'm going nuts :D

Paul
12-22-02, 01:53
The 'Requests for...' is relative to docroot and the 'Are mapped to...' is the real and full path on your server. Unless it's a remote responder and then the mapped to is a server : port.

These fancy GUIs can be confusing when you're used to working with text config files. :)

After you're familiar with it and it's all running you'll definately be happy with it... honest! :)

nuno
12-22-02, 11:05
Yup, i really love the .conf files, a lot easier to work with.
I asked you about the paths coz i've managed to get things going with Apache+FastCGI, and this is how i've done it.
Grabbed:
fcgi-2.2.12.tar.gz -> DevKit
mod_fcgi -> Apache Module -> this is later dumped into <apachedir>/usr/modules/fastcgi
untar it
done a

# ./configure
# make
# make install

all done with fastcgi
now compiling php

# ./configure --prefix=/usr/local ......... --with-fastcgi --with-apache=../apache_1.3.27.....
# make
# make install

all done with php

going to apache

# ./configure --prefix=/usr/local ....... --enable-module=src/modules/fastcgi/ libfastcgi.a
# make
# make install

Notice that no libphp4.a module is activated.
Done with apache.
editing httpd.conf

FastCgiServer /usr/local/bin/php
AddHandler php-fastcgi .php
<Location /bin/php>
SetHandler fastcgi-script
</Location>
Action php-fastcgi /bin/php
DirectoryIndex index.html index.shtml index.cgi index.php
AddType application/x-httpd-php .php

Now this puzzled me :confused:
Both lines containing /bin/php, for fastcgi to work i had to create a bin directory under htdocs Apache directory and dump php executable into it.
Like this, fastcgi will work.
Any feedback Paul? :)
BTW, you're back to Zeus, i saw that. ;) :D

Paul
12-22-02, 13:17
The <Location> directive is always relative to the docroot. If you want to use absolute paths, you shoudl use the <Directory> directive.

In this case, the best option is probably to just create a symlink to the php binary in a real directory off your Apache root called /fcgi-bin/ or something.

PS. How did you know I was on Zeus? You haven't been getting any Bad Gateway errors have you?

nuno
12-22-02, 14:00
Went through your instructions again and *BOOM*, it worked. :)
Zeus+FastCGI working flawlessly!!
Now let's try this baby with phpaccelerator.
Thank you so much Paul ;)

nuno
12-22-02, 15:13
What about gzipping?
Is it possible to install mod_gzip with Zeus :confused:

Paul
12-22-02, 15:24
Originally posted by nuno
What about gzipping?
Is it possible to install mod_gzip with Zeus :confused:
Yes. Under 'Content Compression'

nuno
12-22-02, 16:23
Duh! :D
Thanks. :)

nuno
12-22-02, 18:27
Originally posted by Paul
PS. How did you know I was on Zeus? You haven't been getting any Bad Gateway errors have you?
Blame it on leknor's page :D
BTW, have you notice a serverload increase with Zeus?

Paul
12-22-02, 18:38
Originally posted by nuno
Blame it on leknor's page :D
BTW, have you notice a serverload increase with Zeus?
Nope. I've actually seen a drop in load during peak periods (700 people online). I believe this due to the Zeus's threaded model.

nuno
12-22-02, 18:54
Odd :confused:
Mine went from 1.2 with Apache to 1.7 with Zeus.

...........Zeus's threaded model.

Threaded Model?

Paul
12-22-02, 20:19
Originally posted by nuno
Threaded Model?
Apache forks a new process for each request, whereas Zeus simply starts a new thread within the same process.

Apache 2 also has the option of using threads.

Paul
12-23-02, 12:43
Originally posted by nuno
Odd :confused:
Mine went from 1.2 with Apache to 1.7 with Zeus.

Did you have PHP Accelerator installed with Apache. Once you install with Zeus, you should see it drop well below.

nuno
12-23-02, 14:57
Originally posted by Paul
Did you have PHP Accelerator installed with Apache. Once you install with Zeus, you should see it drop well below.
Yup phpaca1.3.3r1

taribo
02-12-03, 04:47
Hello,

I have a problem when I try to install Apache+PHP+FastCGI. Could help me to
find what is wrong ?


Installation & configuration on Linux RH 7.3 :

sablotron : (XML engine)
-----------

./configure --prefix=/usr/local/sablotron
make && make install


fcgi-2.2.2 :
------------
./configure --prefix=/usr/local/fcgi
make && make install

php 4.3.0:
----------
./configure --prefix=/usr/local/php --with-mysql --with-apache=/usr/local/ap
ache_1.3.27 --with-xslt-sablot=/usr/local/sablotron/ --enable-xslt --with-fa
stcgi=/usr/local/fcgi
make && make install

mod_fastcgi 2.4.0:
------------------

"tar xcvf" of the tarball in the apache_1.3.27/src/modules directory & "mv
mod_fastcgi-2.4.0 mod_fastcgi"

apache 1.3.27 :
---------------
./configure --prefix=/usr/local/apache --activate-module=src/modules/fastcgi
/libfastcgi.a
make && make install


- I configure and install Apache in a chrooted environment (It works fine
and Apache with only PHP works fine too)

- I put the php binary from /usr/local/php/bin in the /usr/local/apache/bin
directory

- In my httpd.Conf, I put the following lines to handle fastcgi :

#Fast-CGI
FastCgiServer /bin/php <= path in my chrooted env (ie
/usr/local/apache/bin)
AddHandler php-fastcgi .php
<Location /> <= root directory for my ".php" files
SetHandler fastcgi-script
</Location>
Action php-fastcgi /bin/php

.... and I have the following messages when I try to start the Apache web
server:


Error messages :
----------------

[Tue Feb 11 17:23:43 2003] [info] created shared memory segment #1605632
[Tue Feb 11 17:23:43 2003] [notice] Apache/1.3.27 (Unix) mod_fastcgi/2.4.0
configured -- resuming normal operations
[Tue Feb 11 17:23:43 2003] [info] Server built: Feb 11 2003 18:16:40
[Tue Feb 11 17:23:43 2003] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Tue Feb 11 17:23:43 2003] [notice] FastCGI: process manager initialized
(pid 2122)
[Tue Feb 11 17:23:43 2003] [warn] FastCGI: server "/bin/php" started (pid
2124)
PHP Fatal error: input in flex scanner failed in - on line 1

Fatal error: input in flex scanner failed in - on line 1
[Tue Feb 11 17:23:43 2003] [warn] FastCGI: server "/bin/php" (pid 2124)
terminated by calling exit with status '0'
[Tue Feb 11 17:23:48 2003] [warn] FastCGI: server "/bin/php" restarted (pid
2125)
PHP Fatal error: input in flex scanner failed in - on line 1


Thank you in advance for your help.

Best Regards