Page tree
Skip to end of metadata
Go to start of metadata

 

Introduction

For a style to display for a particular user in the cPanel interface, you must apply the style. Some methods to apply a style also require specific permissions on the server.

For example, to apply a style as the server-wide default cPanel style, you must have root access to the server.

Important:

  • This document describes methods to apply styles via the command line. In cPanel & WHM version 60 and later, you can also use WHM's Customization interface (Home >> cPanel >> Customization) to upload and apply styles.
  • After you upload a style that includes custom icons, you must run the /usr/local/cpanel/bin/sprite_generator utility to integrate the new icons. 

Apply a style

Styles on cPanel servers exist in two categories:

  • Default style — The style that cPanel accounts default to, if the users have not selected a current style
    • The root user sets the server's default style.
    • Resellers can set a default style for the accounts that they own.
  • Current style — A style that the cPanel user or reseller has selected to use for an account, instead of the default style.

Apply to the server as the default style

To apply a style as the server's default style, perform the following steps:

  1. Log in to the server via SSH as the root user. 
  2. Create the /var/cpanel/customizations/styled directory, if it does not already exist.

  3. Run the following command, where path_to_style represents the absolute path to the style that you wish to apply:

    ln -s path_to_style /var/cpanel/customizations/styled/default_style

    For example, to apply the /var/cpanel/customizations/styled/mystyle style, run the following command:

    ln -s /var/cpanel/customizations/styled/mystyle /var/cpanel/customizations/styled/default_style

Apply to a reseller's accounts as the default style

To apply a style to all of a reseller's accounts as the default style, perform the following steps:

  1. Log in to cPanel as the reseller. 
  2. Navigate to cPanel's Change Style interface (Home >> Preferences >> Change Style).
  3. Click Set as Default for the desired style.

To apply a style to all of a reseller's accounts as the default style through the command line, perform the following steps:

  1. Log in to the server via SSH as the reseller.
  2. Create the /var/cpanel/reseller/styled directory, if it does not already exist.
  3. Run the following command, where path_to_style represents the absolute path to the style that you wish to apply:

    ln -s path_to_style /var/cpanel/reseller/styled/default_style

    For example, to apply the /var/cpanel/customizations/styled/mystyle style, run the following command:

    ln -s /var/cpanel/customizations/styled/mystyle /var/cpanel/reseller/styled/default_style

Apply to a single user's account as the current style

To apply a style to a specific account through the cPanel interface, perform the following steps:

  1. Log in to cPanel as the desired user. 
  2. Navigate to cPanel's Change Style interface (Home >> Preferences >> Change Style).
  3. Click Apply for the desired style.

To apply a style to a specific account through the command line, perform the following steps:

  1. Log in to the server via SSH as the desired user. 
  2. Run the following command, where username represents the cPanel account's username, and path_to_style represents the absolute path to the style that you wish to apply:

    ln -s path_to_style /home/username/var/cpanel/styled/current_style

    For example, to apply the /var/cpanel/customizations/styled/mystyle style, run the following command:

    ln -s /var/cpanel/customizations/styled/mystyle /home/username/var/cpanel/styled/current_style

Note:

To apply a style as the current style for every account on the server, create a script to run this command for each user. When you create this script, you may wish to use the WHM API 1 listaccts function to retrieve a list of the server's accounts.