Global Apache Alias using SuExec and mod_fcgid


Does anyone have tips on creating a server-wide alias "/webmail" that maps to say /usr/share/roundcubemail that uses the mod_fcgid wrapper and run as each domain users?

I’m getting suexec errors and am interested to hear if anyone has tried doing this.


Hey Ryan,

You’re mixing up how suexec is willing to work. If you want it to run as each individual domain owner user, you’ll need it to be installed for each domain. No way to avoid that–the file has to be owned by the domain owner account.

But a shared instance should be fine. It’s just a mail client, and reads data via IMAP, and everything is on the same server. There is the problem of virtual name mapping (which Usermin can handle correctly with the right configuration, but the others have a hard time with because they don’t have access to the Postfix virtual map).

Hey Joe

Well there’s two things that I have tried :

1st : Location /
created a wwwroot user
copied the mail client into /home/wwwroot/public_html/roundcubemail
add a /webmail alias globally to /home/wwwroot/public_html/roundcubemail

then in each virtual server I added one of these:

<Location "/">
Options -Indexes IncludesNOEXEC FollowSymLinks ExecCGI
allow from all
AddHandler fcgid-script .php
FCGIWrapper /home/usersaccountname/fcgi-bin/php5.fcgi .php

Seemed to work… any problem with doing it this way?

It would be good if apache could dynamically work out the users home dir.

2nd thing I tried was:

ProxyPass /webmail
ProxyPassReverse /webmail

Bit yucky this

What are your thought’s on these options?


ok, i have a little thought here, i have done something similar except with a sub-domain, but i looked around my “sites-available” folder on my machine and came across something that might help, i have modified it slightly from its original form so that it fits into your particular instance, now this thought is for a “global” directory that is “non-existent” meaning that you don’t need to have multiple installs of the software and you don’t need to worry about getting emails from clients saying their web-mail is broken or missing files or that they accidentaly deleted a file in it or it all together. the code can be done multiple ways. the first is in full and to be appended to the “default” site the second can be setup as an optional “alias” that you can either append to the template or have it as “available upon request”

[code:1]Alias /webmail /usr/share/roundcubemail
<Directory /usr/share/roundcubemail>
AllowOverride AuthConfig Limit
Options MultiViews IncludesNoExec FollowSymLinks
DirectoryIndex index.html index.php

[code:1]Alias /webmail /usr/share/roundcubemail[/code:1]

both of those should work to perform the same task, the downfall of using any of these 2 ways is that any mail user on the server can log into their account via any domain on the server. for this reason i suggest to the append the alias line to the root domain apache site of the server.