FastCGI not working

cwfie

Verified User
Joined
Aug 3, 2005
Messages
91
Hi All :)

I have followed this tutorial:

http://help.directadmin.com/item.php?id=520

I did it as:
cd /usr/local/directadmin/custombuild
./build update
./build set php1_release 5.3
./build set php2_release no
./build set php1_mode fastcgi
./build set mod_ruid2 no
./build set use_hostname_for_alias yes

Followed by:
./build php n
./build rewrite_confs

However my phpinfo still shows:
Server API Apache 2.0 Handler

Also the apachectl -M command does not show that fastcgi is loaded.

Can anyone point me in the right direction? Thanks!

In addition, should this cover changing the rights for the current users?

#!/bin/sh
for i in `ls /usr/local/directadmin/data/users`; do
{
chmod -R 755 /home/$i/domains/*/private_html/
chmod -R 755 /home/$i/domains/*/public_html/
chown -R $i:$i /home/$i/domains/*/private_html/
chown -R $i:$i /home/$i/domains/*/public_html/ }
done;
 
Last edited:
The following is needed for fastcgi to work (for the first time):
Code:
cd /usr/local/directadmin/custombuild
./build update
./build apache
 
The following is needed for fastcgi to work (for the first time):
Code:
cd /usr/local/directadmin/custombuild
./build update
./build apache

Thanks for your answer. I have used the commands from your instruction, however it still does not work.
Do you have any other suggestions maybe?
 
Do you have any files in /usr/local/directadmin/custombuild/custom or /usr/local/directadmin/data/templates/custom ?
 
Yes, I do actually,

ap2/configure.php5 (for adding imap support)

Do I need to add a rule here for fastcgi?

Thanks! :)
 
No, this file should not affect it. If you would like me to, I could provide you free help for the issue.
 
CustomBuild 2.0 upgrade instructions were not followed:
Code:
[root@shared01 custombuild]# ./build version
1.2.41

That was the main problem why it did not work. Upgrade to CustomBuild 2.0 has been done, and php-fastcgi works without any problems now.
 
Thanks smtalk, your help is much appreciated.

One last question if I may:

We've used this setting for the webmail:
./build set use_hostname_for_alias yes

Would it be possible to use the IP (http://IP/roundcube) instead of the hostname? This way the clients from my resellers cannot see the hostname.

Thanks.
 
Yes, you could use the IP there. That setting might be not needed in the future versions of CB 2.0. For now it is only fastcgi, which needs redirection (for example, php-fpm does not).
 
Yes, you could use the IP there. That setting might be not needed in the future versions of CB 2.0. For now it is only fastcgi, which needs redirection (for example, php-fpm does not).

Thank you: how do I change this, I suppose "./build set use_ip_for_alias yes" would not work :)?
 
The following should do the trick:
Code:
cd /usr/local/directadmin/custombuild
./build set redirect_host [B]YOUR_IP_HERE
[/B]./build rewrite_confs
 
The following should do the trick:
Code:
cd /usr/local/directadmin/custombuild
./build set redirect_host [B]YOUR_IP_HERE
[/B]./build rewrite_confs

Thanks, only issue is that www.<domain>.com/roundcube does not redirect to <IP>/roundcube this way. It did work when I used the hostname. Is there a fix to this :)?
 
Or is there a smarter way where I can use a white-label domain as webmail URL? Such as webmail.<domain>.com where all clients can access this? If so, how to do this?
 
May I check that (free of cost) on your server to see why it does not work? :)
 
Martynas advises me to switch to PHP-FPM:
http://help.directadmin.com/item.php?id=459

Everything seems to run smoothly now! :) Thanks Martynas.

Can anyone advise me the recommend limits for my server?

<IfModule mpm_prefork_module>
StartServers 3
MinSpareServers 3
MaxSpareServers 5
MaxClients 30
MaxRequestsPerChild 0
</IfModule>

I have to add them to /etc/httpd/conf/httpd.conf right?

Thanks :)
 
You should change MPM related settings in /etc/httpd/conf/extra/httpd-mpm.conf. And in your case it should be event MPM loaded, not the prefork one. Good luck! :)
 
You should change MPM related settings in /etc/httpd/conf/extra/httpd-mpm.conf. And in your case it should be event MPM loaded, not the prefork one. Good luck! :)

Hi Martynas,

I should only edit this?

<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 16
MaxSpareThreads 64
ThreadsPerChild 32
ServerLimit 16
MaxRequestWorkers 320
MaxConnectionsPerChild 0
</IfModule>

What would be good values voor 2 virtual cores and 3GB memory?

in /etc/httpd/conf/extra/httpd-mpm.conf?

No need to edit /etc/httpd/conf/httpd.conf?

Thanks :)
 
Back
Top