Directadmin LAN integration with OLS

Iv.

New Member
#1
Dear Community,

My name is Ivan and I am Cloud / System Administrator, we have client infrastructure that is based on AWS Lightsail + Directadmin + OLS. Everything was great until mid-january when Directadmin announced automatic LAN integration for such cloud instances.

Until mid jan. there was simple process to link the internal IP of the instance with the External one and after that it was simple and easy process to install and get working OLS without any problems.

After the update for every new client we started having problems because OLS was not working with a simple web error: ERR_CONNECTION_REFUSED and httpd/error_log like this:

Bash:
2020-09-04 06:52:48.328254 [ERROR] Hostname [*] on listener [18.159.2.2:80] is mapped to virtual host [18.159.2.2], can't map to virtual host [hostname]!
2020-09-04 06:52:48.328263 [ERROR] Hostname [*] on listener [18.159.2.2:443] is mapped to virtual host [18.159.2.2], can't map to virtual host [hostname]!
The ifconfig from the instance is something like this and contains only the internal IP:

Bash:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 172.26.12.40  netmask 255.255.240.0  broadcast 172.26.15.255
        ether 02:d7:*:*:e0:*  txqueuelen 1000  (Ethernet)
        RX packets 2965  bytes 1637772 (1.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2566  bytes 509092 (497.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Adding the external IP as virtual adapter on the eth0:1 did not help and OLS was not responding to the requests same as before.

After some research today we found out that the problem is located in: /usr/local/lsws/conf/listeners.conf

This was the original listeners.conf after clean installation on DA + OLS:
Bash:
# Auto generated openlitespeed listeners config file by DirectAdmin version 1.61.3
# Modifying this file is not recommended as any changes you make will be
# overwritten when you add/remove ip's through DirectAdmin.

listener 18-159-2-2-80 {
 
 address                 18.159.2.2:80
 secure                  0
 
}

listener 18-159-2-2-443 {
 
 address                 18.159.2.2:443
 secure                  1
 keyFile                 /usr/local/lsws/ssl.key/server.key
 certFile                /usr/local/lsws/ssl.crt/server.crt.combined
 certChain               1
 sslProtocol             24
 
}
This is totally fine, BUT for some unknown reason (I don't know if it's due to DA update or OLS) there is missing the most important part, the Internal IP listener. So with small modification we had the site running normally.

The modified version of listeners.conf:
Bash:
# Auto generated openlitespeed listeners config file by DirectAdmin version 1.61.3
# Modifying this file is not recommended as any changes you make will be
# overwritten when you add/remove ip's through DirectAdmin.

listener 18-159-2-2-80 {
 
 address                 18.159.2.2:80
 secure                  0
 
}

listener 18-159-2-2-443 {
 
 address                 18.159.2.2:443
 secure                  1
 keyFile                 /usr/local/lsws/ssl.key/server.key
 certFile                /usr/local/lsws/ssl.crt/server.crt.combined
 certChain               1
 sslProtocol             24
 
}

listener 172-26-12-40-80 {
 
 address                 172.26.12.40:80
 secure                  0
 
}

listener 172-26-12-40-443 {
 
 address                 172.26.12.40:443
 secure                  1
 keyFile                 /usr/local/lsws/ssl.key/server.key
 certFile                /usr/local/lsws/ssl.crt/server.crt.combined
 certChain               1
 sslProtocol             24
 
}
*(The IP address is not the real IP from the instance just an example)*

The problem is simple, the internal IP is not auto-generated in the listeners.conf file and the solutions is easy but it's best to implement it DA/OLS side because we run force update on OLS and the listeners.conf was regenerated with the old settings.

I hope that this will help someone, and I hope there will be quick fix on this matter.

Best Regards,
 
Top