Forum Replies Created

Viewing 12 replies - 61 through 72 (of 72 total)
  • Thanks laughhearty for posting your fix – works like a treat – Cheers

    Hi Epicus
    Just a quick thank you for taking the time to write the above post.

    I was just about to embark on a very similar journey to yourself, you have saved me a few hours of wasted time and resources – not to mention frustrations.

    Thanks again
    Brad

    Thread Starter brad1004

    (@brad1004)

    Hi All

    Update

    Ok so I have given up on using actual and virtual subdomains through Plesk panel – If you search this forum for plesk problems you will find that many people have had similar problems.

    I did however find someone do stated they had found a way around at least using your webmail with virtual subdomains and will include their solution below.
    I have not tested this solution

    If you have a Virtual Private Server [VPS] on a CentOS and use Plesk as a control panel and want to add Wildard “*” DNS entry while still maintaining webmail.domain.com, then you have come to the right place.

    Throughout the steps, replace domain.com with your actual domain name.

    When you add ServerAlias *.domain.com to the vhost.conf file, the already working webmail.domain.com will no longer work, as the wildcard will catch that.

    How to add Wildcard “*” DNS entry

    In your domain, select DNS Settings

    Click Add Record

    Select CNAME for Record Type; put * into domain name and domain.com for the canonical name. [You may use A record type too]

    Login to PowerPanel [Parallels Power Panel] as root

    – click File Manager
    – go to / var/ www/ vhosts/ domain.com/ conf/
    – there you’ll find httpd.include do not edit this. This is automatically updated by Plesk.
    – create/update another file vhost.conf
    – enter only

    ServerAlias *.domain.com

    – do not enter <VirtualHost inside the file. this file will be included inside httpd.include. So that syntax already exists.

    To run commands, you can use SSH Client. In PowerPanel, click “SSH Connection” and Login.

    – after the creation of vhost.conf file, we need to run the update. run the following. If no error message is displayed, then all is good.

    – # /usr/local/psa/admin/bin/websrvmng -av

    – whether the vhost.conf was new or not, you will need to reload the Apache configuration:

    – # /etc/init.d/httpd reload

    If you want, you can restart Apache using the command:

    – # /sbin/service httpd restart

    Now you have added the Wildcard “*” DNS Entry in both DNS Settings and vhost.conf. Let’s make sure AtMail is working.

    How to make AtMail working even after adding Wildcard “*” DNS entry

    Click File Manager

    – go to / etc/ httpd/ conf.d/

    You’ll see a file called

    zz_atmail_vhost.conf

    This is the AtMail configuration file. Because the filename starts with “zz” it is at the bottom of sort order. It is this order Apache processes the configuration. So we need to put this file just above zz010_psa_httpd.conf [in your server, you may not find exactly this file. You should find something similar to this name].

    So I just renamed our zz_atmail_vhost.conf to zz001_atmail_vhost.conf
    This put the file just above our zz010_psa_httpd.conf [note: I tried putting atmail_vhost.conf, which put it at the top, but that made viewing received emails impossible]

    Now you need to restart qmail.
    You can restart qmail using Plesk under Server -> Service Management. You can use ’service qmail restart’ on CentOS.

    Even after this, if you still not able to view received emails, just restart your container [PowerPanel].

    This is not necessary but you can rebuild Qmail configuration files using /usr/local/psa/admin/sbin/mchk utility.

    Test:

    check webmail.domain.com is working [make sure sending, receiving and able to read received emails working]
    check your wildcard dns working [that is your dynamic subdomains you may already have working]
    check any domain alias you may have working.
    check your main domain.com working

    Hi Andrea

    So just to confirm for us others reading this post if you were to delete all subdomain sites and then change this
    define( ‘SUBDOMAIN_INSTALL’, false );

    Everything would be work with subfolders?

    Kind regards
    Brad

    Thread Starter brad1004

    (@brad1004)

    And here is the actual file

    # ATTENTION!
    # DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
    # FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
    # MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
    # FOLLOWING FILE(S):
    # /var/www/vhosts/mysite.com/conf/vhost.conf
    # /var/www/vhosts/mysite.com/conf/vhost_ssl.conf
    # /var/www/vhosts/mysite.com/subdomains/<subdomain-name>/conf/vhost.conf
    
    <IfModule mod_ssl.c>
    
    <VirtualHost 10.10.10.101:443>
            ServerName   mysite.com:443
            ServerAlias  www.mysite.com
            UseCanonicalName Off
                    SuexecUserGroup         me123 psacln
            ServerAdmin  [email protected]
            DocumentRoot /var/www/vhosts/mysite.com/httpdocs
            CustomLog  /var/www/vhosts/mysite.com/statistics/logs/access_ssl_log plesklog
            ErrorLog  /var/www/vhosts/mysite.com/statistics/logs/error_log
    <IfModule mod_userdir.c>
            UserDir /var/www/vhosts/mysite.com/web_users
    </IfModule>
            ScriptAlias  /cgi-bin/ /var/www/vhosts/mysite.com/cgi-bin/
            Alias  /plesk-stat /var/www/vhosts/mysite.com/statistics/
            <Location  /plesk-stat/>
                    Options +Indexes
            </Location>
            <Location  /plesk-stat/logs/>
                    Require valid-user
            </Location>
            Alias  /webstat /var/www/vhosts/mysite.com/statistics/webstat
            Alias  /webstat-ssl /var/www/vhosts/mysite.com/statistics/webstat-ssl
            Alias  /ftpstat /var/www/vhosts/mysite.com/statistics/ftpstat
            Alias  /anon_ftpstat /var/www/vhosts/mysite.com/statistics/anon_ftpstat
            Alias  /awstats-icon /var/www/html/awstats/icon
            SSLEngine on
            SSLVerifyClient none
            SSLCertificateFile /usr/local/psa/var/certificates/certBde8111
            <Directory /var/www/vhosts/mysite.com/httpdocs>
            <IfModule mod_perl.c>
            <Files ~ (\.pl$)>
                    SetHandler perl-script
                    PerlHandler ModPerl::Registry
                    Options ExecCGI
                    allow from all
                    PerlSendHeader On
            </Files>
            </IfModule>
            <IfModule sapi_apache2.c>
                    php_admin_flag engine on
                    php_admin_flag safe_mode off
                    php_admin_value open_basedir "/var/www/vhosts/mysite.com/httpdocs:/tmp"
            </IfModule>
            <IfModule mod_php5.c>
                    php_admin_flag engine on
                    php_admin_flag safe_mode off
                    php_admin_value open_basedir "/var/www/vhosts/mysite.com/httpdocs:/tmp"
            </IfModule>
            <IfModule mod_fcgid.c>
                    <Files ~ (\.fcgi)>
                            SetHandler fcgid-script
                            Options +FollowSymLinks +ExecCGI
                    </Files>
            </IfModule>
                    SSLRequireSSL
                    Options +Includes +ExecCGI
            </Directory>
            <Directory /var/www/vhosts/mysite.com/web_users>
            <IfModule sapi_apache2.c>
                    php_admin_flag engine off
            </IfModule>
            <IfModule mod_php5.c>
                    php_admin_flag engine off
            </IfModule>
            </Directory>
    </VirtualHost>
    
    </IfModule>
    
    <VirtualHost 10.10.10.101:80>
            ServerName   mysite.com:80
            ServerAlias  www.mysite.com
            UseCanonicalName Off
            SuexecUserGroup         me123 psacln
            ServerAdmin  "[email protected]"
            DocumentRoot /var/www/vhosts/mysite.com/httpdocs
            CustomLog  /var/www/vhosts/mysite.com/statistics/logs/access_log plesklog
            ErrorLog  /var/www/vhosts/mysite.com/statistics/logs/error_log
    <IfModule mod_userdir.c>
            UserDir /var/www/vhosts/mysite.com/web_users
    </IfModule>
            ScriptAlias  /cgi-bin/ /var/www/vhosts/mysite.com/cgi-bin/
            Redirect permanent /plesk-stat https://mysite.com/plesk-stat
            Redirect permanent /webstat https://mysite.com/webstat
            Redirect permanent /webstat-ssl https://mysite.com/webstat-ssl
            Redirect permanent /ftpstat https://mysite.com/ftpstat
            Redirect permanent /anon_ftpstat https://mysite.com/anon_ftpstat
            Redirect permanent /awstats-icon https://mysite.com/awstats-icon
            <IfModule mod_ssl.c>
                    SSLEngine off
            </IfModule>
            <Directory /var/www/vhosts/mysite.com/httpdocs>
            <IfModule mod_perl.c>
            <Files ~ (\.pl$)>
                    SetHandler perl-script
                    PerlHandler ModPerl::Registry
                    Options ExecCGI
                    allow from all
                    PerlSendHeader On
            </Files>
            </IfModule>
            <IfModule sapi_apache2.c>
                    php_admin_flag engine on
                    php_admin_flag safe_mode off
                    php_admin_value open_basedir "/var/www/vhosts/mysite.com/httpdocs:/tmp"
            </IfModule>
            <IfModule mod_php5.c>
                    php_admin_flag engine on
                    php_admin_flag safe_mode off
                    php_admin_value open_basedir "/var/www/vhosts/mysite.com/httpdocs:/tmp"
            </IfModule>
            <IfModule mod_fcgid.c>
                    <Files ~ (\.fcgi)>
                            SetHandler fcgid-script
                            Options +FollowSymLinks +ExecCGI
                    </Files>
            </IfModule>
                    Options +Includes +ExecCGI
            </Directory>
            <Directory /var/www/vhosts/mysite.com/web_users>
            <IfModule sapi_apache2.c>
                    php_admin_flag engine off
            </IfModule>
            <IfModule mod_php5.c>
                    php_admin_flag engine off
            </IfModule>
            </Directory>
            Include /var/www/vhosts/mysite.com/conf/vhost.conf
    </VirtualHost>
    
    <VirtualHost 10.10.10.101:80>
            ServerName   1helpdesk.mysite.com:80
            SuexecUserGroup         me123 psacln
            ServerAdmin  "[email protected]"
            DocumentRoot /var/www/vhosts/mysite.com/subdomains/1helpdesk/httpdocs
            CustomLog  /var/www/vhosts/mysite.com/statistics/logs/access_log plesklog
            ErrorLog  /var/www/vhosts/mysite.com/statistics/logs/error_log
            ScriptAlias  /cgi-bin/ /var/www/vhosts/mysite.com/subdomains/1helpdesk/cgi-bin/
            <IfModule mod_ssl.c>
                    SSLEngine off
            </IfModule>
            <Directory  /var/www/vhosts/mysite.com/subdomains/1helpdesk/httpdocs>
            <IfModule sapi_apache2.c>
                    php_admin_flag engine on
                    php_admin_flag safe_mode off
                    php_admin_value open_basedir "/var/www/vhosts/mysite.com/subdomains/1helpdesk/httpdocs:/tmp"
            </IfModule>
            <IfModule mod_php5.c>
                    php_admin_flag engine on
                    php_admin_flag safe_mode off
                    php_admin_value open_basedir "/var/www/vhosts/mysite.com/subdomains/1helpdesk/httpdocs:/tmp"
            </IfModule>
            <IfModule mod_fcgid.c>
                    <Files ~ (\.fcgi)>
                            SetHandler fcgid-script
                            Options +FollowSymLinks +ExecCGI
                    </Files>
            </IfModule>
                    Options -Includes +ExecCGI
            </Directory>
    </VirtualHost>
    Thread Starter brad1004

    (@brad1004)

    Hi Please find a copy of the code below

    Iv’e been told that –
    This lives external to the core config within a separate vhost.conf

    [root@myhosting conf]# cat vhost.conf
    ServerAlias *.mysite.com

    This is the way Plesk implements bespoke configurations. You will see the include for vhost.conf at the bottom of the main configuration file. – Also mentioned by my host –

    Thanks
    Brad

    Thread Starter brad1004

    (@brad1004)

    Ok so I have now done a new install on a test site (same host) to deal with the www. issue which now proves that is not an issue at all

    Thread Starter brad1004

    (@brad1004)

    Hi Just waiting for the code to come through and will post it

    Excuse my ignorance again but could it have something to do with the www. My main site is called https://www.mysite.com in the WordPress panel and under options the recommended network admin email address is [email protected]
    My config file has my site listed as https://www.mysite.com

    Thanks
    Brad

    Thread Starter brad1004

    (@brad1004)

    Thanks for clearing that up

    Brad

    Thread Starter brad1004

    (@brad1004)

    Hi I am still going around in circles with this one and running out of ideas – any help would be greatly appreciated
    Brad

    Thread Starter brad1004

    (@brad1004)

    Thanks for that – It does seem rather amazing , ha but I suspose so is WordPress ??

    Thread Starter brad1004

    (@brad1004)

    Hi – Thank you both for your suggestions I have added my two actual subdomains to the Banned names and my host has also added these subdomains to my Apache config file above the wildcard entry.
    Results – absolute no change – I am still being redirected as before
    Any further help would be appreciated
    Is anyone else using actual and wildcard subdomains successfully ?
    Brad
    P.s have also updated to the latest build

Viewing 12 replies - 61 through 72 (of 72 total)