Databáze řešení
The set_hostname Utility Tisknout tento článek
Overview:
The /usr/local/cpanel/bin/set_hostname
utility updates the server’s hostname and performs all of the necessary actions to apply this change throughout the system. You can use this utility to change the server’s hostname during a process that requires you to call the binary (for example, automated cloning processes).
You can also use the following methods to change the server’s hostname:
-
Use WHM’s Change Hostname interface (WHM >> Home >> Networking Setup >> Change Hostname).
-
Use WHM API 1’s
sethostname
function.
If you use either of these methods, you do not need to run this utility.
-
Do not select a hostname that begins with
www
or a number, or a hostname that ends with a hyphen (-
). -
You must use a fully-qualified domain name (FQDN) that uniquely identifies the server (for example,
hostname.example.com
orhostname.example.co.uk
). -
Do not choose a hostname that a cPanel account on your server will use.
-
Do not choose a potential service subdomain as a hostname (for example,
cpanel.example.com
orwhm.example.com
). -
Do not select a socially-unacceptable hostname. The hostname will appear in mail headers.
-
Only use lowercase, Latin-script letters in hostnames.
cprapid.com
as a hostname, we strongly encourage you to replace it with an existing domain or purchase a new domain to generate a hostname. Using your own domain name and hostname will help establish your company’s brand. For more information, read our Automatically-Issued Hostnames documentation.Run the script
To use the /usr/local/cpanel/bin/set_hostname
utility, run the following command as the root
user, where newhostname.example.com
represents your new hostname:
/usr/local/cpanel/bin/set_hostname newhostname.example.com [option]
You can specify the following option for the /usr/local/cpanel/bin/set_hostname
utility:
--help
— View utility information on the command line.
When you run this command, the set_hostname
utility performs the following actions:
- It updates the hostname in the
/etc/sysconfig/network
file, and in the kernel. - It updates the domain.
- It updates the server’s Apache® configuration.
- It updates the cPanel license.
- It updates cPHulk.
- It restarts MySQL®.
- It rebuilds cPanel & WHM’s global cache.
- It updates the FTP, Exim, Dovecot®, and cPanel SSL certificates.
Example
To change the server’s hostname to hostname.example.com
, run the following command:
/usr/local/cpanel/bin/set_hostname hostname.example.com
If the update succeeds, the utility produces the following output:
|
|
Byla tato odpověď nápomocná?
Související články
Overview: The cPanel & WHM installation process adds important scripts to your server’s...
Overview: You can use the /usr/local/cpanel/bin/dbmaptool script to grant ownership of databases...
Overview: This script allows you to manage the task queue system. The task queue system allows...
Overview: The /usr/local/cpanel/scripts/auto-adjust-mysql-limits script updates MySQL®...
Overview: The /usr/local/cpanel/bin/autossl_check script allows you to manually check the SSL...