Category: Control Panels

Cpanel fixquota

/scripts/fixquotas

will say something like;

edquota: Quota write failed (id 526): Invalid argument

so to fix it;

/sbin/quotacheck -vguma

then

/scripts/fixquotas

Cpanel DNS IP change

The file that actually handles WHM > DNS Functions > Nameserver IPs area is at /var/cpanel/nameserverips.yaml location. If you want this to be changed, you’d want to make a backup of that file, then modify it:

Code:
cd /var/cpanel
cp nameserverips.yaml nameserverips.yaml.bak110711
vi nameserverips.yaml

Modify your hosts file

Windows 10, Windows 8, Windows 7, and Windows Vista

Windows 8, Windows 7, and Windows Vista use User Account Control (UAC), so Notepad must be run as Administrator.

For Windows 10 & Windows 8

  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. In Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts
  5. Make the necessary changes to the file.
  6. Click File > Save to save your changes.

For Windows 7 and Windows Vista

  1. Click Start > All Programs > Accessories.
  2. Right-click Notepad and select Run as administrator.
  3. Click Continue on the Windows needs your permission UAC window.
  4. When Notepad opens, click File > Open.
  5. In the File name field, type C:\Windows\System32\Drivers\etc\hosts.
  6. Click Open.
  7. Make the necessary changes to the file.
  8. Click File > Save to save your changes.

Windows NT, Windows 2000, and Windows XP

  1. Click Start > All Programs > Accessories > Notepad.
  2. Click File > Open.
  3. In the File name field, type C:\Windows\System32\Drivers\etc\hosts.
  4. Click Open.
  5. Make the necessary changes to the file.
  6. Click File > Save to save your changes.

Linux

  1. Open a terminal window.
  2. Open the hosts file in a text editor (you can use any text editor) by typing the following line:
    sudo nano /etc/hosts
  3. Enter your domain user password.
  4. Make the necessary changes to the file.
  5. Press Control-x.
  6. When asked if you want to save your changes, answer y.

Mac OS X 10.0 through 10.1.5

  1. Open /Applications/Utilities/NetInfo Manager.
  2. To allow editing of the NetInfo database, click the padlock in the lower-left corner of the window.
  3. Enter your domain user password and click OK.
  4. In the second column of the browser view, select the node named machines.
    You will see entries for -DHCP-, broadcasthost, and localhost in the third column.
  5. In the third column, select localhost.
  6. From the Edit menu, select Duplicate. (The quickest way to create a new entry is to duplicate an existing one.)
    A confirmation alert appears.
  7. Click Duplicate.
    A new entry called localhost copy appears, and its properties are shown below the browser view.
  8. Double-click the value of the ip_address property and enter the IP address of the other computer.
  9. Double-click the value of the name property and enter the hostname you want for the other computer.
  10. Click the serves property and select Delete from the Edit menu.
  11. From the File menu, select Save.
    A confirmation alert appears.
  12. Click Update this copy.
  13. Repeat steps 6 through 12 for each additional host entry that you want to add.
  14. From the NetInfo Manager menu, select Quit.
    You do not need to restart the computer.

Mac OS X 10.6 through 10.8

  1. Open Applications > Utilities > Terminal.
  2. Open the hosts file by typing the following line in the terminal window:
    sudo nano /private/etc/hosts
  3. Type your domain user password when prompted.
  4. Edit the hosts file.
    The file contains some comments (lines starting with the # symbol), and some default hostname mappings (for example, 127.0.0.1 – local host). Add your new mappings after the default mappings.
  5. Save the hosts file by pressing Control+x and answering y.
  6. Make your changes take effect by flushing the DNS cache with the following command:
    dscacheutil -flushcache

    The new mappings should now take effect.

Cpanel how to change ip address for addon domain

It’s not directly possible from WHM inteface. But you can manaully edit then cpanel config files and assign dedicated IP for the addon domain and then install the SSL

Edit the file

Code:

/var/cpanel/userdata/username/addon-domain.com

and change the IP to a dedicated IP. Also edit the DNS entires for the addon domain and set the New IP there.

Now rebuild the apache configuration files

Code:

/scripts/rebuildhttpdconf

How to change documentroot in cPanel for primary domain

ssh [email protected]

sudo su – root

Edit the following file:

/var/cpanel/userdata/USER/DOMAIN

Important! If you have an SSL certificate on the account, you may need to edit the following file as well.

/var/cpanel/userdata/USER/DOMAIN_SSL

You should see the file like the following. The areas to edit are in RED.

customlog:

format: combined

target: /usr/local/apache/domlogs/domain.com

format: “\”%{%s}t %I .\\n%{%s}t %O .\””

target: /usr/local/apache/domlogs/domain.com-bytes_log

documentroot: /home/USER/public_html

group: USER

hascgi: 1

homedir: /home/USER

ip: 0.0.0.0

owner: root

phpopenbasedirprotect: 1

port: 80

scriptalias:

path: /home/USER/public_html/cgi-bin

url: /cgi-bin/

serveradmin: [email protected]

serveralias: www.domain.com

servername: domain.com

usecanonicalname: ‘Off’

user: USER

Change the following lines in the file:

documentroot: /home/USER/public_html

path: /home/USER/public_html/cgi-bin

The changes will look like the following:

documentroot: /home/USER/public_html/new_doc_root_dir

path: /home/USER/public_html/new_doc_root_dir/cgi-bin

When finished editing the document root, run the following scripts while logged in as the ROOT user.:

/scripts/rebuildhttpdconf

service httpd graceful

Dovecot starting error

 

Starting Dovecot Imap: doveconf: Fatal: Error in configuration file /etc/dovecot/sni.conf line 59: ssl_cert: Can’t open file /var/cpanel/ssl/installed/certs/01_webinf_ro_c1633_68425_1463431906_17b38c7a1f52478c8da1879eb6e668d2.crt: No such file or directory

################################################################################################################

Fix:

/scripts/build_mail_sni –rebuild_map_file –rebuild_dovecot_sni_conf