Conas Webmail Roundcube a shuiteáil ar Ubuntu 18.04

In this tutorial, we will show you how to install and perform the first-time setup of Roundcube on Ubuntu 18.04.

Roundcube Webmail is a free and open-source web-based IMAP client, written in PHP. With its intuitive and desktop-like user interface, Roundcube provides an easy way for you to check and manage your emails using your web browser.
It provides all of the functionalities that you would come to expect from an email client, including full MIME and HTML support, an address book, folder management, advanced message searching, spell checking, and much more.

Réamhriachtanais

  • Chun críocha an teagaisc seo, bainfimid úsáid as VPS Ubuntu 18.04.
  • You will also need a working LAMP or LEMP (Linux, Apache/Nginx, MySQL, PHP) stack.
  • A working IMAP based email server so that you can send/receive emails. You can check our tutorial on conas freastalaí ríomhphoist a bhunú le Postfix agus Dovecot.
  • Teastaíonn rochtain fhréamh iomlán SSH nó úsáideoir le pribhléidí sudo freisin.

Céim 1: Ceangail le do fhreastalaí

Before we begin, you will need to connect to your server via SSH as the root user or as any other user that has sudo privileges.

To connect to your server as the root user, use the following command:

ssh [email protected]IP_ADDRESS -p PORT_NUMBER

Déan cinnte go gcuirfidh tú do sheoladh IP agus uimhir chalafoirt SSH in ionad IP_ADDRESS agus PORT_NUMBER.

Nuair a bheidh tú logáilte isteach, déan cinnte go bhfuil do fhreastalaí cothrom le dáta agus na horduithe seo a leanas á reáchtáil agat:

nuashonrú sudo apt sudo apt uasghrádú

Céim 2: Suiteáil Apache

To install Apache on your server, run the following command:

suiteáil apache2

Once the installation is complete, enable the Apache service to start automatically upon system boot. You can do that with the following command:

sudo systemctl a chumasú apache2

To verify that Apache is running, execute the following command:

stádas sache systemctl apache2

aschur:

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Fri 2019-04-12 04:10:18 CDT; 3s ago
 Main PID: 1752 (apache2)
    Tasks: 6 (limit: 2321)
   CGroup: /system.slice/apache2.service
           ├─1752 /usr/sbin/apache2 -k start
           ├─1753 /usr/sbin/apache2 -k start
           ├─1754 /usr/sbin/apache2 -k start
           ├─1755 /usr/sbin/apache2 -k start
           ├─1756 /usr/sbin/apache2 -k start
           └─1757 /usr/sbin/apache2 -k start

Céim 3: Suiteáil MySQL

The next step is to install the MySQL database server.

To install MySQL on your system, type the following command and enter the character ‘Y’ when prompted:

sudo apt suiteáil mysql-server

During the installation, you will be asked to enter a password for the MySQL root user. Make sure to enter a strong password.

To further improve the security of our MySQL installation as well as set up a password for our MySQL root user, we need to run the mysql_secure_installation script and follow the on-screen instructions. Run the command below to configure your system:

sudo mysql_secure_installation

If the program asks you to enter your current MySQL root password, just press your [Enter] key once, as no password is set by default when installing MySQL.

Taispeánfar cúpla ceist eile ar an scáileán - moltar duit freagra dearfach a thabhairt orthu go léir trí charachtar 'Y' a iontráil:

Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y

Again, we can enable MySQL to start on boot with the following command:

sudo systemctl a chumasú mysql

That’s it – MySQL has been installed and made more secure.

Step 4: Install PHP

The last step of our LAMP stack setup is to install PHP. Ubuntu 18.04 comes with PHP 7.2 by default.

We will also include some additional modules in order to help PHP to connect with our Apache and MySQL servers. On top of these, we will install modules that are required by Roundcube.

To do this, type the following command:

sudo apt a shuiteáil php7.2 libapache2-mod-php7.2 php7.2 php7.2-mysql php7.2-cli php-pear pp7.2-opcache php7.2-gd php7.2-cul php7.2-cli php7.2-imap php7.2-mbstring php7.2-intl php7.2-gallúnach php7.2-ldap php- samhlaigh 7.2-xmlrpc php7.2-xml php7.2-zip

Teastaíonn na pacáistí PHP PEAR seo a leanas freisin:

shuiteáil suth pear shuiteáil Auth_SASL2 Net_SMTP Net_IDNA2-0.1.1 Ríomhphost_mime Mail_mimeDecode

Step 5: Download Roundcube

We can now start with our Roundcube installation and configuration.

Let’s download the latest stable Roundcube version (Complete package). You can do this with the following command:

wget https://github.com/roundcube/roundcubemail/releases/download/1.3.9/roundcubemail-1.3.9-complete.tar.gz

To extract the file, execute the following command:

tarra sudo -xvzf roundcubemail-1.3.9-full.tar.gz

Bog agus athainmnigh an comhad chuig an suíomh seo a leanas ar do fhreastalaí le:

sudo mv roundcubemail-1.3.9 / var / www / roundcube

The owner of the files needs to be the user of the web server running on your system. In our example, we are using the Apache web server and Apache runs under the “www-sonraí” user on Ubuntu. To change the owner and set the correct permissions of the files, you can run the following command:

sudo chown -R www-data: www-data / var / www / roundcube /

Step 6: Configure the Database

Next, we need to create a new database. To do this, log in to your MySQL database server as the root user by typing the following command:

sudo mysql -u root -p

To create a new database and user, run the following commands on the MySQL shell:

CREATE DATABASE roundcube;
CREATE USER [email protected] IDENTIFIED BY 'strong-password';
GRANT ALL PRIVILEGES ON roundcube.* TO [email protected];
FLUSH PRIVILEGES;

Make sure to replace strong-password with an actual strong password.

To exit the MySQL database server command line, type:

scoir

Next, we need to import the Roundcube table layout into our empty database. To do this, run the following command:

mysql -u roundcube -p roundcube < /var/www/roundcube/SQL/mysql.initial.sql

Step 7: Configure Apache

In this step, we will show you how to create a virtual host file for Apache – this is so that you can access your Roundcube instance using your domain name.

Cruthaigh an comhad óstála fíorúil tríd an ordú seo a leanas a fhorghníomhú:

nano /etc/apache2/sites-available/roundcube.conf

Agus cuir isteach an fhaisnéis seo a leanas:

<VirtualHost *:80>
     DocumentRoot /var/www/roundcube
     ServerName webmail.mydomain.com 
<Directory /var/www/roundcube/>	 	 
 Options -Indexes	 	 
 AllowOverride All	 	 
 Order allow,deny	 	 
 allow from all	 	 
 </Directory>	 	 
 ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log	 	 
 CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined	 	 
</VirtualHost>

In our example, we will use a subdomain called webmail.mydomain.com. Make sure to replace webmail.mydomain.com with your actual domain/subdomain name that you would like to use for your Roundcube.

To enable the new Roundcube virtual host, run the following command:

sudo a2ensite roundcube.conf

Ba chóir duit an t-aschur seo a leanas a fheiceáil:

Enabling site roundcube.

To activate the new configuration, you need to run:

reloadload systemctl apache2

Ní mór duit an Apache a chumasú freisin mod_rewrite module. You can do this with the following command:

sudo a2enmod athscríobh

Athlódáil do Apache chun an chumraíocht nua a ghníomhachtú:

sudo systemctl athlódáil appache2

Step 8: Installing Roundcube

Is féidir leat nascleanúint a dhéanamh anois http://webmail.mydomain.com/installer/ in your browser to start the Roundcube installation wizard.

The first page will check if all server requirements are met. If there are some missing dependencies, you should install them on your server and then refresh the page again. Once you make sure everything is set up properly, you can click on “NEXT” at the bottom of the page to continue to the next step.

On the next page, you will generate the Roundcube configuration file.

sa Cumraíocht ghinearálta section, you can choose the name of your email service, set a support page URL (optional) and choose a logo.

sa Logging & Debugging section, you can leave everything to their default values.

sa Suiteáil an bhunachar sonraí section, you need to enter your Roundcube database name, username, and password (the one we created in one of the previous steps).

Sa dá roinn eile Socruithe IMAP agus SMTP, you will need to enter the settings for your email server, so that you can send and receive emails. If you do not have your own mail server, you can also use other free email services – such as Gmail from Google – and connect Roundcube to their servers.

An Display settings & user prefs section provides some additional customization options.

Is é an t-alt deireanach an Breiseáin section from where you can choose some of the many available plugins to be installed with your Roundcube.

After you enter all the details and you are happy with your choices, click the “CRUTHAITHE CREAR"A bhrú.

On the next page, you can test your Roundcube configuration, including your SMTP and IMAP settings.

Tar éis duit na suiteálacha agus na tástálacha deiridh a chríochnú, is gá duit an t-eolaire suiteálaí iomlán a bhaint ó fhréamh doiciméid an fhreastalaí gréasáin:

sudo rm -rf / var / www / roundcube / suiteálaí

Step 9: Accessing Roundcube

Once the installation is completed, you can navigate to http://webmail.mydomain.com (replace this with your actual domain name).

This will take you to the Roundcube login screen, where you can use your email account credentials to log in and manage your emails.

Sin é! Roundcube Webmail has been successfully installed on your Ubuntu 18.04 server.

Airteagal Bunaidh

Leave a Reply

Úsáideann an suíomh seo Akismet chun spam a laghdú. Foghlaim conas a dhéantar próiseáil ar do chuid tráchta.