Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Roundcubemail and Owncloud folders live on the document root but because of the limitations of the Roundcube OwnCloud Plug-in I have to organise the vhosts as below. $rcmail_config['owncloud_url'] = 'https://webmail.whitecube.com/owncloud'; - this URL cannot change or the plug-in breaks.

<VirtualHost 172.21.11.48:8080>
    ServerAlias      "webmail.example.com"
    DocumentRoot    "/var/www/html"
</VirtualHost>  

<VirtualHost 172.21.11.48:8080>
    ServerAlias  "cloud.example.com"
    DocumentRoot "/var/www/html/owncloud"  
</VirtualHost>  

But now requests to webmail.example.com result in the Apache test page in the document root, not the roundcube folder. It seems the most elegant way to fix this is to alias to the roundcube folder rather than trying to redirect or rewrite the url with roundcubemail on the end. I this correct and how do you do it?

Requests to webmail.example.com should be mapped to /var/www/html/roundcubmail. Requests to cloud.example.com should continue to be mapped to "/var/www/html/owncloud". Cloud must be in the webroot of webmail so that its is available to the plugin. I really just want to skip down a level in he directory tree on requests to webail.

share|improve this question

2 Answers 2

If you need to keep /owncloud/ in the final URL, then you must redirect. Rewriting or aliasing won't help.

share|improve this answer
    
Hi Capsule thanks for replying, I've been a bit more specific in my original post - with requests to webail.example.com I just want to skip down a level in the directory to make webail.example.com go to webmail.example.com/roundcubemail - without having to append roundcubemail to the url. –  Steve Oct 22 '13 at 11:09
    
Then you should use the roundcubemail directory as document_root for the webmail.example.com vhost. Sorry but you question is still not clear enough. –  Capsule Oct 22 '13 at 13:25
    
Hi Capsule thats the crux of the problem, if I change the document root of webmail.example.com from /var/www/html to /var/www/html/roundcubemail everything works the way I want it to but it breaks he plugin which must be able to access both roundcubmail and owncloud. The $rcmail_config['owncloud_url'] = 'webmail.whitecube.com/owncloud'cannot point to a different subdomain. –  Steve Oct 22 '13 at 14:37

Try in this way,

create a symlink for both the directories if there is no two different databases maintained by round cube and make that as their respective documentroot.

share|improve this answer
    
Hi Rootslash thanks for replying I've updated the question and comments to be a bit more specific. Do I need two sylink? I only want to go from webmail.example.com (document root /var/www/html) to /var/www/html/rouncubemail WITHOUT changing the Document root in the VHost? –  Steve Oct 22 '13 at 14:33
    
Simply, why can't you make the document root for both webmail.example.com and cloud.example.com to /var/www/html/roundcubmail. –  rootslash Oct 22 '13 at 14:49
    
Rootslash I love the simplicity of your suggestion but wouldn't that prevent access to cloud.example.com?. Even though the plugin will dislplay owncloud inside roundcubemail I suspect that people will want to access owncloud independantly of rundcubemail including my boss. And it would mean moving the owncloud folder inside the roundcube folder and owncloud advise against this.Though as simplst is usually best perhaps... –  Steve Oct 22 '13 at 15:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.