Webapps not redirected to hostname after move to FastCGI

Tristan

Verified User
Joined
Feb 11, 2005
Messages
590
Location
The Netherlands
Used this guide: https://docs.directadmin.com/webservices/php/general.html#how-to-switch-to-fastcgi to switch from PHP-FPM to FastCGI since this DirectAdmin server is only used by one user and needed to do some speed optimisations.

Unfortunately the webapps links like for example the domain.com/webmail link seem broken after this change, it just redirects to the debian default http://debian.example.com/roundcube while hostname is set correctly and use_hostname_for_alias is set to yes and configs were rewritten after this change. Is there anything I'm missing here?
 
Last edited:
So that is the hostname I presume? You don't have that force hostname redirect in effect in directdadmin.conf have you?

Maybe it helps if you set the roundcube link again?
Code:
/usr/local/directadmin/directadmin set webmail_link roundcube
service directadmin restart

and after that this one again:
Code:
cd /usr/local/directadmin/custombuild
./build rewrite_confs

Are you using anything special like Litespeed or something like that or is it plain apache?
 
So that is the hostname I presume? You don't have that force hostname redirect in effect in directdadmin.conf have you?
Nope, it literally redirects to debian.example.com/roundcube and the hostname is something like server123.prism.nl.

Maybe it helps if you set the roundcube link again?
Code:
/usr/local/directadmin/directadmin set webmail_link roundcube
service directadmin restart

and after that this one again:
Code:
cd /usr/local/directadmin/custombuild
./build rewrite_confs
Nope, didn't help, the webmail to roundcube link already worked, it's just the hostname part it seems to get wrong.

Are you using anything special like Litespeed or something like that or is it plain apache?
Nope, just plain apache. Thanks for thinking along here with me, maybe it's just a bug with DirectAdmin?
 
Seems indeed some default thing is used, odd indeed.

You could try to rebuild roundcube, see if that helps or otherwise, try a ./build all which often fixes issues.
 
Rebuilding RoundCube doesn't work either I'm afraid, doing a "build all" seems a bit much to solve a simple redirection bug. I still don't get why CustomBuild would write debian.example.com everywhere in the /etc/httpd/conf/extra/httpd-alias.conf file while the hostname is something completely different.
 
Seems somewhere it does not "see" the hostname, since it's in the httpd-alias.conf as you say, it seems apache is doing this.
If you find a ./build all too much, maybe you can try a ./build apache.

Indeed it seems like some odd redirection bug, but that is something @smtalk or @fln might want to have a look at. Shouldn't happen by just changing to fastcgi and doing the ./build rewrite_confs afterwards.
 
Yeah looks like an error in the add_alias_redirect() function of the build script, it's using REDIRECT_HOST_OPT which is populated like:

Bash:
HN_T=${HOSTNAME}
REDIRECT_HOST_OPT=`getOpt [B]redirect_host[/B] ${HN_T}`

Upon further inspection; I wasn't reading that second line correctly. It obviously uses redirect_host from the options.conf file to populate the REDIRECT_HOST_OPT. I don't get any hits if I search for that string on the docs site or via Google; Your search - site:docs.directadmin.com "redirect_host" - did not match any documents only found this very old thread on the forum. But if you set redirect_host and redirect_host_https in your options.conf it will work as expected again.

Why they choose to use a default example value from options.conf over the actual working hostname set by the OS or the
servername and ssl_redirect_host values as already set in directadmin.conf is a mystery to me.
 
Last edited:
Back
Top