Something Odd... Roundcube going to WebsiteB on System

In short everything is working – but one minor detail.

I have PcComputerGuy.com and InthePublicSquare.com on my linode running LAMP.

I have added RoundCube for mail. I want anyone that goes to http://webmail.MyDomains.com to go to httpS://webmail.mydomains.com.

OK: IF I go to httpS://webmail.mydomains.com all is perfect. both end up at roundcube w/ SSL.

PROBLEM: If I go to http://webmail.mydomains.com for some unknown reason to me, I get the homepage http://www.InthePublicsquare.com.

DESIRED: Instead of redirection to http://www.InThePublicSquare.com - I'd like to find out what, where is telling it to do that, and instead have it go to httpS://webmail.mydomains.com.

I'm sure I can accomplish this via some rewrite rules and such, but there is something wrong somewhere. I cant figure out why it's ending up at http://www.inthepublicsquare.com.

Here are the VH Files.

# domain: PcComputerGuy.com
# public: /home/njellis/public/PcComputerGuy.com/

 <virtualhost *:80=""># Admin email, Server Name (domain name), and any aliases
  ServerAdmin ****@PcComputerGuy.com
  ServerName  PcComputerGuy.com
  ServerAlias www.PcComputerGuy.com

DocumentRoot /home/njellis/public/PcComputerGuy.com/public

 <directory home="" njellis="" public="" pccomputerguy="">Include /etc/apache2/conf/DrupalDirectory.conf</directory> 

#Podcast Subsite
 <directory home="" njellis="" public="" pccomputerguy.com="" podcast="">DirectoryIndex index.php

#    Options Indexes FollowSymLinks MultiViews

#    AllowOverride All

#    Order allow,deny
#    Allow from all</directory> 

  # Log file locations
  LogLevel warn
  ErrorLog  /home/njellis/public/log/PCCG/error.log
  CustomLog /home/njellis/public/log/PCCG/access.log combined

Include /etc/apache2/conf/DrupalRewrite.conf</virtualhost> 

############ SSL VirtualHost ###################

 <virtualhost *:443="">SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin ****@PcComputerGuy.com
  ServerName  PcComputerGuy.com
  ServerAlias www.PcComputerGuy.com

DocumentRoot /home/njellis/public/PcComputerGuy.com/public

 <directory home="" njellis="" public="" pccomputerguy="">Include /etc/apache2/conf/DrupalDirectory.conf</directory> 

  # Log file locations
  LogLevel warn
  ErrorLog  /home/njellis/public/PcComputerGuy.com/log/error.log
  CustomLog /home/njellis/public/PcComputerGuy.com/log/access.log combined

Include /etc/apache2/conf/DrupalRewrite.conf</virtualhost> 

Website ITPS

# domain: InThePublicSquare.com
# public: /home/njellis/public/InThePublicSquare.com/

 <virtualhost *:80=""># Admin email, Server Name (domain name), and any aliases
  ServerAdmin ****@inthepublicsquare.com
  ServerName  InThePublicSquare.com
  ServerAlias www.InThePublicSquare.com

DocumentRoot /home/njellis/public/InThePublicSquare.com

 <directory home="" njellis="" public="" inthepublicsquare.com="">Include /etc/apache2/conf/DrupalDirectory.conf</directory> 

  # Log file locations
  LogLevel warn
  ErrorLog  /home/njellis/public/log/ITPS/error.log
  CustomLog /home/njellis/public/log/ITPS/access.log combined

Include /etc/apache2/conf/DrupalRewrite.conf</virtualhost> 

RoundCube:

# Those aliases do not work properly with several hosts on your apache server
# Uncomment them to use it or adapt them to your configuration
#    Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
#    Alias /roundcube /var/lib/roundcube

# Access to tinymce files
 <virtualhost *:443="">SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

    ServerAdmin ****@pccomputerguy.com
    ServerName webmail.pccomputerguy.com
    ServerAlias mail.* webmail.*
    DocumentRoot /var/lib/roundcube
    Alias /program/js/tiny_mce/ /usr/share/tinymce/www/

 <directory "="" usr="" share="" tinymce="" www="">Options Indexes MultiViews FollowSymLinks
      AllowOverride None
      Order allow,deny
      allow from all</directory> 

 <directory var="" lib="" roundcube="">Options +FollowSymLinks
  # This is needed to parse /var/lib/roundcube/.htaccess. See its
  # content before setting AllowOverride to None.
  AllowOverride All
  order allow,deny
  allow from all</directory> 

# Protecting basic directories:
 <directory var="" lib="" roundcube="" config="">Options -FollowSymLinks
        AllowOverride None</directory> 

 <directory var="" lib="" roundcube="" temp="">Options -FollowSymLinks
        AllowOverride None
    Order allow,deny
    Deny from all</directory> 

 <directory var="" lib="" roundcube="" logs="">Options -FollowSymLinks
        AllowOverride None
    Order allow,deny
    Deny from all</directory></virtualhost> 

Thanks ahead for reading and your suggestions!

4 Replies

I'm not sure why your setup isn't working, but you didn't describe the problem very well (your MyDomains.com stuff is confusing).

http://webmail.PcComputerGuy.com & http://webmail.InthePublicSquare.com both display the contents of http://www.InthePublicSquare.com (though the webmail subdomain is still displayed).

  • this is because InthePublicSquare.com is the default domain on your IP address so they probably don't know where to point and end up showing the contents of the default domain.

Using httpS points both to the RoundCube install, which is what you want.

You can fix this easy enough using redirects in htaccess - even if it's just for now (until you fine tune your config).

Sorry, by "mydomains" I mean any domain on my linode.

So https://webmail.pccomputerguy.com works as desired. https://webmail.inthepublicsquare.com also works as desired. Both end up at the same roundcube page. Over time there will be an additional domains added as well.

I want http://webmail.pccomputerguy.com to go to https://webmail.pccomputerguy.com

I also want http://webmail.inthepublicsquare.com to go to https://webmail.inthepublicsquare.com

Something, somewhere is wrong and is sending http://webmail.pccomputerguy.com and http://webmail.inthepublicsquare.com both to http://****www****.inthepublicsquare.com

I think I understand what you mean about it just serving the default page. However, pccomputerguy.com was the first domain, inthepublicsquare was just added a couple days ago. Also if you go to something else that would "confuse" the server, such as joe.pccomputerguy.com or joe.inthepublicsquare.com, you get nothing; so for those "unknown" things it bombs. So that would suggest that it isn't that my config is just sending "unknwon" stuff to inthepublicsquare, but rather it does know somewhere, it just knows wrong! Haha.

Thanks for your suggestion. I'd really like to know what's wrong and fix that, rather than band-aid with a redirect.

if you go to http://50.116.45.83 you see the content for inthepublicsquare.com

if you go to httpS://50.116.45.83 you are redirected to pccomputerguy.com

Clearly your VPS has a touch of Multiple Domain Disorder :wink:

Thanks for pointing that out. I seemed to have correct that by renaming the virtualhost files alphabetically with my primary site (pccomputerguy.com) as the first (i.e. 000-PcComputerGuy.com). It seems if InThePublicSquare comes first, then it becomes the "main domain" for the ip.

However the same problem still persists. I've attempted to move roundcube config as the very first file (before pccomputerguy) and that didn't work. It didnt work at the end either. I still have the same issue.

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