Monthly Archives: July 2020

Back-end files cPanel

The cPanel operations can be performed from the back-end/Terminal and some of the important files and their details are pasted below.

WHM related files
Configuration files
/etc/httpd/conf/httpd.conf --- apache configuration file /etc/exim.conf --- mail server configuration file /etc/named.conf --- name server (named) configuration file /etc/proftpd.conf --- proftpd server configuration file /etc/pure-ftpd.conf --- pure-ftpd server configuration file

[rml_read_more]

/etc/valiases/domainname –catchall and forwarders are set here
/etc/vfilters/domainname –email filters are set here
/etc/userdomains –all domains are listed here – addons, parked,subdomains
along with their usernames
/etc/localdomains –exim related file – all domains should be listed here to
be able to send mails
/var/cpanel/users/username –cpanel user file
/var/cpanel/cpanel.config –cpanel configuration file ( Tweak Settings )*
/etc/sysconfig/network –Networking Setup*
/etc/hosts –
/var/spool/exim –
/var/spool/cron –
/etc/resolv.conf –Resolver Configuration
/etc/nameserverips –Nameserver IPs
/var/cpanel/resellers –For addpkg, etc permissions to re-sellers.
/etc/chkserv.d Main >> Service Configuration >> Service Manager
/var/run/chkservd Main >> Server Status >> Service Status
/var/log/dcpumon –top log process
/root/cpanel3-skel –skel directory. Example: public_ftp, public_html
/etc/wwwacct.conf –account creation defaults file in WHM (Basic cPanel/WHM
Setup)
/etc/cpupdate.conf –Update Config
/etc//etc/clamav.conf –clamav (antivirus configuration file )
/etc/my.cnf –mysql configuration file
/usr/local/Zend/etc/php.ini OR /usr/local/lib/php.ini –php configuration file
/etc/ips –-ip addresses assigned to the server (except the shared ip) (IP Functions–>Show IP Address Usage )
/etc/ipaddrpool –IP Addresses which are free on the server
/etc/ips.dnsmaster –name server ips
/var/cpanel/Counters –To get the counter of each users.
/var/cpanel/bandwidth –To get bandwith usage of domains
/var/cpanel/bandwidth –rrd files of domains
/var/cpanel/username.accts –re-seller accounts are listed in this files
/var/cpanel/packages –hosting packages are listed here
/var/cpanel/root.accts –root owned domains are listed here
/var/cpanel/suspended –suspended accounts are listed here
/var/cpanel/users/ –cpanel user file – theme, bwlimit, addon, parked, sub-domains all are listed in this files
/var/cpanel/zonetemplates/ –dns zone template files are taken from here

CPANEL:
/usr/local/cpanel/whostmgr/ –whm related files
/usr/local/cpanel –Cpanel directory
/usr/local/cpanel/base/ –phpmyadmin, squirrelmail, skins, webmail etc
usr/local/cpanel/logs/ –cpanel access log and error log

/usr/local/cpanel/3rdparty/ –tools like fantastico, mailman files are located here
/usr/local/cpanel/addons/ –AdvancedGuestBook, phpBB etc
/usr/local/cpanel/bin/ –cpanel binaries
/usr/local/cpanel/cgi-sys/ –cgi files like cgiemail, formmail.cgi, formmail.pl etc

That’s all !

remove IP from the blacklist DirectAdmin

Failed login attempts to the DirectAdmin control panel several times can mark your IP under blacklist in the server. You may get a message saying “Your IP is blacklisted” when you try to access the control panel via the web browser when the IP is blacklisted in the server. You will be able to remove yourself from the black list by doing the following steps if you have the root access to the server.

To remove yourself from the blacklist, edit:

/usr/local/directadmin/data/admin/ip_blacklist

Remove your IP from the list of IPs marked in the above file. You can find your IP on the following link.

http://www.whatismyip.com/

If you want to ensure you never get blacklisted, you can create and add your IP to the file:

/usr/local/directadmin/data/admin/ip_whitelist

Please note that you can add only one IP in each line.

Hope the above helped you 🙂

Services command line options

Restarting the services that run on the server is one of the common tasks, the services includes Apache, mail, ftp etc. The related service must be restarted to get the changes to take effect if changes are made to any of them. There arise situations at times where the services needs to be restarted when the server load is high, due to crashing or to have configuration change to take effect.

Below are some examples of various common services and their usage flags:

Apache: The Apache need to be restarted after changes have been made to its configuration file, the changes are made mainly to optimize Apache.
root@nixlinux# /etc/init.d/httpd usage: /etc/init.d/httpd (start|stop|restart|fullstatus|status|graceful|configtest|help)

start – start httpd
startssl – start httpd with SSL enabled
stop – stop httpd
restart – restart httpd if running by sending a SIGHUP or start if
not running
fullstatus – dump a full status screen; requires lynx and mod_status enabled
status – dump a short status screen; requires lynx and mod_status enabled
graceful – do a graceful restart by sending a SIGUSR1 or start if not running
configtest – do a configuration syntax test
help – this screen

Mail : The default mail service is exim on cPanel servers, any configuration changes to it will require a restart of the service.
root@nixlinux# /etc/init.d/exim Usage: exim {start|stop|restart|status}

On Plesk servers the default mail service is qmail. Any configuration changes to qmail will require a restart to take effect.
root@nixlinux# /etc/init.d/qmail Usage: /etc/init.d/qmail {start|stop|status|reload|condrestart|restart}

SSH
Any change to the ssh configuration file(such as changing the SSH port) require a restart to take effect.
root@nixlinux# /etc/init.d/sshd Usage: /etc/init.d/sshd {start|stop|restart|reload|condrestart|status}

FTP
On cPanel servers the default FTP program is pure-ftp, as you know it requires a restart when changes have been made.
root@nixlinux# /etc/init.d/pure-ftpd Usage: pure-config.pl {start|stop|restart|condrestart|status}
MySql
root@nixlinux# /etc/init.d/mysql Usage: /etc/init.d/mysql start|stop|restart|reload
Firewall
It is one of the most common tasks that we need to restart the firewall/IPtables after making any changes to its configuration.
root@nixlinux# /etc/init.d/iptables Usage: /etc/init.d/iptables {start|stop|restart|condrestart|status|panic|save}
For advanced policy firewall(APF), do the following. root@nixlinux# /etc/init.d/apf usage: /etc/init.d/apf [start|stop|restart]
Cron
On linux the cron service controls the scheduled tasks that run on the server.
root@nixlinux# /etc/init.d/crond Usage: /etc/init.d/crond {start|stop|status|reload|restart|condrestart}

System Logging
The syslog service controls the system and kernel logging for the server.
root@nixlinux# /etc/init.d/syslog Usage: /etc/init.d/syslog {start|stop|status|restart|condrestart}
That’s it 🙂

How to Install Webmin on Ubuntu Server 12.xx, 13.xx, 14.xx

Hello,

Webmin is one of the most commonly used free web-hosting control panel, it is comparatively a good one for beginners. Installation of Webmin on Ubuntu servers is a little complex compared to installing it on CentOS and all.
There are mainly two methods using which the task can be accomplished. Working with Ubuntu servers are sometimes a little confusing as there are slight differences in the command structure.

How to Install Webmin on Ubuntu?

Method 1:

You can follow the below methods if you are having Debian version of Ubuntu. You have to install the dependencies before installing Webmin. Let’s install that first, you can go for the below command on the terminal.
Action 1:
apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python

Action 2:
Download Debian Webmin from the web:
# wget http://prdownloads.sourceforge.net/webadmin/webmin_1.670_all.deb

Action 3:
Installation:
# dpkg --install webmin_1.670_all.deb

That’s all, we have done it!

How to access Webmin control panel?

Webmin uses the port 10000, you can access the control panel using the following URL:

https://your_ip:10000

Method 2:

In this method we install Webmin with the help of “apt-get“. We will add the repository files needed and will install Webmin using apt-get.
Action 1: Login to the server as root user
Action 2: Add the repository, for that open the /etc/apt/sources.list file using a text editor of your choice. I use my favorite vi editor here:
# vi /etc/apt/sources.list

Then, append the following two lines to the file:

deb http://download.webmin.com/download/repository sarge contrib deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib

Action 3: Fetch and install the GPG key:
The GPG key checks if the package we gonna install is legitimate, this is very important in the aspect of security.
Do the below steps for that:
cd /root wget http://www.webmin.com/jcameron-key.asc apt-key add jcameron-key.asc

Action 3: Installation

Now it’s easy, you can go for the below to commands to have webmin installed on the server.
apt-get update apt-get install webmin

Done! 🙂

Access webmin using the below URL:

http://your_IP:10000

OUTPUT:

Note: If you are getting any errors about SSL like above, try https://your_IP:10000. This error occurs when the webmin is running in the SSL mode. You can disable this in the configuration file.

Thank you for reading! Take care! 🙂