Disable direct IP access

By default, direct access to server IP address displays the sentora panel login page.

This is because the first virtual host in the virtual-host list is assumed to be the default host for any request that does not match any entry in the list.

It may be a convenient way to access the panel, but mostly not wanted.

The simpler way to disable it is to create a default virtual host that will returns an error.

1) Edit the file /etc/sentora/configs/apache/httpd.conf

Insert in it, just BEFORE the lasts line that includes the httpd-vost.conf file the following block :

#Default apache vhost to lock direct IP access to panel
<VirtualHost *:80>
  ServerName default
  DocumentRoot /var/sentora/hostdata/zadmin/public_html
    <Location />
        Require all denied
    </Location>
</VirtualHost>


2) reload gracefully apache config, according to your OS

Ubuntu :

apachectl -k graceful

Centos :

systemctl restart httpd

 

 

PenWant to help ? Click here to report mistake or to send complement to add.