Archive

Archive for January, 2021

Create a template from a OpenVZ container on Virtuozzo node with the ploop layout

January 30th, 2021 Comments off

1) SSH to the OpenVZ/Virtuzzo slave node where the source template container is running.

2) Stop the container via SolusVM interface.

3) Create a directory where you wish to mount the container image, e.g.:

mkdir /24x7template

4) Mount the container image using CTID:

mount -t ploop /vz/private/751/root.hdd/DiskDescriptor.xml /24x7template

Note : In the above example, the CTID is 751, you will need to replaced it with the actual your container ID.

[root@server ~]# mount -t ploop /vz/private/751/root.hdd/DiskDescriptor.xml /24x7template
Opening delta /vz/private/751/root.hdd/root.hds
Opening delta /vz/private/751/root.hdd/root.hds
Adding delta dev=/dev/ploop26012 img=/vz/private/751/root.hdd/root.hds (rw)
Mounted /dev/ploop26012p1 at /24x7template fstype=ext4 data=',balloon_ino=12'
[root@server ~]#

5) go to the directory, you will see the files like below:

cd /24x7template
[root@server ~]# cd /24x7template
[root@server 24x7template]# ls -la
total 100
dr-xr-xr-x 19 root root 4096 Dec 10 21:46 .
dr-xr-xr-x. 22 root root 4096 Dec 10 21:48 ..
drwx--x--x 2 root root 4096 Dec 9 02:00 backup
lrwxrwxrwx 1 root root 7 Mar 12 2019 bin -> usr/bin
dr-xr-xr-x 3 root root 4096 Mar 12 2019 boot
drwxr-xr-x 2 root solusvm 4096 Mar 12 2019 dev
drwxr-xr-x 88 root root 12288 Dec 10 21:45 etc
drwxr-xr-x 5 root root 4096 Dec 8 15:24 home
lrwxrwxrwx 1 root root 7 Mar 12 2019 lib -> usr/lib
lrwxrwxrwx 1 root root 9 Mar 12 2019 lib64 -> usr/lib64
drwx------ 2 root root 16384 Mar 12 2019 lost+found
drwxr-xr-x 2 root root 4096 Apr 10 2018 media
drwxr-xr-x 2 root root 4096 Apr 10 2018 mnt
drwxr-xr-x 4 root root 4096 Dec 8 15:22 opt
dr-xr-xr-x 2 root root 4096 Mar 12 2019 proc
-rw-r--r-- 1 root root 109 Dec 8 15:25 razor-agent.log
dr-xr-x--- 14 root root 4096 Dec 10 03:35 root
drwxr-xr-x 3 root root 4096 Mar 12 2019 run
lrwxrwxrwx 1 root root 8 Mar 12 2019 sbin -> usr/sbin
lrwxrwxrwx 1 root root 25 Dec 8 15:20 scripts -> /usr/local/cpanel/scripts
drwxr-xr-x 2 root root 4096 Apr 10 2018 srv
drwx------ 2 root root 4096 Mar 12 2019 sys
drwxrwxrwt 7 root root 4096 Dec 10 21:47 tmp
drwxr-xr-x 13 root root 4096 Dec 8 15:21 usr
drwxr-xr-x 22 root root 4096 Dec 9 13:52 var
-rw-r--r-- 1 root root 0 Dec 9 13:54 .vzfifo

6) Create a template using the following command, e.g. for CentOS 7:

tar --numeric-owner --ignore-failed-read -czpf /vz/template/cache/centos-7-x86_64-ez.tar.gz ./*
[root@server 24x7template]# tar --numeric-owner --ignore-failed-read -czpf /vz/template/cache/centos-7-x86_64-ez.tar.gz ./*
tar: ./usr/local/cpanel/var/cpdoveauth_domainownerd.sock: socket ignored
tar: ./usr/local/cpanel/var/cpauthd.sock: socket ignored
tar: ./usr/local/cpanel/var/cpdoveauthd.sock: socket ignored
tar: ./usr/local/cpanel/var/cpwrapd.sock: socket ignored
[root@server 24x7template]#

7) Unmount the ploop device:

cd ~
umount /24x7template

8) On OpenVZ 7 additional step should be done, the name of the template has to be the following format:

OS-version-bit-custom.tar.gz

It is /usr/libexec/ovz-template-converter –verbose /vz/template/cache/centos-7-x86_64-ez.tar.gz

So the template should be named centos-7-x86_64-ez.tar.gz

Unmounting file system at /tmp/tmpfoOqjQ
Unmounting device /dev/ploop26012
Opening delta /tmp/tmpBs5hMm/root.hds
Deleted the temporary template contents directory /tmp/tmpfoOqjQ
Creating cache file for the selected template
./
./DiskDescriptor.xml
./DiskDescriptor.xml.lck
./root.hds
Compressed 5293219840 bytes into 2133279899 bytes ==> 40.30%
Created cache file for the selected template: /vz/template/cache/centos-7-x86_64-ez.plain.ploopv2.tar.lz4
Deleted the temporary working directory /tmp/tmpBs5hMm
[root@server ~]#

Here if you get “No space left on device” error for /tmp

Refer to below “df -h” command output for /tmp from the node for more details:

/dev/ploop26012p1 4.8G 4.6G 0 100% /tmp/tmpfoOqjQ

Following steps need to perform of the slave server over SSH.

Remove already made configuration for the template:

rm /vz/template/cache/distribution-version-arch[customname.plain.ploopv2.tar.lz4
rm /vz/template/distribution/version/arch/config/os/customname

For example:

rm /vz/template/cache/centos-7-x86_64-custom.plain.ploopv2.tar.lz4
rm /vz/template/centos/7/x86_64/config/os/custom

Then, open the file /etc/vz/conf/vps.vzpkgtools.conf-sample with a text editor and Increase the value of DISKSPACE, for example:

DISKSPACE="20485760:20485760"

Convert the template again:

/usr/libexec/ovz-template-converter --verbose /vz/template/cache/centos-7-x86_64-ez.tar.gz

9) Upload the template file at /vz/template/cache directory on the Master server. Once the templates are uploaded, navigate to Media > List templates and click on the corresponding Add button under the SolusVM interface.

Categories: OpenVZ, Virtuozzo Tags: , ,

WordPress file upload giving: Missing a temporary folder error

January 30th, 2021 Comments off

How to Fix “Missing a Temporary Folder” Error in WordPress

WordPress Missing a Temporary Folder error prevents you from updating themes and plugins, uploading files and images, and even bringing up to date the WordPress core. Here, we will help you solve this issue easily. By the end of this article, your WordPress will be up and running again in no time!

What is “Missing a Temporary Folder” Error in WordPress?

The “Missing a Temporary Folder” error is the result of incorrect PHP settings on your WordPress hosting environment. One of those settings dictates WordPress to store uploaded files in a temporary folder before saving them to the desired location. Without access to that temporary folder, WordPress won’t be able to process your uploaded files and software updates.

Whether or not you deleted the temporary folder by accident, this error occurs when WordPress cannot locate or access that folder.

Now that we’ve covered the culprit behind the “Missing a Temporary Folder” error, let’s see how to fix it in no time.

Fixing “Missing Temporary Folder” Error in WordPress

You can easily fix this WordPress error by modifying your site’s wp-config.php file.

IMPORTANT! Be sure to backup the wp-config.php file before making any changes to prevent data loss.

  1. Establish a connection with your account using an FTP client or File Manager in your hosting control panel. We’ll be using the hPanel for this tutorial.
  2. Access the wp-config.php file from the WordPress root installation folder. In most cases, you can find the file in the public_html directory.
    Searching for the wp-config.php file using Hostinger's File Manager
  3. Add the following code snippet before the line “That’s all, stop editing! Happy publishing”.define(‘WP_TEMP_DIR’,dirname(_FILE_). ‘/wp-content/temp/’);
  4. Save the changes, then re-upload the updated wp-config.php file to your website.
  5. Moving back to the File Manager, locate the /wp-content folder and add a new folder under the name of temp inside it.
    Searching for the temp folder using Hostinger's File Manager
  6. That’s it! After re-logging into your WordPress site, you should be able to upload images again.

IF still issue is not resolved and server is having Cloudlinux installed then follow below step.

Login to the server via SSH.

Try disabling cagefs for that particular user and enable it again using below commands.

cagefsctl --disable $USER
cagefsctl --enable $USER

You can do that from the WHM as well.

Login to the WHM.
Click on Server Configuration » CloudLinux LVE Manager
Click on users tab.Search that user and click on Cagefs enable disable button.

cURL error 60: SSL certificate problem: unable to get local issuer certificate

January 30th, 2021 Comments off

I have faced this issue in webmin/virtualmin server where Let’s encrypt SSL was installed on the domain and while installing jetpack in WordPress it was giving error.

cURL error 60: SSL certificate problem: unable to get local issuer certificate

The problem is with SSL of the domain. If you are using let’s encrypt SSL on the domain then it might give you error. It’s because SSL pem authentication file is missing.

How to fix it?

To fix the issue what you have to do is download the pem file and install it on the server.

Replace the ssl.ca file with this file:

https://letsencrypt.org/certs/lets-encrypt-r3-cross-signed.pem

It is the correct CA intermediate certificate for newly issued Let’s Encrypt certificates.

This is the old one, which you are currently using:

https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem

%d bloggers like this: