Category: Tips & Tricks

            • Plesk down after upgrade localhost.localdomain

              After upgrade to 10.3.1 when accessing https://host:8443/ you get redirected to :

              https://localhost.localdomain:8443/relay

              To fix:

              /usr/local/psa/bin/sso -g

              /usr/share/plesk-billing/update-hostname –new-hostname=
              /usr/share/plesk-billing/repair-integration –command=repair-all –idp-url=https://:8443

            • planetbackup has a uid 0 account

              cPanel bugs me with this message every day on several servers. Seems its from the tool theplanet.com uses to handle backups.

              Though I don’t understand why does it need uid 0 and why the “OwN3D” word. This does not look too professional.

              Anyway to get passed this you can run :

               

              sed -i ‘s/$user ne \”planetbackup”/$user ne \”toor\” \&\& $user ne \”admin\”/g’ /scripts/hackcheck; echo “/scripts/hackcheck” >> /etc/cpanelsync.exclude

              This is the full email warning:

               

              IMPORTANT: Do not ignore this email.
              This message is to inform you that the account planetbackup has user id 0 (root privs).
              This could mean that your system was compromised (OwN3D). To be safe you should
              verify that your system has not been compromised.

            • Error message: ?open3: exec of /usr/local/cpanel/base/awstats.pl failed at cpsrvd-ssl line 6111

              If you get this error while trying to access Awstats in cPanel, make sure that /usr/local/cpanel/3rdparty/bin/awstats.pl has 755 permissions.

            • How to enable awstats in cPanel

              1. First thing you need to login whm/Cpanel interface using root account and WHM >> Main >>Statistics Software Configuration
              a. Check on Awstats under “Generators Configuration”
              b. tick Allow all users to change their web statistics generating software.
              c. disable all other stats log viewer.

               

              You you may need to generate the log files manually for the initial verification,

              You can use SSH to update the stats by issuing the following command:
              /scripts/runweblogs [username]

               

              You can now see that “last update” option enabled in cPanel>>Logs >>Awstats
              If it is not there, do the following ,
              You can also verify that the setting is actually enabled, by checking the AWStats Configuration File for a particular user.

              1. Login via SSH as root
              2. cd /home/username/tmp/awstats
              3. grep AllowToUpdateStatsFromBrowser awstats.example.com.conf
              4. It should be set to AllowToUpdateStatsFromBrowser=1
              5. If not, edit the file and save.
              6. restart cpanel : service cpanel restart

            • strace multiple pids

              Scenario :

              Some services (e.g: httpd) use multiple pids and sometimes you do not know which is the pid that is being accessed. I’m using this strace command to monitor multiple pids:

              strace $(pidof httpd |sed 's/\([0-9]*\)/\-p \1/g')

            • Transferring a lot of files over the network

              Scenario:

              These days one customer asked me to perform a migration from a shared Hostgator account to two different servers (one for DB and one for the files). Usually for these situations I use rsync but this case was tricky since Hostgator kills the ssh connection if a process takes to long to complete..and since I had to transfer like 1 million files it took 5-10 minute for rsync to pass the “building file list” stage.
              I tried different tricks like doing a:

              find $HOME/public_html > $HOME/files

              in order to store in a file all the file/dir names and then use rsync’s --files-from parameter but without luck. In the end I noticed that I was being disconnected when transferring large files (>2GB). I’ve excluded the involved files by using :

              rsync --stats -P -avz --exclude="error_log" --exclude="user_db.sql" --size-only -e 'ssh -o ServerAliveInterval=30 -o TCPKeepAlive=no -o ServerAliveInterval=15' www/ user@remote_location:/home/user/public_html/

              –size-only = skip files that match in size

              Other trick that I found is using the –bwlimit to limit the transfer speed to a value in KBPS.

              For the larger files I’ve used the classic way (FTP).