Example of Directadmin modifying the default port used for background Login

Source: Internet
Author: User
This article describes how to modify the default port used by Directadmin to log on to the background, one is through ssh and the other is modified in the system, as shown below.

Method 1


1. log on to your VPS or server through SSH as the root account;

2. Execute the following twoCommandYou can modify the default port to 12345. You can modify the bold 12345 in the following statement to any other port and then executeCommand;

Sed-I's/port = 2222/port = 12345/G'/usr/local/directadmin/conf/directadmin. conf

Service directadmin restart

Method 2

In fact, it is almost the same as above, but it is a lot of trouble. Execute the following statement:
Vi/usr/local/directadmin/conf/directadmin. conf
Find port = 2222 in it, change the port number to the port number you want, for example, 12345, save and exit, and then run the following statement to restart DirectAdmin.
Service directadmin restart

OK. You can modify the default port 12345 in the preceding command to any other port and then execute the command;
Do not conflict with common ports. We recommend that you change it to 5-bit, 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
Go to the/usr/local/directadmin/data/templates directory and modify the default port 80,443 of the following template file.
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

 
Note:

If your server has enabled the previously mentioned automatic IP address locking or using the iptable firewall, you may use the new port number but cannot access the management background. In this case, you have to update the port in the iptable firewall, because port 2222 is opened by default, and the port you changed is not in the Development list.
Run the following statement:

Vi/etc/init. d/iptables

Find "2222" in it, change the port number to the port number you want, such as "12345", save and exit, and then execute the following statement to restart iptable to make it take effect:

/Etc/init. d/iptables restart

Work done

Related Article

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.