Mapping centrally installed roundcube for virtual domains

Hi all,

I have the LAMP stack setup on CentOS 6.2 with virtual domains.

On local disk, my virtual domains are here:

/var/www/vhosts/domain1

/var/www/vhosts/domain2

/var/www/vhosts/domain3

and Apache’s default location for web files is : /var/www/html.

I have roundcube installed at this default location and it maps to http://www.myserver.com/webmail/roundcube

Question #1: How can I map this installation to the virtual domains such that for the virtual domains, users would be able to access roundcube by going to: www.domain1.com/webmail/roundcube

and still get to the same roundcube installation I installed centrally?

2:

How can I do the same for PostfixAdmin which is at myserver.com/postfixadmin?

Thanks in advance for you help and suggestions.

2 Replies

Not sure if you need a separate configuration file for each host, but if not, you could install the app in your vhost area like:

/var/www/vhosts/rc

Then for each virtual host you want to have access to it, add an Alias to the virtual host entry for them like using perhaps a non-standard name for it (prevent bot scans looking for the app)…

   Alias /MyWebMail  "/var/www/vhosts/rc"

Then your virtual hosts would be able to get to it with a link like:

  http://myclient.domain.tld/MyWebMail

I do the same thing with my phpMyAdmin by using an alias name that has nothing to do with the app, so far off the wall, I forget sometimes what it is. It is also behind a rule set to prevent access except via specific known IP's though as well.

Not sure about PostfixAdmin as I have never seen it.

To your comment about your default Apache location… I make even the default page a virtual host. I call it junk. It has a page which displays a you got to the wrong place page along with some basic info as to what link they tried. This allows me to catch the crap hits that try connection via IP only, and also provides a nice looking page when a virtual host has been taken offline (many times a project site) or is not yet configured.

I just make the first entry in the virtual hosts conf file like:

 <virtualhost *:80="">ServerAdmin     "webmaster at domain.tld"
    DocumentRoot    /www/vhosts/junk
    ErrorLog        logs/junk.errors
    CustomLog       logs/junk.combined combined</virtualhost> 

Thanks a lot @Dweeber, its working now.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct