Top Nav

.htaccess – negative file type match

Here’s an example of how to block all files extensions not listed in the regular expression:

 

0

Mounting cloned disk

If you try to mount a cloned disk then you may get an error about duplicate UUID values. You can override with the “nouuid” option:

If the disk is using LVM then additional steps will be required:

Now you can list the partitions with lsblk and mount the desired logical volume with the “nouuid” option.

 

 

0

Mixing Plesk open_basedir path syntax

Plesk uses a convoluted syntax for open_basedir settings in Plesk. You can find this setting on a per-domain basis by navigating the Plesk GUI like this:

Domains -> example.com -> PHP Settings -> Common settings ->  open_basedir

The default setting looks like this:

This breaks down as follows:

The first part, {WEBSPACEROOT}{/} means the the entire webspace root, /var/www/vhosts/example.com/ in this case. This includes httpdocs and any folder in this path.

The second part {:} is the delimiter.

The third part {TMP}{/} means the /tmp directory

Any additional paths can be added by appending a normal UNIX-style path syntax as in this example:

In this case the default plus the PHP 7.2 pear directory is allowed. You can add as many directories as needed using the UNIX style path syntax in combination with the Plesk default. Be sure to use a colon as your delimiter.

0

Drupal Admin Password Reset With Drush

SSH into the website document root and install drush:

Use drush to reset admin user password:

 

0

nodejs Install Via NVM On Shared Hosting

Node can be installed on a shared hosting account if you have SSH but no root access. Using Node Version Manager (NVM) makes it easy to install and manage different node versions.

Here’s the NVM project page:

https://github.com/creationix/nvm

To install get the curl or wget command from here:

https://github.com/creationix/nvm#install-script

Will be something like:

The install may advise you to create or update your .bash_profile with something like:

Immediately after install you may need to run:

Now you can use NVM to:

List available node version:

Install node version:

List locally installed version:

Use node version:

Set the default version:

0