DirectAdmin Modify the background login default Port example

Source: Internet
Author: User
Tags iptables port number

Method One


1.root account via SSH login to your VPS or server;

2. Execute the following two commands to modify the default port of 12345, you can modify the following statements in bold 12345 for any other port to execute the command;

Sed-i ' s/port=2222/port=12345/g '/usr/local/directadmin/conf/directadmin.conf

Service DirectAdmin Restart

Method Two

In fact, similar to the above, just a lot of trouble, execute the following statement:
Vi/usr/local/directadmin/conf/directadmin.conf
Then find port=2222 in it, change the port number to the port number you want, for example, 12345, then save the exit, and then execute the following statement to restart the directadmin.
Service DirectAdmin Restart

OK, the above command to modify the default port is 12345, you can modify the above statement in bold 12345 for other arbitrary port to execute the command;
Be careful not to conflict with frequently used ports, it is recommended to change to 5 digits, but not higher than 65535.

DirectAdmin Modify default HTTP port

# VI/ETC/HTTPD/CONF/HTTPD.CONF1 Listen 8080
# VI/ETC/HTTPD/CONF/IPS.CONF1 Namevirtualhost *:8080
Enter the/usr/local/directadmin/data/templates directory and modify the default 80,443 ports for the following template files
Ips_virtual_host.conf
Virtual_host.conf
Virtual_host_sub.conf
Virtual_host2.conf
Virtual_host2_sub.conf
Redirect_virtual_host.conf

Change the default display page.

Vi/var/www/html/index.html


Attention:

If your server has already enabled the automatic locking of IP or the use of iptable firewalls, it is possible to use a new port number but not to access the admin backend. This will also have to update the iptable firewall inside the port, because the default is to open the 2222 port, and you change the port number is not in the development list.
Execute the following statement:

Vi/etc/init.d/iptables

Then find 2222 in it, change the port number to the port number you want, for example, 12345, then save the exit, and then execute the following statement to restart the iptable to make it effective:

/etc/init.d/iptables restart

Finish the work!

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.