Cpanel

Find the default httpd config

/etc/httpd/conf/httpd.conf

Find the userdata folder 

/usr/local/apache/conf/userdata

 

IPut the same directive in httpd.conf under and it work:
<VirtualHost 162.210.xxx.xxx:80>
ServerName example.com
</VirtualHost>

 

You'll need to run /usr/local/cpanel/scripts/ensure_vhost_includes after the modifications, as documented here Modify Virtualhost Containers With Include Files - EasyApache - cPanel Documentation

 

or do the following:
/var/cpanel/userdata/USERNAME/DOMAIN.COM
1. Once you have opened the file, look for the following line:

documentroot: /home/USERNAME/public_html
2. Modify the location according to your needs. Save it and exit.

3. Rebuild the Apache conf and restart Apache:

/scripts/rebuildhttpdconf
service httpd restart
The change will be immediate. Simply clear your browser cache and force refresh the page!

The cPanel accounts are created using a primary domain. All primary domains on the hosting account use “public_html” directory for all its website files and data. The sub-directories inside the public_html directory is occupied by the addon domains. The primary domain can also be setup to use a sub-directory inside public_html directory instead of public_html itself. Follow the below steps to change the document root of your primary domain in cPanel account. Please note that, you will need to have root SSH access to perform these steps.

1) Connect to your server via SSH as root user. You may follow the tutorial below, if you are using a Windows system to connect to your server via SSH. This tutorial explains how to use “Putty”, SSH client software to access server.

https://www.interserver.net/tips/kb/using-putty-to-ssh-to-server/

2) Using your favorite text editor (say vim) edit the following file.

$ vim /cpanel/userdata/username/domain.com

Replace the “username” with your cPanel account username and “domain.com” with your primary domain name and “subdir” with your new directory. Find the following two lines in this file.

documentroot: /home/username/public_html

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

Modify these two lines to change the document root of your primary domain to a sub-directory inside “public_html” directory.

documentroot: /home/username/public_html/subdir

path: /home/username/public_html/subdir/cgi-bin

Save the file after changes are made and then delete the cache file for your primary domain.

$ rm -vf /var/cpanel/userdata/username/domain.com.cache

3) If the primary domain has an SSL certificate installed, edit the following file the same way as above.

$ vim /var/cpanel/userdata/username/domain.com_SSL

Save the file after changes are made and then delete the cache file for your primary domain.

$ rm -vf /var/cpanel/userdata/username/domain.com_SSL.cache

4) Run the following scripts to update the user data cache and rebuild apache configuration file.

/scripts/updateuserdatacache

/scripts/rebuildhttpdconf

5) Restart Apache server to load changes.

$ service httpd restart

/etc/cpanel/ea4/profiles/cpanel

or

/etc/cpanel/ea4/profiles/custom

 

/usr/local/bin/ea_install_profile [--install] profile_file

 

EasyApache4 Profile list example:

[root@server cpane]]$

allphp.json allphp-opcache.json default.json mpm_itk.json nophp.json rubypassenger.json worker.json

 

Example profile provisioning/install:

/usr/local/bin/ea_install_profile --install /etc/cpanel/ea4/profiles/custom/joomla_php_7-72.json

sudo su root

Run the rpm -qa | grep -i package command, where package (eg. ea-php72-mb) represents part of the name of the package that you wish to install, to determine if the package is already installed.

Run this to determine if package is available:

yum list ea-*

ea-php70-php-mbstring.x86_64

ea-php70-php-zip.x86_64

To Install the available package run the command with exact package name found in list:

yum install ea-php70-php-mbstring.x86_64

Now that you have completed installing the fileinfo PHP extension from the CLI, you can confirm it is enabled by running the following command :

scl enable ea-php70 'php -i' | grep 'mbstring'
Configure Command => './configure' ...'--enable-mbstring=shared'...'
/opt/cpanel/ea-php70/root/etc/php.d/mbstring.ini,
mbstring
mbstring support => enabled

Book Your Free Consultation

Submit your name and email below to schedule your free 15 minute initial consultation to see how we can help your business succeed