GNU/Linux >> Linux の 問題 >  >> Linux

cPanelWebサーバーでホスト名を変更する方法

サーバーのホスト名を頻繁に変更することはおそらくないでしょうが、ここではその方法を説明します。

通常、Linuxサーバーでは、コマンド hostname server.domain.comを使用します。 、のように:

root@web [~]# hostname
web.plothost.com
root@web [~]# hostname webnew.plothost.com
root@web [~]# hostname
webnew.plothost.com
root@web [~]#

これはcPanelサーバーでは推奨されない方法です。

ホスト名を変更するためのcPanelによる推奨方法がいくつかあります:

1.WHM経由>>ネットワーク設定>>ホスト名の変更
2. sethostname経由 WHMAPI関数。
3. set_hostname経由 cPanelユーティリティ。

2番目の方法は、サードパーティのサイト/アプリケーションで使用できます。詳細については、cPanelのドキュメントをお読みください。方法1と3について詳しく説明します。

WHMでホスト名を変更するには:

  1. rootとしてログインします WHM
  2. ネットワーク設定>>ホスト名の変更に移動します
  3. 目的のホスト名を入力 新しいホスト名 フィールド。
  4. 変更をクリックします ボタン。数秒後、ホスト名の変更……完了というメッセージが表示されます。 その他の詳細とともに。
  5. ページの一番下までスクロールして、ホスト名のAエントリを追加をクリックします ボタン
  6. 表示されるページで、[エントリの追加]をクリックします ボタン。
  7. メッセージが表示されますエントリの追加……完了
  8. それだけです。新しいホスト名を使用する準備ができました。

cPanelの説明を読むことを忘れないでください :

どのアカウントにも使用しないホスト名を選択することが重要です。すべてのメールヘッダーに表示されるため、社会的に受け入れられるものを選択する必要があります。ホスト名はFQDNである必要があります。英語では、ホスト名は名前とドメイン名で構成されている必要があります。すべての有効なホスト名には、2つのドットが含まれている必要があります。ホスト名は「www」で始めることはできません。ホスト名も数字で始めたり、ハイフン( "-")で終わらせたりしないでください。

WHMでサーバーのホスト名を変更するためのムービーチュートリアル:

set_hostnameを使用してサーバーのホスト名を変更する方法を以下に示します。 cPanelユーティリティ。まず、完全なコマンド:

root@web [~]# /usr/local/cpanel/bin/set_hostname --help
/usr/local/cpanel/bin/set_hostname 

When run as root, this program changes this servers hostname, updating it in all of the relevant locations on your system.

Options:
    --help: this help
root@web [~]#

次に、ホスト名を変更しましょう:

root@web [~]# /usr/local/cpanel/bin/set_hostname web11.plothost.com
Changing hostname to web11.plothost.com...Success!

Hostname set to: web11.plothost.com
Output during rename:

Stopping cPHulkd during hostname change
Waiting for “cphulkd” to stop ………finished.
Startup Log
        Aug 19 03:43:46 web systemd[1]: Starting cPanel brute force detector services...
        Aug 19 03:43:46 web systemd[1]: PID file /var/run/cphulkd_processor.pid not readable (yet?) after start.
        Aug 19 03:43:46 web systemd[1]: Started cPanel brute force detector services.
        Aug 19 03:47:18 web systemd[1]: Stopping cPanel brute force detector services...
cphulkd stopped successfully.
Stopping MySQL during hostname change
Changing hostname in kernel to web11.plothost.com
Altered hostname in /etc/sysconfig/network
Updating cPHulkd

hulkdsetup: database schema is up to date.

Starting cPHulkd

Waiting for “cphulkd” to start ……waiting for “cphulkd” to initialize ………finished.
Service Status
        cphulkd (cPhulkd - processor - dormant mode - acce --start) is running as root with PID 7633 (systemd check method).
Startup Log
        Aug 19 03:47:22 web systemd[1]: Starting cPanel brute force detector services...
        Aug 19 03:47:22 web systemd[1]: PID file /var/run/cphulkd_processor.pid not readable (yet?) after start.
        Aug 19 03:47:22 web systemd[1]: cphulkd.service: Supervising process 7633 which is not our child. We'll most likely not notice when it exits.
        Aug 19 03:47:22 web systemd[1]: Started cPanel brute force detector services.
cphulkd started successfully.
Restarting Exim

Waiting for “exim” to restart ………waiting for “exim” to initialize ………finished.
Service Status
        exim (/usr/sbin/exim -bd -q60m -oP /var/spool/exim/exim-daemon.pid) is running as mailnull with PID 7661 (systemd check method).
        exim (/usr/sbin/exim -qG) is running as root with PID 7662 (systemd check method).
        exim (/usr/sbin/exim -qG) is running as root with PID 7676 (systemd check method).
Startup Log
        Aug 19 03:47:23 web systemd[1]: Starting Exim is a Mail Transport Agent, which is the program that moves mail from one machine to another....
        Aug 19 03:47:23 web systemd[1]: Started Exim is a Mail Transport Agent, which is the program that moves mail from one machine to another..
Log Messages
        2017-08-19 03:47:23 exim 4.89 daemon started: pid=7661, -q1h, listening for SMTP on port 587 (IPv6 and IPv4) port 25 (IPv6 and IPv4) and for SMTPS on port 465 (IPv6 and IPv4)
exim restarted successfully.
Updating Apache configuration

Updating cPanel license...Done. Update succeeded.
Building global cache for cpanel...Done

The system has queued the hostname changes for the Horde and DAV services.
Users cannot access the Horde or DAV features that use these services until
the system has finished updates to the hostname. After the system adjusts a
specific user’s database, it restores their access to the Horde and DAV services.

You will receive a notification when the system completes the update for all users.

Waiting for “mysql” to start ……waiting for “mysql” to initialize ………finished.

Service Status
        mysql (/usr/sbin/mysqld) is running as mysql with PID 7576 (systemd check method).

Startup Log
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] InnoDB: Highest supported file format is Barracuda.
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] InnoDB: 128 rollback segment(s) are active.
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] InnoDB: Waiting for purge to start
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.36-82.1 started; log sequence number 113808666
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] Plugin 'FEEDBACK' is disabled.
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846181975808 [Note] InnoDB: Dumping buffer pool(s) not yet started
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] Server socket created on IP: '::'.
        Aug 19 03:47:21 web mysqld[7576]: 2017-08-19  3:47:21 139846925715712 [Note] /usr/sbin/mysqld: ready for connections.
        Aug 19 03:47:21 web mysqld[7576]: Version: '10.1.26-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
        Aug 19 03:47:21 web systemd[1]: Started MariaDB database server.

Log Messages
        Aug 19 03:47:21 web mysqld: Version: '10.1.26-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
        Aug 19 03:47:21 web mysqld: 2017-08-19  3:47:21 139846925715712 [Note] /usr/sbin/mysqld: ready for connections.
        Aug 19 03:47:21 web mysqld[7576]: Version: '10.1.26-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server

mysql started successfully.
root@web [~]#


Linux
  1. Ubuntuでホスト名を変更するにはどうすればよいですか?

  2. ホスト名を変更する方法は?

  3. Ubuntu でホスト名を変更する方法

  1. cPanel言語を変更する方法

  2. cPanelのスタイルを変更する方法

  3. CentOSでホスト名を変更する方法

  1. cPanelで言語を変更する方法

  2. cPanelプライマリドメインを変更する方法

  3. cPanelWebホストでホスト名を変更する方法