Own roundcube address on server with DirectAdmin and OpenLiteSpeed
The following guide describes how to configure our roundcube to be available at webmail.domena.pl
webmail.domena.pl can be replaced with any prefix Pocztowy.domena.pl, roundcube.domena.pl itp.
We log into the terminal of our server as root and create a new file:
1 | nano /usr/local/directadmin/data/templates/custom/cust_openlitespeed.CUSTOM.8.pre |
The content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | virtualHost poczta.|SDOMAIN|-|VH_PORT| { |CUSTOM| user webapps group webapps vhRoot /var/www/html allowSymbolLink 1 enableScript 1 restrained 1 setUIDMode 2 # listeners listener1, listener2, listener3 listeners |LISTENERS| #VirtualHost config settings docRoot /var/www/html/roundcube vhDomain poczta.|SDOMAIN| vhAliases poczta.|SDOMAIN| adminEmails |ADMIN| enableGzip 1 enableIpGeo 1 errorlog |APACHELOGDIR|/|LOG_NAME|.error.log { useServer 0 logLevel NOTICE rollingSize 0 } accesslog |APACHELOGDIR|/|LOG_NAME|.log { useServer 0 logFormat %a %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i" logHeaders 5 rollingSize 0 } accesslog |APACHELOGDIR|/|LOG_NAME|.bytes { useServer 0 logFormat %O %I rollingSize 0 } scripthandler { add lsapi:|SCRIPTHANDLER| inc add lsapi:|SCRIPTHANDLER| php add lsapi:|SCRIPTHANDLER| phtml add lsapi:|SCRIPTHANDLER| php|PHP1_RELEASE| } phpIniOverride { php_admin_flag engine |PHP| php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f |PHP_EMAIL|" |CLI_PHP_MAIL_LOG| |*if HAVE_SAFE_MODE="1"| php_admin_flag safe_mode |SAFE_MODE| |*endif| } rewrite { enable 1 autoLoadHtaccess 1 |FORCE_SSL_REDIRECT| } |*if SSL_TEMPLATE="1"| vhssl { |CUSTOM6| keyFile |KEY| certFile |CERT| certChain 1 sslProtocol |SSLPROTOCOL| } |*endif| # include aliases include /usr/local/lsws/conf/httpd-alias.conf } |
save the file.
post office. we replace with the address chosen by us
We go to the cd custombulid directory:
1 | cd /usr/local/directadmin/custombuild |
We are reloading the configuration:
1 | ./build rewrite_confs |
So that all our domains on the server, by default, after being created in the directadmin panel, also have access to the webmail at mail.domena.pl
We do the following:
Go to the directory:
1 | cd /usr/local/directadmin/data/templates |
We copy the file :
1 | cp dns_a.conf custom |
Go to the directory:
1 | cd custom |
We add an entry so that new dns zones are created with the appropriate record:
1 | echo "poczta=|IP|" >> dns_a.conf |
If we already have domains in the directadmin panel and we want to make them also a roundcube at mail.domena.pl
We go to the dns zone and add the A record
1 | poczta A IPSERWERA |
If the mail.domain.pl address is to be encrypted using the https protocol:// you need to generate the certificate again to the address Pocztowy.domena.pl