Difference between revisions of "Roundcube: Instalasi di Ubuntu"

From OnnoWiki
Jump to navigation Jump to search
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
sumber: https://www.howtoforge.com/tutorial/ubuntu-roundcube-latest/
+
sumber:
 +
* https://www.howtoforge.com/tutorial/ubuntu-roundcube-latest/
 +
* https://www.tekfansworld.com/how-to-set-up-an-email-server-with-postfix-dovecot-and-roundcube-on-ubuntu-18-04.html
  
 +
==Instalasi Apps Pendukung==
  
Install LAMP Server
+
Edit repo /etc/apt/sources.list
  
Before starting, you will need to install Apache, MariaDB, and PHP to your system. First, install Apache and MariaDB with the following command:
+
deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse
 +
deb http://archive.ubuntu.com/ubuntu bionic-security main universe multiverse
 +
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe multiverse
  
sudo apt-get install apache mariadb-server php7.2 php7.2-gd php-mysql php7.2-curl php7.2-zip php7.2-ldap php7.2-mbstring php-imagick php7.2-intl php7.2-xml unzip wget curl -y
+
Lakukan
  
Once all the packages are installed, you will need to change Timezone setting in php.ini file. You can do this with the following command:
+
sudo su
 +
locale-gen id_ID.UTF-8
 +
apt update
 +
apt -y install apache2 mariadb-server php7.2 php7.2-gd \
 +
php-mysql php7.2-curl php7.2-zip php7.2-ldap php7.2-mbstring \
 +
php-imagick php7.2-intl php7.2-xml unzip wget curl \
 +
php-pear php-net-imap php-net-smtp php-net-idna2 php-mail-mime php-net-ldap3 \
 +
dovecot-core dovecot-imapd postfix
 +
chown -Rf www-data: /var/www/
  
sudo nano /etc/php/7.2/apache2/php.ini
+
Waktu instalasi postfix set
  
Make the following changes:
+
hostname
 +
Internet Relay Host
  
date.timezone = Asia/Kolkata
 
  
Save and close the file, then start Apache and MariaDB service and enable them to start on boot time using the following command:
+
Set Timezone
  
  sudo systemctl start apache2
+
  sudo vi /etc/php/7.2/apache2/php.ini
sudo systemctl enable apache2
 
sudo systemctl start mysql
 
sudo systemctl enable mysql
 
  
Download Roundcube
+
date.timezone = Asia/Jakarta
  
First, you will need to download the latest version of Roundcube to your system. You can download it with the following command:
+
Start
  
  wget https://github.com/roundcube/roundcubemail/releases/download/1.3.6/roundcubemail-1.3.6-complete.tar.gz
+
  sudo a2enmod rewrite
 +
sudo systemctl start apache2
 +
sudo systemctl enable apache2
 +
sudo systemctl start mysqld
  
Once the download is completed, extract the downloaded file with the following command:
+
==Download Roundcube==
  
tar -xvzf roundcubemail-1.3.6-complete.tar.gz
+
Download, buka, copy & install
 
 
Next, move the extracted directory to the Apache web root directory:
 
 
 
mv roundcubemail-1.3.6 /var/www/html/roundcube
 
 
 
Next, give proper permissions to the roundcube directory:
 
  
 +
cd /usr/local/src
 +
wget https://github.com/roundcube/roundcubemail/releases/download/1.4.1/roundcubemail-1.4.1.tar.gz
 +
tar -xvzf roundcubemail-1.4.1.tar.gz
 +
mv roundcubemail-1.4.1 /var/www/html/roundcube
 
  sudo chown -R www-data:www-data /var/www/html/roundcube
 
  sudo chown -R www-data:www-data /var/www/html/roundcube
 
  sudo chmod -R 775 /var/www/html/roundcube
 
  sudo chmod -R 775 /var/www/html/roundcube
  
Configure the Database
+
==Database==
  
By default, MariaDB installation is not secured. So you will need to secure it first. You can secure it by running the following script:
+
Jika di perlukan buat menjadi secure (bisa di skip jika untuk belajar saja)
  
 
  mysql_secure_installation
 
  mysql_secure_installation
 
Answer all the questions as shown below:
 
  
 
  Change the password for root ? N
 
  Change the password for root ? N
Line 56: Line 65:
 
  Reload privilege tables now? Y
 
  Reload privilege tables now? Y
  
Once the MariaDB is secured, login to MariaDB shell using the following command:
+
Konfigurasi database
 +
 
 +
mysql -u root -p123456
 +
 
 +
CREATE DATABASE roundcubemail;
 +
CREATE USER 'roundcube'@'localhost' identified by 'roundcube';;
 +
GRANT ALL on root.* to roundcubemail@localhost;
 +
GRANT ALL on roundcubemail.* to roundcube@localhost identified by 'roundcube';
 +
GRANT ALL on roundcubemail.* to roundcube identified by 'roundcube';
 +
FLUSH PRIVILEGES;
 +
exit;
 +
 
  
mysql -u root -p
+
Inisialisasi database
  
Enter your root passw**ord, then create a database and user for Roundcube:
+
cd /var/www/html/roundcube
 +
mysql -u roundcube -proundcube roundcubemail < SQL/mysql.initial.sql
  
MariaDB [(none)]> CREATE DATABASE roundcubedb;
+
atau
MariaDB [(none)]> CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'password';
 
MariaDB [(none)]> GRANT ALL PRIVILEGES ON roundcubedb.* to 'roundcube'@'localhost';
 
  
Next, flush the privileges and exit from the MariaDB shell using the following command:
+
  mysql -u roundcube -p roundcubemail < SQL/mysql.initial.sql
 +
Masukan password "roundcube"
  
MariaDB [(none)]> FLUSH PRIVILEGES;
+
==Konfigurasi Postfix==
MariaDB [(none)]> exit;
 
  
Next, you need to import initial tables to roundcubedb database. You can do this using the following command:
+
* Aktifkan authentication
 +
* Aktifkan TLS port 589
  
cd /var/www/html/roundcube
 
mysql -u roundcube -p roundcubedb < SQL/mysql.initial.sql
 
  
Configure Apache for Roundcube
+
==Konfigurasi Apache==
  
Next, you will need to create an Apache virtual host file for Roundcube. You can do this with the following command:
+
Edit file
  
  sudo nano /etc/apache2/sites-available/roundcube.conf
+
  sudo vi /etc/apache2/sites-available/roundcube.conf
  
Add the following lines:
+
Tambahkan
  
 
  <VirtualHost *:80>
 
  <VirtualHost *:80>
 
         ServerName 192.168.0.102                           
 
         ServerName 192.168.0.102                           
 
         ServerAdmin admin@example.com
 
         ServerAdmin admin@example.com
         DocumentRoot /var/www/html/roundcube
+
         DocumentRoot /var/www/html/  
 
 
         ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
 
         ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
 
         CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined  
 
         CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined  
 
   
 
   
         <Directory /var/www/html/roundcube>
+
         <Directory /var/www/html/>
 
                 Options -Indexes
 
                 Options -Indexes
 
                 AllowOverride All
 
                 AllowOverride All
Line 100: Line 117:
 
  </VirtualHost>
 
  </VirtualHost>
  
Save and close the file, then enable virtual host file using the following command:
+
Save & close file
  
sudo a2ensite roundcube
 
  
Next, enable Apache rewrite module and restart Apache server with the following command:
+
Aktifkan
  
 +
chown -Rf www-data: /var/www/
 +
chmod -Rf 777 /var/www/
 +
sudo a2ensite roundcube
 
  sudo a2enmod rewrite
 
  sudo a2enmod rewrite
 
  sudo systemctl restart apache2
 
  sudo systemctl restart apache2
 +
/etc/init.d/dovecot restart
 +
/etc/init.d/postfix restart
  
 +
==Akses Web==
  
 +
Akses ke
  
 +
http://ip-address-server/roundcube/installer
 +
http://192.168.0.102/roundcube/installer
  
 +
Pastikan
 +
 +
* Checking PHP version - OK
 +
* Checking PHP extensions - OK
 +
* Checking available databases - paling tidak ada 1 database OK
 +
* Check for required 3rd party libs - OK
 +
* Checking php.ini/.htaccess settings - OK
 +
 +
NEXT PAGE
 +
 +
* MySQL - Database type
 +
* roundcube - Database server (omit for sqlite)
 +
* roundcube - Database name (use absolute path and filename for sqlite)
 +
* roundcube - Database user name (needs write permissions)(omit for sqlite)
 +
* password  - Database password (omit for sqlite)
 +
 +
NEXT PAGE
 +
 +
* Test kirim email dari username@domain ke username@domain
 +
* Test imap username password
  
 
==Referensi==
 
==Referensi==
Line 117: Line 162:
 
* https://www.howtoforge.com/tutorial/ubuntu-roundcube-latest/
 
* https://www.howtoforge.com/tutorial/ubuntu-roundcube-latest/
 
* https://www.linode.com/docs/email/clients/install-roundcube-on-ubuntu/
 
* https://www.linode.com/docs/email/clients/install-roundcube-on-ubuntu/
 +
 +
 +
==Pranala Menarik==
 +
 +
* [[RoundCube: Re-enable Installer]]

Latest revision as of 13:15, 23 December 2019

sumber:

Instalasi Apps Pendukung

Edit repo /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security main universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe multiverse

Lakukan

sudo su
locale-gen id_ID.UTF-8
apt update
apt -y install apache2 mariadb-server php7.2 php7.2-gd \
php-mysql php7.2-curl php7.2-zip php7.2-ldap php7.2-mbstring \
php-imagick php7.2-intl php7.2-xml unzip wget curl \
php-pear php-net-imap php-net-smtp php-net-idna2 php-mail-mime php-net-ldap3 \
dovecot-core dovecot-imapd postfix
chown -Rf www-data: /var/www/

Waktu instalasi postfix set

hostname
Internet Relay Host


Set Timezone

sudo vi /etc/php/7.2/apache2/php.ini
date.timezone = Asia/Jakarta

Start

sudo a2enmod rewrite
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mysqld

Download Roundcube

Download, buka, copy & install

cd /usr/local/src
wget https://github.com/roundcube/roundcubemail/releases/download/1.4.1/roundcubemail-1.4.1.tar.gz
tar -xvzf roundcubemail-1.4.1.tar.gz
mv roundcubemail-1.4.1 /var/www/html/roundcube
sudo chown -R www-data:www-data /var/www/html/roundcube
sudo chmod -R 775 /var/www/html/roundcube

Database

Jika di perlukan buat menjadi secure (bisa di skip jika untuk belajar saja)

mysql_secure_installation
Change the password for root ? N
Remove anonymous users? Y
Disallow root login remotely? Y
Remove test database and access to it? Y
Reload privilege tables now? Y

Konfigurasi database

mysql -u root -p123456
CREATE DATABASE roundcubemail;
CREATE USER 'roundcube'@'localhost' identified by 'roundcube';;
GRANT ALL on root.* to roundcubemail@localhost;
GRANT ALL on roundcubemail.* to roundcube@localhost identified by 'roundcube';
GRANT ALL on roundcubemail.* to roundcube identified by 'roundcube';
FLUSH PRIVILEGES;
exit;


Inisialisasi database

cd /var/www/html/roundcube
mysql -u roundcube -proundcube roundcubemail < SQL/mysql.initial.sql

atau

 mysql -u roundcube -p roundcubemail < SQL/mysql.initial.sql

Masukan password "roundcube"

Konfigurasi Postfix

  • Aktifkan authentication
  • Aktifkan TLS port 589


Konfigurasi Apache

Edit file

sudo vi /etc/apache2/sites-available/roundcube.conf

Tambahkan

<VirtualHost *:80>
        ServerName 192.168.0.102                          
        ServerAdmin admin@example.com
        DocumentRoot /var/www/html/ 
        ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
        CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined 

        <Directory /var/www/html/>
                Options -Indexes
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Save & close file


Aktifkan

chown -Rf www-data: /var/www/
chmod -Rf 777 /var/www/
sudo a2ensite roundcube
sudo a2enmod rewrite
sudo systemctl restart apache2
/etc/init.d/dovecot restart
/etc/init.d/postfix restart

Akses Web

Akses ke

http://ip-address-server/roundcube/installer
http://192.168.0.102/roundcube/installer

Pastikan

  • Checking PHP version - OK
  • Checking PHP extensions - OK
  • Checking available databases - paling tidak ada 1 database OK
  • Check for required 3rd party libs - OK
  • Checking php.ini/.htaccess settings - OK

NEXT PAGE

  • MySQL - Database type
  • roundcube - Database server (omit for sqlite)
  • roundcube - Database name (use absolute path and filename for sqlite)
  • roundcube - Database user name (needs write permissions)(omit for sqlite)
  • password - Database password (omit for sqlite)

NEXT PAGE

  • Test kirim email dari username@domain ke username@domain
  • Test imap username password

Referensi


Pranala Menarik