Biblioteca de cunoștințe

The fix-web-vhost-configuration Script  Tipărire

Overview:

You can use the /usr/local/cpanel/scripts/fix-web-vhost-configuration script to iterate through each user’s web virtual host configuration files and remove excess alias names. Certain historical errors in cPanel & WHM make it possible for discrepancies to exist between what the system expects and the actual configuration.

Note:
  • You must run this script as the root user.

  • The system automatically runs the /usr/local/cpanel/scripts/fix-web-vhost-configuration script when you upgrade major versions of cPanel & WHM.

This script performs the following actions:

Note:
If you pass the --dry-run argument, the script will not delete or add any domains form the web virtual host configuration files.
  1. Identify any unrecognized alias domains.

  2. Delete the following unrecognized alias domains from the web virtual host configuration files:

    • Active service subdomains - cpanel.example.com

    • www subdomains of active service subdomains - www.cpanel.example.com

    • www subdomains of any expected alias - www.mail.example.com

      Note:
      This will ignore other unrecognized alias domains

       

  3. Identify and add any missing alias domains.

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/scripts/fix-web-vhost-configuration [arguments]

 

Options

Use the following options with this script:

Options Description Example
--user Required - Update the web virtual host configuration files of the user that you specify.
Note:
You must pass either the user flag or the all-users flag, but not both.
--user=username
--all-users Required - Update the web virtual host configuration files for all users.
Note:
You must pass either the user flag or the all-users flag, but not both.
--all-users
--dry-run Identify, but do not delete or add any alias domains in the user’s web virtual host configuration files. --dry-run
--help Display a help message. --help

Example

For example, the following command removes the excess alias name from the username cPanel user’s web virtual host configuration files:

/usr/local/cpanel/scripts/fix-web-vhost-configuration --user=username

Output

This script’s output could resemble the following example:

1
2
3
4
5
6
7
8
----- Checking “username” …
--- Virtual host: “example.com”
⚠ Unrecognized: cpanel.example.com
⚠ Pending deletion: cpanel.example.com
Fixed!
- Non-SSL configuration …

Done!

Răspunsul a fost util?

Articole similare

WHM Scripts
Overview: The cPanel & WHM installation process adds important scripts to your server’s...
The dbmaptool Script
Overview: You can use the /usr/local/cpanel/bin/dbmaptool script to grant ownership of databases...
The servers_queue Script
Overview: This script allows you to manage the task queue system. The task queue system allows...
The auto-adjust-mysql-limits Script
Overview: The /usr/local/cpanel/scripts/auto-adjust-mysql-limits script updates MySQL®...
The autossl_check Script
Overview: The /usr/local/cpanel/bin/autossl_check script allows you to manually check the SSL...