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!