Catatan Oprek WHM/CPANEL
cara melihat password root mysql di whm/cpanel :cat /root/.my.cnf|grep password
Cara edit virtualhost di WHM:
Modify Apache Virtual Hosts with Include Files
Last modified: July 11, 2022
Overview
You can use the command line interface to add include files that modify the content of the virtual hosts in your Apache configuration. You may wish to do this to modify the configuration of an individual domain, or a specific user’s domains.
You must create the directories and the include files for this type of configuration. For information on the directives that you can add to the virtual hosts in your Apache configuration, read Apache’s documentation.
- Includes are the last directives in each virtual host. An include file’s contents override any value that exists in the primary configuration file.
- If you use an include that requires a specific Apache version, and you change to a different Apache version, the Apache configuration will ignore the include file.
Include file structure
You must use the following directory structure to create an include file for an individual domain:
In the following examples:
- Replace
userwith the account’s username. - Replace
domainwith the domain name. - Replace
includename.confwith the filename that you wish to include.
Apply to an individual virtual host
- With SSL -
/etc/apache2/conf.d/userdata/ssl/2_4/user/domain/includename.conf - Without SSL -
/etc/apache2/conf.d/userdata/std/2_4/user/domain/includename.conf
Apply to all virtual hosts on the system
- Include files that do not designate a specific Apache version may not migrate properly to future versions of Apache.
- Include files with local overrides cause the system to permanently disable the Force HTTPS Redirects option in cPanel’s Domains interface (cPanel » Home » Domains » Domains).
-
With SSL
/etc/apache2/conf.d/userdata/ssl/2_4/includename.conf/etc/apache2/conf.d/userdata/ssl/includename.conf
-
Without SSL
/etc/apache2/conf.d/userdata/std/2_4/includename.conf/etc/apache2/conf.d/userdata/std/includename.conf
-
With and without SSL —
/etc/apache2/conf.d/userdata/includename.conf
Apply to all virtual hosts that a user owns
- With SSL —
/etc/apache2/conf.d/userdata/ssl/2_4/user/includename.conf - Without SSL —
/etc/apache2/conf.d/userdata/std/2_4/user/includename.conf
Restart Apache
After you create or edit an Apache include userdata file, you must rebuild the httpd.conf file and restart Apache for the changes to take effect.
To rebuild the httpd.conf file, run the following script:
/usr/local/cpanel/scripts/rebuildhttpdconfTo restart Apache, run the following script:
/usr/local/cpanel/scripts/restartsrv_httpdcara edit DNS Zone via CLI:
How To Edit a DNS Zone File Via the CLI?
Introduction
Making manual edits to a DNS zone is a multiple-step process, if not done correctly it can result in the changes made not going into effect.
Procedure
- First thing you should do is make a backup of any zones you plan on
editing, if you need to make a copy of all the zones you can create a
backup to /var/named-backup using the following command:
cp -av /var/named /var/named-backup
- Next, open the zone file with your desired command line editor, the
zone files are located in /var/named and end with the .db extension.
After making the desired change to your zone, the serial must be
updated. An increased serial indicates that a DNS zone has been changed.
Simply increasing the number by one digit is sufficient. An example of
the serial from a DNS zone can be seen here:
2023061802 ;Serial Number
- After making the change you can confirm the zones syntax with
named-checkzone, if it returns ok you can proceed to reload the zone,
otherwise the errors in the zone must be addressed. With named-checkzone
you use the domain name, followed by the full path to the DNS zone:
[root@host ~]# named-checkzone example.tld /var/named/example.tld.db
zone example.tld/IN: loaded serial 2023062201
OK - After updating the serial your DNS server must reload the zone, depending on the name server used the command will vary:
PowerDNS:
pdns_control bind-reload-now example.tld
Bind:
rndc reload
- Lastly, if using DNS cluster with cPanel initiate a sync for the modified zone:
/scripts/dnscluster synczone example.tld
Abcde Fghijk Lmno Pqrs
Komentar
Posting Komentar