Sunday, April 26, 2015

Someone is currently logged into the APC Management Web Server Please try again

If you get a page saying ‘Someone is currently logged into the APC Management Web Server. Please try again later.’ when trying to connect to a managed APC PDU via the web interface there are a couple of likely causes.

  1. Someone is connected via the serial port – this will always override any IP connection.
  2. The web interface is ‘stuck’.
If it’s number 1 then you’ll need to find the machine physically connected and disconnect the terminal session, but the fix for number 2 is quite simple.
Just telnet to the device, then log off. This will reset the APC Management Web Server and you’ll be able to log in.

telnet 100.100.10.10

Connecting to 100.100.10.10:23...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

User Name : username
Password  : ************

Switched Rack PDU: Communication Established

------- Control Console -------------------------------------------------------

     1- Device Manager
     2- Network
     3- System
     4- Logout

     <ESC>- Main Menu, <ENTER>- Refresh, <CTRL-L>- Event Log

Type 4 and Hit enter key
> 4
Connection Closed - Bye

Connection closed by foreign host.

Disconnected from remote host(100.100.10.10) at 17:26:07.

==========================

Friday, April 24, 2015

Sorry! Attempt to access restricted file Vtiger CRM 6.2

To fix this

vi /vtlib/vtiger/deprecated.php +441

Add (comment ) //  in front of:
die("sorry! attempt to access restricted file.");

then see what happens.

HOW TO FIX CSF START ERROR “ERROR: FASTTART: (PACKET FILTER IPV4)”

If you get the below error while restarting/starting csf, then you just need to apply below fix.

csf: FASTSTART loading Packet Filter (IPv4)
Error: FASTTART: (Packet Filter IPv4) [] [iptables-restore: line 14 failed]. Try restarting csf with FASTSTART disabled, at line 4285


Edit csf config file located at /etc/csf/csf.conf and disable FASTSTART by editing FASTSTART = “1” to
FASTSTART = “0”.
Once the change is made restart csf by running csf -r, csf should be running fine now.


Wednesday, March 4, 2015

“Domain already exists” error while adding addon domain in cpanel.

If you are trying to add-on a domain in cPanel and get “Domain already exists” messages, you will have to manually remove the DNS entries before you can add the domain.


If you are unsure who the user is – run this via SSH to get the owner of the domain:

First we need to check if the domain is owned by any particular user.

server# /scripts/whoowns domain.com

or

server# grep domain.com /etc/userdomains
domain.com:username

Now we need to check if the zone file for the domain exists.

server # ls -ld /var/named/domain.com.com.db

-rw------- 1 named named 1055 Mar  4 02:57 /var/named/domain.com.com.db

There exists a zone file for the domain and can remove the zone by executing the below command:

server #/scripts/killdns domain.com

These are the locations to search for any reference to domain.com
/var/cpanel/userdata/<username>/main
/etc/named.conf
/usr/local/apache/conf/httpd.conf
/var/named/domain.com.db
/etc/userdomains
/etc/localdomains
/var/cpanel/users/<username>

Edit any files that are found and remove the entire line that contains the domain name. Once you’ve done this, there shouldn’t be any entry for domain.com in the cPanel configuration file.

Rebuild the User domain database:

server #/scripts/updateuserdomains

Rebuild the Apache configuration

server #/scripts/rebuildhttpdconf

If the server is running on apache

server #  service httpd restart

server # service cpanel restart

You should now be able to add the domain in the ‘add-on domains’ section in cPanel.

Monday, March 2, 2015

How to check last reboot date and time in linux


we can check the last reboot date and time in linux servers by using the following commands

server # who -b
         system boot  2015-01-08 14:36

server # last reboot
reboot   system boot  2.6.18-448.16.1. Thu Jan  8 14:36         (53+11:08)

wtmp begins Tue Dec 30 06:27:45 2014

Temporary URL not working

Inorder to have the temporary URL working, you may need to enable it in WHM first.
Enable “mod_userdir” under WHM > SecurityCenter
If it doesn’t work, then add the below entry in apache configuration file
vi /usr/local/apache/conf/httpd.conf
UserDir enabled username (cpanel user name)

Major cPanel scripts


The following are the major cPanel scripts


adddns – Adds a DNS zone.
addfpmail – Add frontpage mail extensions to all domains without them.
addfpmail2 -Add frontpage mail extensions to all domains without them.
addnetmaskips – Add the netmask 255.255.255.0 to all IPs that have no netmask.
addnobodygrp – Adds the group nobody and activates security.
addpop – Add a Pop Account.
addservlets – Add JSP support to an account (requires tomcat).
addstatus – (Internal use never called by user).
adduser – Add a user to the system.
admin – Run WHM Lite.
apachelimits – Add rlimits to Apache
betaexim – Installs the latest version of exim.
biglogcheck – looks for logs nearing 2 gigabytes in size
bsdcryptoinstall – Installs crypto on FreeBSD.
bsdldconfig – Configures the proper lib directories in FreeBSD.
bsdpkgpingtest – Tests the connection speed for downloading FreeBSD packages.
buildbsdexpect – Install expect on FreeBSD.
buildeximconf – Rebuilds exim.conf.
buildpostgrebsd-dev – Installs postgresql on FreeBSD.
checkbadconf – Checks /usr/local/apache/conf/httpd.conf for bad users.
checkbsdgroups – Checks and repairs proftpd ownership on FreeBSD.
checkccompiler – Checks to make sure the C compiler works on your system.
checkfpkey – Checks for the FrontPage suid key
checkgd – Checks to see if GD is built.
checkinterchange – (Internal use).
checklibssl – Checks to make sure the proper libssl symlinks exist.
checkmaxclients – Checks to see if apache has reached the maximum clients allowed.
checkoldperl – Checks to see if the version of Perl on your system is old.
checkrsync – Checks to make sure rsync is up to date.
checksuexecpatch – Checks to see if mailman has been patched for suexec.
checksuspendpages – Checks to see if suspend pages are properly named.
checkup2date – Makes sure up2date is set up properly (RedHat)
checkyum – Makes sure yum is set up properly.
chkpaths – Makes sure /usr/sbin/chown has a symlink to /bin/chown
chownpublichtmls – Change ownership of all users web space to them, which is useful for converting to suexec. Files owned by nobody are deleted.
chpass – Change password.
ckillall – Allows you to kill a process (used like killall).
ckillall2 – Allows you to kill a process.
cleanbw – Cleans up old bandwidth logs.
cleandns8 – Clean up named.conf.
cleangd – Cleans up old GD installs and reinstalls GD
cleanmd5 – Fix CPAN md5 problems.
cleanmsglog – cleans exim’s msglog
cleanupmysqlprivs – Cleans up improper mySQL privileges.
compilers – Disables the usage of compilers for unprivileged users.
convert2maildir – Converts mail from mbox to maildir format and installs courier impap and pop (cpimap is removed).
courierup – Updates/Installs Courier
cpbackup – Runs backups.
distupgrade – Upgrades RedHat to the newest version (for testing only)
dnscluster – Enables DNS clustering.
dnsqueuecron – Adds a cron job to dump the DNS queue.
dnstransfer – Only if the server has a DNS master (sync with DNS master).
downgradefp – Downgrades FrontPage Extensions (to 5.0-0)
dropmysqldb – Drops a mySQL database.
easyapache – Upgrade Apache
editquota – Change a users quota.
enablechkservdwebmail – Enable service checking of webmaild.
enablefileprotect – Protects home directories if file protection is built in apache.
ensurepkg – Installs a FreeBSD package.
ensurerpm – Installs a rpm.
exim3 – Installs exim 3.
exim4 – Installs exim 4.
exim4-rh73test – Installs exim release #260. (RedHat only)
eximcron – Creates a cron job for exim_tidy_db.
eximlocalsend – Enables/Disables exim local sending.
exim_tidydb – Cleans the exim message log.
eximup – Installs/Updates exim.
fetchgd – Includes libg.so.
findhacks – Search for common Trojan Horses.
findoddrootprocesses – Lists root processes that may need to be checked out.
findphpversion – Check to see if your php version file is up to date.
findtrojans – Exhaustive Trojan Horse search.
fixallcartswithsuexec – Fixes permissions on carts when using suexec.
fixallinterchangeperm – Fixes permissions on all users’ Interchange Shopping Carts.
fixbinpath – Makes sure all bin file paths are correct.
fixbuggynamed – Updates bind to solve any problems with bugs.
fixcommonproblems – Attempt to fix the most common problems.
fixetchosts – Fixes problems with /etc/hosts
fixeverything – Fix common problems and quotas.
fixfpwml – Fix for .wml errors with frontpage.
fixheaders – Run if nothing compiles errors with .h files on compile.
fixinterchange – Reinstall interchange Perl modules.
fixinterchangeperm – fix permissions on a user’s interchange cart.
fixipsnm – Same as addnetmask ips, but Perl though.
fixlibnet – Reinstall Bundle::libnet (Perl).
fixlocalhostwithphp – Change /etc/hosts to work better with PHP 4.2.0 + MySQL.
fixmailman – Updates and restarts mailman.
fixmailmanwithsuexec –
fixmuse – Reinstalls muse.
fixmysql – Fixes problems with mySQL.
fixmysqlbsd – Fixes problesm with mySQL on FreeBSD.
fixnamed – Updates bind to handle many DNS zones (more than 512).
fixndc – Repair redhat’s broken named.conf on 7.2.
fixoldlistswithsuexec – Run after enabling suexec on the server to change the URLs that Mailman gives out to ones that don’t give a 500 internal server error.
fixperl – Symlink /usr/local/bin/perl /usr/bin/perl.
fixperlscript – Makes sure a perlscript includes all corresponding modules.
fixpop – Fix a POP account and reset password.
fixproftpdconf – Fixes problems with /usr/local/etc/proftpd.conf
fixproftpddupes – Updates proftpd.
fixquotas – Fix quotas.
fixrndc – Fixes named.conf to prevent rndc staus failed.
fixspamassassinfailedupdate – Reinstalls a failed spamassassin update.
fixsubdomainlogs – Run if subdomain logs don’t show up in cPanel.
fixsuexeccgiscripts – Fix CGI scripts that are broken after suexec installed.
fixvaliases – Fix permisions on valiases.
fixwebalizer – Repair a Webalizer that has stopped updating.
fp3 – Updates the fpexe3 patch.
fpanonuserpatch – Updates FrontPage extensions to include the anonymous user patch.
ftpcheck – Checks for FTPSSL.
ftpquaotacheck – Runs quota checking for all ftp users.
ftpup – Updates your ftp server.
fullhordereset – Resets Horde and displays the current Horde password.
futexfix – Fixes problesm with futex.
futexstartup – Starts futex.
gcc3 – Installs gcc-3.3.3
gencrt – Generate a .crt and .csr file.
grpck – Checks to see if grpck is working properly.
hdparmify – Enable dma/irq/32bit HD access, which speeds up IDE drives.
hdparmon – Turns on hdparm.
initacls – Mounts your file systems with ACL support (make sure your kernel supports ACLs)
initfpsuexec – Enable FrontPage suexec support.
initquotas – Turn on quota support on new drives.
initsslhttpd – Make sure HTTP starts with SSL.
initsuexec – Turn on suexec support if suexec is installed.
installcgipm – Installs CGI.pm
installdbi – Install Bundle::DBD::mysql.
installfpfreebsd – Installs FrontPage 5 Extensions on FreeBSD.
installfpgentoo – Installs FrontPage on Gentoo.
installgd – Builds GD.
installpkg – Installs a FreeBSD package.
installpostgres – Installs PostrgeSQL.
installrpm – Installs a rpm.
installspam – Install SpamAssassin.
installssl – Add a SSL vhost.
installzendopt – Install zend optimzer.
installzendopt-freebsd – Install zend optimizer on a freebsd machine.
isdedicatedip – Checks an ip to see if it is dedicated.
killacct – Delete an account.
killbadrpms – Security script that kills insecure RPMs from the server.
killdns – Delete a DNS zone.
killdrrootvhost – Removes the document root for a virtual host.
killndbm – Remove the broken NDBM_File module from 7.2.
killpvhost – Removes a virtual host from proftpd.conf.
killspamkeys – Removes a spam key.
killsslvhost – Removes a SSL entry for a virtual host.
killvhost – Delete a vhost.
listcheck – Checks mailing lists for issues.
listproblems – Lists common problems.
listsubdomains – List subdomains.
mailperm – Fix almost any mail permission problem.
mailscannerupdate – Updates MailScanner
mailtroubleshoot – Guided mail fix.
makecpphp – Installs php.
makesecondary – Part of DNS transfer.
manualupcp – Updates cPanel manually.
md5crypt – Encrypts a password into MD5.
mseclocal – Sets up Mandrake’s msec to allow exim to run as mailnull.
mysqladduserdb – Create a MySQL databse and user.
mysqlconnectioncheck – Attempts to connect to MySQL, restarts SQL if necessary.
mysqldeluserdb – Delete a MySQL database and user.
mysqlpasswd – Change MySQL password.
mysqlrpmpingtest – Checks your connection speed for downloading mySQL rpms.
mysqlup – Updates mySQL.
ndbmcheck – Checks to see if the nbdm module is loaded (kills in RedHat 7.2)
netftpsslpatch – Patches FTPSSL.pm.
newexim – Installs the latest version of exim.
nofsck – Make fsck always use -y
nomodattach – Removes mod_attach from httpd.conf.
nomodauthmysql -Removes mod_auth_mysql from httpd.conf.
nomodbwprotect – Removes mod_bwportect from httpd.conf.
nomodgzipconfmods – Removes mod_gzip from httpd.conf.
nomodperl – Removes mod_perl from httpd.conf.
oldaddoncgi2xaddon – Updates old addons to X addons.
park – Parks a domain.
patcheximconf – Fixes exim.conf.
perlinstaller – Installs perl.
phpini – Create a php.ini file.
pingtest – Checks your download time from cPanel mirrors.
pkgaccount-ala – backs up an Alab*nza account for transfer.
pkgacct-ciXost – backs up a ci*ost account for transfer.
pkgacct-dXm – backs up a d*m account for transfer.
pkgacct-enXim – backs up an en*im account for transfer.
pkgacct-pXa – backs up a p*a account for transfer.
proftpd128 – Installs proftpd-1.2.8.
ptycheck – Fixes permissoins on /dev/ptmx.
pwck -Verifies the integrity of system authentication information.
quickkernel – Updates your kernel.
quicksecure – Quickly kill useless services.
rebuildcpanelsslcrt – Rebuilds the cPanel SSL Certificate.
rebuildcpusers – Rebuilds /var/cpanel/users.
rebuildetcpasswd – Rebuilds /etc/passwd.
rebuildeximbsd – Rebuilds exim on FreeBSD.
rebuildhttpdconffromproftpd – Rebuild httpd.conf from the proftpd.conf file.
rebuildinterchangecfg – Used after moving a domain with Interchange to the server.
rebuildnamedconf – Restore named.conf from files in /var/named.
rebuildproftpd – Restore proftpd.conf from httpd.conf.
reinstallmailman – Reinstalls mailman.
relocatevartousr – Relocates files from /var to /usr in case of disk space issues.
remdefssl – Remove default SSL vhost.
reseteximtodefaults – Resets exim’s default settings.
resetimappasswds – Resets all imap passwords.
resetquotas – Change quotas to what they should be .
restartsrv – Restart a service.
restartsrv_apache – Restart apache.
restartsrv_bind – Restart bind.
restartsrv_clamd – Restart clamd.
restartsrv_courier – Restart courier imap.
restartsrv_cppop – Restart cppop.
restartsrv_entropychat – Restart entropy chat.
restartsrv_exim – Restart exim.
restartsrv_eximstats – Restart exim statistics.
restartsrv_ftpserver – Restart your ftp server.
restartsrv_httpd – Restart httpd.
restartsrv_imap – Restart impad.
restartsrv_inetd – Restart inetd.
restartsrv_interchange – Restart Interchange Shopping Cart.
restartsrv_melange – Restart melange chat.
restartsrv_mysql – Restart mysqld.
restartsrv_named – Restart named.
restartsrv_postgres – Restart postgresql.
restartsrv_postgresql – Restart postgresql.
restartsrv_proftpd – Restart proftpd.
restartsrv_pureftpd – Restart pure-ftpd.
restartsrv_spamd – Restart spamd.
restartsrv_sshd – Restart sshd.
restartsrv_syslogd – Restart syslogd.
restartsrv_tomcat – Restart tomcat.
restartsrv_xinetd – Restart xinetd.
restoremail – Restores a user’s mail.
reswhostmgr – Restart whostmgr.
rpmup – Upgrade redhat/mandrake errata/security.
rrdtoolinstall – Installs RRD Tool.
runstatsonce – Runs statistics (should be used from the crontab).
runweblogs – Run analog/webalizer/etc. for a user.
safeperlinstaller – Installs perl safely.
safeup2date – Runs up2date safely.
safeyum – Runs yum safely.
secureit – Remove unnecessary suid binaries.
securemysql – Attempts to secure the MySQL configuration.
securetmp – Adds securetmp to system startup.
setupfp – Install FrontPage 3 on an account.
setupfp4 – Install FrontPage 4 (2000) installer on an account.
setupfp5 – Install FrontPage 5 (2002) installer on an account.
setupfp5.nosueuxec – Install FrontPage 5 (2002) installer on an account when not using suexec.
showexelist – Shows exe processes.
simpleps – Display the process list.
smartcheck – Checks hard drive integrity.
smtpmailgdionly – Enables SMTP Mail Protection.
spamboxdisable – Disables SpamAssassin’s spambox delivery for all accounts.
suspendacct – Suspends an account.
sysup – update cPanel RPMs.
unlimitnamed – Installs the latest version of bind patched to support greater than 512 ips on the server.
unblockip – Unblocks an IP blocked by portsentry.
unsetupfp4 – Removes FrontPage 4 or 5 from an account.
unslavenamedconf – If the user accidentally sets a DNS master as local server, this will repair named.conf after the loop.
unsuspendacct – Unsuspends an account.
upcp – Updates cPanel.
updated – Updates /scripts.
updatefrontpage – Updates FrontPage
updatenow – Updates /scripts NOW.
updatephpconf – Updates PHP configuration files.
whoowns – Finds out who owns a domain.

wwwacct – Creates an account.

Find roundcube, horde and squirrelmail version provided by the cPanel

server # cat /var/cpanel/roundcube/version
0.9.5.cp1~

server # cat /var/cpanel/squirrelmail/version
14346.cp4~

server # cat /var/cpanel/horde/version
5.1.4-1.cp1142
~

Error: Log is currently being processed in the background. Cannot update.

When you manually update awstat for any domain via cpanel, If you get the following error
_________________________________________________________
Error: Log is currently being processed in the background. Cannot update.
_________________________________________________________

To fix this issue,
When you check the domlogs, you could see that every domain.com had a backup log file named domain.com.bkup

/usr/local/apache/domlogs/domain.com.bkup

You just rename the domain.com.bkup as domain.com.bkup.1 or whatever you wish.

And update awstat.

Fixed.. :)

Saturday, January 31, 2015

Updating Webalizer Manually, To update Webalizer stats for a single domain on the Cpanel server

 
cd /home/USER/tmp/webalizer/

/usr/local/cpanel/3rdparty/bin/webalizer /usr/local/apache/domlogs/USER_DOMAIN -n USER_DOMAIN

=============================

Use the following commands to preserving old stats,

Below are set of commands:

cd /home/USER/tmp/
cp -af webalizer webalizer.old
cp -af webalizerftp webalizerftp.old
cd webalizer
/usr/local/cpanel/3rdparty/bin/webalizer /usr/local/apache/domlogs/domainname -n domainname


============================

 

Wednesday, January 21, 2015

MySQL: ERROR 1010 (HY000): Error dropping database (can't rmdir './suhail', errno: 39)

The problem 
==========
mysql> drop database suhail;
ERROR 1010 (HY000): Error dropping database (can't rmdir './suhail', errno: 39)

The solution
==========
# cd /var/lib/mysql 
var/lib/mysql# ls
suhail
/var/lib/mysql# rm -fr suhail
mysql> drop database suhail;
ERROR 1008 (HY000): Can't drop database 'suhail'; database doesn't exist
mysql> create database suhail;
Query OK, 1 row affected (0.00 sec)
mysql> drop database suhail;
Query OK, 0 rows affected (3.38 sec)