Hi,
I'm trying to install a Drupal multisite with Virtualmin so that every site has his own mailbox.
1) I created in Virtualmin the "domain1.com" top-level server. I copied the drupal core files in /home/domain1/public_html/
2) In "/home/domain1/public_html/sites/" I create the folder : "domain1.com". In the browser I go to www.domain1.com/install.php and install Drupal.
3) In virtualmin I create a new server called "domain2.com" which is alias of domain1.com.
4) In "/home/domain1/public_html/sites/" I create the folder : "domain2.com". In the browser I go to www.domain2.com/install.php and install Drupal.
5) This works fine from the websites point of view: when I type "www.domain1.com" in the browser, the page for domain1.com shows, and when I type "www.domain2.com" in the browser, the page for domain2.com shows.
I can create an email address XXX@domain1.com and when I type "www.domain1.com:20000" in the browser I can access the email.
However, I tried to create an email address XXX@domain2.com and didn't find any way to do it.
So I did the following further steps :
6) In Virtualmin I delete the server alias domain2.com since it can't have any email addresses that end in "@domain2.com".
7) I create a new top-level server for domain2.com in Virtualmin. Now the email should be ok.
8) I edit the file /etc/apache2/sites-available/domain2.com.conf : I change the line "DocumentRoot /home/domain2/public_html" and replace it with "DocumentRoot /home/domain1/public_html" because I would like to use the Drupal multisite install which is locate in the "/home/domain1/public_html/sites" folder
Now when I try to access "www.domain2.com" in the browser I get the following error : "Forbidden You don't have permission to access / on this server."
I guess this is because the user created with the domain2.com top-level server tries to access the directory public-html in the folder of domain1.
What can I do? I need to either:
A) Find a way to have a mailbox for a server alias B) Allow other users to access directories in domain1 folder.
Thanks!
Trying A) to give an email to server alias "domain2":
I noticed that when "domain2.com" is selected in the Virtualmin drop-down selector, if I click on Server Configuration / DNS Options then click on Save, a list of links shows up.
If I click on "Manage mail and FTP users", I have new options such as "Add a user to this server".
When I click on "Add a user to this server", I can create a new user "user2", with email address such as "contact@domain2.com" and in "Email settings' the radio button for "Primary email address enabled?" is set to "Yes".
However when I click on save, then check back by clicking on the user name, the radio button "Primary email address enabled?" has automatically been switched to "No". Also if I try to login at "domain2.com:20000" with the user just created "user2" and the email address "contact@domain2.com", I get the error "Failed to create /home/domain1/domains/domain2.com/homes/contact/.usermin : No such file or directory"
It's actually pretty simple.
Instead of creating a server alias or a sub-server, I create a top-level server for domain2.com.
Then I erase the public_html folder located at /home/domain2/public_html
Last I login the command line and I type " ln -sf /home/domain1/public_html/ /home/domain2/ " so instead of a public_html folder in domain2 there will be a symlink pointing to the public_html folder of domain1.
also the cool thing is that you can install roundcube for just domain1, and it will work for domain2 as well since they share the public_html