- Boot the server up with a linux disc, such as CentOS 7 in recovery mode
- Once booted, mount 250MB partition. Usually /dev/sda5.
mount /dev/sda5 /mnt - cd to /mnt
- Copy state.tgz to /tmp
cp state.tgz /tmp - cd to /tmp, then extract state.tgz.
cd /tmp; tar -zxvf state.tgz - Extract local.tgz.
tar -zxvf local.tgz - Open the /tmp/etc/shadow file using your favorite text editor.
nano /tmp/etc/shadow - Under your root (or account with root), remove the shadow password. The resulting row may look like this.
root::13358:0:99999:7::: - Now repack all the files back in.
cd /tmp; tar -zcvf local.tgz etc; tar -zcvf state.tgz local.tgz - Copy the state.tgz back into /mnt.
cp /tmp/state.tgz /mnt; - Now reboot the server. Once ESXi is booted back online, you will be able to log into your root with a blank password.
Category: Tech Stuff
Recovering 3CX Admin Login
- Log in as root to your 3CX server
- cd to /var/3cxpbx/Instance1/Bin
- Run the following command
sudo -u phonesystem /usr/sbin/3CXBackupCmd --file=/var/lib/3cxpbx/Instance1/Data/Backups/backup.zip - cd to /var/lib/3cxpbx/Instance1/Data/Backups/ and unzip backup.zip
- In the XML file, locate WEBSERVERPASS
Cleaning sticky DMraid metadata
You may have run into sticky dmraid metadata that doesn’t want to be removed no matter what you do.
Run the following comment on your drive
dd if=/dev/zero of=/DEV/ bs=512 seek=$(( $(blockdev --getsz /DEV/) - 1024 )) count=1024
Replace /DEV to the drive that contain the metadata. Perform a reboot once the command has been run.
Voila!
Litespeed web server + Forbidden: PHP engine is disable
Recently upgraded from Apache (runing suPHP as a PHP handler) to Litespeed.
Everything worked as they should, as Litespeed is a direct drop-in replacement for apache.
However, there is one issue I ran into with Magento.
Bunch of Magento installs weren’t working, even brand new installs are broken. After doing some checking, it appears some important CSS and JS files were being blocked from loading. If you try to load a CSS or JS file in the /pub/static folder, it will fail and return the following message.
Forbidden: PHP engine is disable
After speaking with LiteSpeed support, it appears Magento the previous setup (Apache + suPHP) was working because it somehow ignore the
php_flag engine 0
flags set in the /pub/static/.htaccess file.
There are two ways to fix this.
- Comment out both of the flags in the /pub/static/.htaccess for your Magento install.
- Add the following code in your Litespeed configuration
<IfModule LiteSpeed>
CacheRoot /home/lscache/
php_admin_flag engine on
</IfModule>
If you are running cPanel, then you just have to goto WHM -> Apache Configuration -> Include Editor -> Pre Main Include -> All Versions