• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Best Way to Separate Mail and Hosting Domain on Same Server

smirking

New Pleskian
I have a situation that might be becoming increasingly common. I have a small SAAS platform where I provide an information repository for a customer that is basically an aliased domain. I'm using a multi-site setup of Drupal to serve multiple sites off of one instance. This works quite well on the Web end of things. All I have to do is add a domain alias and the setup works.

I run into problems because the customers often also need email services and Mailman. I could run a separate server for this, but I'd like to keep things on one server for ease of maintenance reasons.

Ideally, I would setup a domain twice, but Plesk doesn't allow that. If I use a domain as a domain alias, I can't then create separate mail accounts for it as a stand alone hosting domain.

I've found a way that seems to work for me, but I wanted to check with the Plesk guys to see if the way I'm doing it is ok or if there's a better way to do it. I'm overriding the vhost conf settings for the Mail Only domain to assign it to the docroot of the parent site and changing the SuexecUserGroup to that of the parent site's user.

SITE 0 Setup as a Web Hosting Domain (My Main Site)
- PHP 5.6 FastCGI
- Docroot: /var/www/vhosts/site0/httpdocs

SITE 1 Setup as a Web Hosting Domain (Mail Only Domain)
- Customize the Apache nginx settings with the custom directives below.

<VirtualHost 127.0.0.1:80 >
DocumentRoot "/var/www/vhosts/site0/httpdocs"
CustomLog /var/www/vhosts/system/site0/logs/access_ssl_log plesklog
ErrorLog "/var/www/vhosts/system/site0/logs/error_log"

<IfModule mod_suexec.c>
SuexecUserGroup "site0_user" "psacln"
</IfModule>

<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/system/site0/etc/php.ini
FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX plesk-php56-fastcgi
FcgidMaxRequestLen 134217728
FcgidIOTimeout 240
</IfModule>
TimeOut 240
<Directory /var/www/vhosts/site0/httpdocs>
<IfModule mod_fcgid.c>
<Files ~ (\.php$)>
SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .php
Options +ExecCGI
</Files>
</IfModule>
SSLRequireSSL
Options -Includes -ExecCGI
</Directory>
</VirtualHost>
 
Back
Top