Iredmail mail server Modify the default Web service port number

Source: Internet
Author: User
Tags roundcube

After installing Iredmail, the port does not conflict with the port of the Web service due to the need to do port mapping on the router for the external network to access webmail, so the port of the mail server's httpd service needs to be modified.

One, apache/httpd http service and HTTPS service port number should be modified.

Basic service port Good to do, iredmail default installation, modify the/etc/httpd/conf/httpd.conf in the listen line can, here I changed to 8090

8090

However, Roundcube's webmail service is the HTTPS service used, we all know that the default port of HTTPS is 443, where is this modified? Later found this article modified Apache Http/https port number , but found that my/etc/httpd/conf directory is not extra subdirectory, let alone that httpd-ssl.conf! I guess the version may be different, after some search, find/etc/conf.d/ssl.conf, it is estimated that he, here to modify 443 to 8093.

4438093
.
.
.
##
# # SSL Virtual Host Context
##

#<virtualhost _default_:443>

<virtualhost _default_:8093>

After you modify the save, restart the httpd service

[Email protected] ~]# service httpd restart

Second, add iptables firewall rules, open a new port number

This is nothing to say, new two rules, open the newly modified port, pay attention to save on the line.

8090 -8093 -~]# service iptables Save

Third, modify the Roundcube configuration file and small bug

At this point, if the HTTPS port to access the webmail is already available, but if the use of HTTP access, and then implemented by the Roundcube HTTPS forced jump, the Roundcube form is the default HTTPS port address form, so access failed. For example, my current HTTP address is

Http://192.168.5.26:8090/mail

The roundcube automatically jumps to

Https://192.168.5.26/mail

At this point you need to modify the Roundcube configuration file, in my version is/var/www/roundcubemail/config/config.inc.php (the new version is this file, not the online old version of the file main.inc.php)

$config ['force_https'true;

Change the above line to:

$config ['force_https'8093;

In addition, we also want to modify a small bug in index.php (perhaps, I use Chrome to browse the times wrong to say that this page has a circular jump code)

To open/var/www/roundcubemail/index.php file, find the following line

// Check if HTTPS is required (for login) and redirect if necessary if (Empty ($_session['user_id') && ($force _https = $RCMAIL->config->get (  'force_https'false)) {

Modify to the following line (that is, add a judge, whether the current address is in HTTPS mode)

// Check if HTTPS is required (for login) and redirect if necessary if ($_server["HTTPS"]<>"on" && Empty ($_session[ ' user_id ']) && ($force _https = $RCMAIL->config->get ('force_https'false ))) {

Iv. no four, finish the call:)

Finally, don't forget to re-start the service.

[Email protected] roundcubemail]# Apachectl  

Modify the Default Web service port number for the Iredmail mail server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.