{"id":183,"date":"2010-11-27T16:42:48","date_gmt":"2010-11-27T15:42:48","guid":{"rendered":"http:\/\/almin.tf\/blog\/?p=183"},"modified":"2020-05-03T14:36:36","modified_gmt":"2020-05-03T13:36:36","slug":"roundcube-debian","status":"publish","type":"post","link":"https:\/\/almic.fr\/blog\/2010\/11\/27\/roundcube-debian\/","title":{"rendered":"Roundcube sous Debian"},"content":{"rendered":"<p style=\"text-align: justify;\">Roundcube est un webmail simple et efficace. Voici comment je l\u2019ai install\u00e9 sous Debian.<\/p>\n<p><!--more--><\/p>\n<p>Pour commencer :<\/p>\n<p><code># apt-get install roundcube<\/code><\/p>\n<p style=\"text-align: justify;\">Il y a quelques informations \u00e0 renseigner dans <i>\/etc\/roundcube\/main.inc.php<\/i>.<\/p>\n<p><code>$rcmail_config['default_host'] = 'tls:\/\/serveur';<br \/>\n$rcmail_config['imap_auth_type'] = PLAIN;<br \/>\n$rcmail_config['smtp_server'] = 'tls:\/\/serveur';<br \/>\n$rcmail_config['use_https'] = true;<br \/>\n$rcmail_config['password_charset'] = 'UTF-8';<\/code><\/p>\n<p style=\"text-align: justify;\">Pour acc\u00e9der \u00e0 roundcube en SSL, et avec une adresse de la forme webmail.domaine.tld, on va cr\u00e9er un virtualhost apache.<\/p>\n<p><code># cp \/etc\/roundcube\/apache.conf \/etc\/apache2\/sites-enabled\/webmail.domaine.tld<\/code><\/p>\n<p>Au d\u00e9but du fichier, rajoutez :<\/p>\n<pre>< VirtualHost *:443 >\r\n       ServerName webmail.domaine.tld\r\n       ServerAdmin webmaster@domaine.tld\r\n       SSLEngine on\r\n       SSLCertificateFile \/etc\/ssl\/private\/webmail.pem\r\n       DocumentRoot \/var\/lib\/roundcube\/<\/pre>\n<p style=\"text-align: justify;\">Ensuite vient le contenu de \/etc\/roundcube\/apache.conf, en laissant les sections dans le m\u00eame ordre, et avec une seule modification : la ligne <i>< Directory \/var\/lib\/roundcube\/ ><\/i> devient <i>< Directory \/ ><\/i>. \u00c0 la fin, on rajoute le reste de la config du virtualhost.<\/p>\n<pre>       ErrorLog \/var\/log\/apache2\/webmail-error.log\r\n       LogLevel warn\r\n       CustomLog \/var\/log\/apache2\/webmail-access.log combined\r\n< \/VirtualHost ><\/pre>\n<p style=\"text-align: justify;\">S\u2019il y a plusieurs virtualhosts sur cette machine, on ne veut pas qu\u2019un petit malin trouve roundcube en rajoutant un s dans l\u2019url. On va rajouter un autre virtualhost ssl, qui fera office de garde-fous. Dans \/etc\/apache2\/ports.conf, rajoutez la ligne en gras.<\/p>\n<pre><  IfModule mod_ssl.c>\r\n    # If you add NameVirtualHost *:443 here, you will also have to change\r\n    # the VirtualHost statement in \/etc\/apache2\/sites-available\/default-ssl\r\n    # to <VirtualHost *:443>\r\n    # Server Name Indication for SSL named virtual hosts is currently not\r\n    # supported by MSIE on Windows XP.\r\n    <b>NameVirtualHost *:443<\/b>\r\n    Listen 443\r\n< \/IfModule ><\/pre>\n<p style=\"text-align: justify;\">Puis au d\u00e9but de <i>\/etc\/apache2\/sites-enabled\/webmail.domaine.tld<\/i> :<\/p>\n<pre>< VirtualHost *:443 >\r\n    ServerAdmin webmaster@localhost\r\n    SSLEngine on\r\n    SSLCertificateFile \/etc\/ssl\/certs\/ssl-cert-snakeoil.pem\r\n    SSLCertificateKeyFile \/etc\/ssl\/private\/ssl-cert-snakeoil.key\r\n    RewriteEngine on\r\n    RedirectMatch 302 ^(.*)$ http:\/\/perdu.com\/?\r\n    ErrorLog \/var\/log\/apache2\/protectssl-error.log\r\n    LogLevel warn\r\n    CustomLog \/var\/log\/apache2\/protectssl-access.log combined\r\n< \/VirtualHost ><\/pre>\n<p>On g\u00e9n\u00e8re le certificat :<\/p>\n<p><code># openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout \/etc\/ssl\/private\/webmail.pem -out \/etc\/ssl\/private\/webmail.pem<\/code><\/p>\n<p>On relance apache :<\/p>\n<p><code># service apache2 restart<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Roundcube est un webmail simple et efficace. Voici comment je l\u2019ai install\u00e9 sous Debian.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-hebergement","radius"],"_links":{"self":[{"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":11,"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":481,"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions\/481"}],"wp:attachment":[{"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/almic.fr\/blog\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}