Apache Virtual host

  • Hello,
    I want to change the aliases.
    when one of the users to write mail.example.com opened his webmail which is currently located Adress admin.example.com/ webmail / .


    I tried to change the following line of 00_master.conf

    Code
    1. Alias mail.* /var/www/imscp/gui/public/tools/webmail


    But no change.
    when i write mail.example.com an then it`s opened my main home page.

    OpEn YouR mINd , OpeN YouR SourcE cOdE

  • Create a seperate vhost for that.
    Copy 00_master.conf to 00_webmail.conf.



    - Delete all the Alias lines.
    - And add/replace this lines:

    Code
    1. ServerName mail.example.com
    2. ServerAlias mail.* webmail.*
    3. DocumentRoot /var/www/imscp/public/tools/webmail


    - Leave the rest as is (php configuration etc.)


    After that restart apache.


    If you have SSL activated do this again with a copy of master_ssl.conf. But SSL certificates won't match then. A redirect to the imscp domain would be better suited in this case.

  • Hello
    Thank you for your help. But I want to do it for all users so as to write mail.personaldomain.com opens the roundcube webmail.

    OpEn YouR mINd , OpeN YouR SourcE cOdE


  • Hello
    Thank you for your help. But I want to do it for all users so as to write mail.personaldomain.com opens the roundcube webmail.


    This:

    Code
    1. ServerAlias mail.* webmail.*


    responds to all domains.

  • This:

    Code
    1. ServerAlias mail.* webmail.*


    responds to all domains.


    I did everything you said, but it gives me this error
    sudo a2ensite 00_webmail.conf
    ERROR: Site 00_webmail.conf does not exist!

    OpEn YouR mINd , OpeN YouR SourcE cOdE


  • sudo a2ensite 00_webmail.conf
    ERROR: Site 00_webmail.conf does not exist!


    Where did you save the file?
    It should be at /etc/apache2/sites-available/
    And you should've copied the 00_master from there, sorry that I didn't point that out...

    Edited once, last by Jadawin ().