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:
After you apply 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.
- The
- 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:
- Log in to the server via SSH as the
root
user. -
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/styles.css
style, run the following command:ln -s /var/cpanel/customizations/styled/mystyle/styles.css /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:
- Log in to cPanel as the reseller.
- Navigate to cPanel's Change Style interface (Home >> Preferences >> Change Style).
- Click Set as Default for the desired 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:
- Log in to cPanel as the desired user.
- Navigate to cPanel's Change Style interface (Home >> Preferences >> Change Style).
- Click Apply for the desired style.
To apply a style to a specific account through the command line, perform the following steps:
- Log in to the server via SSH.
-
Run the following command, where
username
represents the cPanel account's username, andpath_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/styles.css
style, run the following command:ln -s /var/cpanel/customizations/styled/mystyle/styles.css /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.