Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

Excerpt

To display a style for a particular user in the cPanel interface, you must apply that style to the account.

 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.

Warning
titleImportant:
  • 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 (WHM >> 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


Multiexcerpt
MultiExcerptNameApplyDefaultServer

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:

    Code Block
    languagebash
    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:

    Code Block
    languagebash
    ln -s /var/cpanel/customizations/styled/mystyle /var/cpanel/customizations/styled/default_style



Apply to a reseller's accounts as the default style


Multiexcerpt
MultiExcerptNameApplyDefaultReseller

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 (cPanel >> Home >> Preferences >> Change Style).
  3. Click Set as Default for the desired style.


Multiexcerpt
MultiExcerptNameApplyDefaultResellerCLI

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:

    Code Block
    languagebash
    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:

    Code Block
    languagebash
    ln -s /var/cpanel/customizations/styled/mystyle /var/cpanel/reseller/styled/default_style



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


Multiexcerpt
MultiExcerptNameApplyUserUI

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 (cPanel >> Home >> Preferences >> Change Style ).
  3. Click Apply for the desired style.


Multiexcerpt
MultiExcerptNameApplyUserCLI

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:

    Code Block
    languagebash
    ln -s path_to_style /home/username/var/cpanel/styled/current_style

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

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



Apply to all accounts as the current style


Multiexcerpt
MultiExcerptNameApplyMultiUserCLI


Note
titleNotes:
  • We added this functionality to the /scripts/modify_accounts script in cPanel & WHM version 66.
  • In cPanel & WHM version 64 and earlier, 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.
  • For more information, read our The modify_accounts Script documentation.

To apply a style to all of your server's accounts through the command line, perform the following steps:

  1. Log in to the server via SSH as the root user. 
  2. Run the following command, where themename represents the desired theme and stylename represents the desired style for that theme:

    Code Block
    languagebash
    /usr/local/cpanel/scripts/modify_accounts --theme=themename --all-users --style=stylename

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

    Code Block
    languagebash
    /usr/local/cpanel/scripts/modify_accounts --theme=paper_lantern --all-users --style=mystyle