CPanel is a Linux based control panel to manage a server for web hosting. It provides a GUI to control various features related to web hosting like managing email server, FTP server, PhpMyAdmin(for MySQL), etc. CPanel is generally used for LAMP server setup which stands for Linux, Apache Web Server, MySQL, and PHP, but in case of CPanel the location where various installations are done and various configuration files are kept is different.
So in this article, we will specify the location of various important configuration files and location for various installations in CPanel.
PHP.ini File
/opt/cpanel/ea-*/root/etc/php.in
The opt/ directory is available at the root/ directory level. Also in the location path above eq-* stands for various Php versions available on your server like ea-php55, ea-php56, ea-php70 etc.
PHP installation and Composer(if installed)
/opt/cpanel
In the opt/ directory, just like for the PHP.ini file, PHP installation, Composer installation are in the cpanel/ directory inside the opt/ directory.
httpd.conf File
This file is the Apache web server configuration file which can be found at /usr/local/apache/conf/includes. At this location, you will see multiple files for various virtual hosts created using the WHM panel.
The actual Apache web server configuration file is available at /etc/apache2/conf/httpd.conf but one should avoid making changes to it.
Apache Web server's access and error logs
These can be found at: /usr/local/apache
Again the actual logs are created at /etc/apache2/logs location.
One can use the command tail -200f <name-of-log-file> to run live logs.
public_html Directory
In this directory, all the actual website files are stored like Php files, HTML files, etc. This directory is available inside the respective Cpanel's user directory. For example, if we have a Cpanel account(user) created with the name studytonight, then public_html for this account will be available at /home/studytonight/public_html
I will keep adding new locations to this article as and when I learn new stuff. I request the readers to share there knowledge about Cpanel via comments related to any configuration file or any installation process.
You may also like: