Currently Viewing Posts in L.A.M.P.

Force IPv4 when using APT command in Ubuntu

Sometimes you may want to disable IPv6 when using apt update command or some other apt operation.

If you want to use IPv4 in one command, just run following:

$ sudo apt -o Acquire::ForceIPv4=true update

If you want to force to use IPv4 for all apt operations, add a new file under /etc/apt/apt.conf.d/

$ sudo nano /etc/apt/apt.conf.d/99force-ipv4

Then add a line:

Acquire::ForceIPv4 "true";

If you want to disable IPv4, change the IPv4 to IPv6.

Nginx : Unit nginx.service is masked

Complied a Nginx server to the latest version and also add Brotli support, but get the following error message:

$ sudo service nginx status
* nginx.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)

$ sudo service nginx restart
Failed to restart nginx.service: Unit nginx.service is masked.

Solution

To fix the problem, or error, just unmask with the command:

$ sudo systemctl unmask nginx.service

 

How to upgrade Proxmox Virtual Environment 5.4.x

I am using a Proxmox VE for a while. It is almost one month I start to use Proxmox VE 5.3-8.

I noticed that Proxmox VE has newer version released. Now it is v5.4-4.

I have not subscribe the license of PVE.

 

Here is a simple guide to show you how to upgrade Proxmox VE 5.3x to v5.4x

1) Edit /etc/apt/sources.list.d/pve-enterprise.list

Comment or delete the following line.

deb https://enterprise.proxmox.com/debian/pve stretch pve-enterprise

2) Edit /etc/apt/sources.list

Add following line at the end of the file.

deb http://download.proxmox.com/debian stretch pve-no-subscription

3) Now, it is OK to do the update.

apt update

apt upgrade

apt dist-upgrade

 

Continue reading “How to upgrade Proxmox Virtual Environment 5.4.x”

Hot to fix the problem on the new installation MariaDB

After the installation of MySQL server or MariaDB on Ubuntu, I would like to use phpMyAdmin or Adminer to access the MySQL server. But the first time the error comes like below.

Access denied for user ‘root’@’localhost’

mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’localhost’

MySQL connect error on phpMyAdmin

 

MySQL connect error on Adminer

Here is the solution to make the root connect to a server without error.

Continue reading “Hot to fix the problem on the new installation MariaDB”

How to enable the VM auto-boot in Proxmox VE

After the setup of my first Proxmox VE, I need to shutdown and startup your Proxmox hardware node. There are many reasons for this such as adding new hardware or to apply new kernel updates.

Before shutting down the Host machine, I have to shutdown the LXC container and all VMs.

When I start the Proxmox VE host node, the VM will not start up automatically. I will do it manually.

Here is the way to make the VMs auto-start with the HOST.

Datacenter > Virtual Machine > 109 (example.com) > Options > Start at boot

Double click the “Start at boot”, select the check box and OK.

Start at boot, options of Virtual Machine in Proxmox VE

Continue reading “How to enable the VM auto-boot in Proxmox VE”

Another way to move Virtualbox VDI to Proxmox VE

There is another way to do the importing Virtualbox VDI to Proxmox VE 3.5-8.

Similar to my previous post.

Step 1, Copy the VDI into the Proxmox VE host

No need to covert the VDI file to RAW format. Just copy the vdi file into the local folder. For me, I will just put it at /root/testing.vdi

Step 2, Create a new VM in Proxmox

On the “OS” tab, choose “Do not use any media”

On the “Hard Disk” tab, choose “local-lvm”, as storage, Disk size is any size you want, for example, 8GB. Format, choose “Raw disk image (raw)”, On CPU and Memory, choose the same as the Virtualbox settings.

Confirm to create the new VM.

Step 3, Detach and Remove the Hard Disk

Say my VM ID is 109, choose Virtual Machine 109, Hardware, Hard Disk, choose “Detach” button.

Detach the Hard Disk

At this point, the hard disk will be listed as “Unused Disk.” It still exists but is not attached to the system. To destroy it completely, select the Unused Disk and click Remove again; and confirm when prompted.

Continue reading “Another way to move Virtualbox VDI to Proxmox VE”

Error when doing update on Proxmox VE

I got these errors when trying to run an update on my Proxmox VE 5.3-8

root@pve:/etc/apt# apt update Hit:1 http://security.debian.org stretch/updates InRelease Ign:2 http://ftp.ca.debian.org/debian stretch InRelease Get:3 http://download.proxmox.com/debian jessie InRelease [2,413 B] Hit:4 http://ftp.ca.debian.org/debian stretch-updates InRelease Err:3 http://download.proxmox.com/debian jessie InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C23AC7F49887F95A Hit:5 http://ftp.ca.debian.org/debian stretch Release Ign:7 https://enterprise.proxmox.com/debian/pve stretch InRelease Err:8 https://enterprise.proxmox.com/debian/pve stretch Release 401 Unauthorized Reading package lists... Done W: GPG error: http://download.proxmox.com/debian jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C23AC7F49887F95A E: The repository 'http://download.proxmox.com/debian jessie InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'https://enterprise.proxmox.com/debian/pve stretch Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

How to fix these errors?

Continue reading “Error when doing update on Proxmox VE”

SSL Certificate Checker

After installing the SSL certificate on the Nginx web server, you need to check if it is installed correctly.

I installed the SSL certificate two months ago. The Sectigo ECC certificate.

Now I change the certificate files.

Previously, I put the site SSL certificate file content and the SSL-bundle file altogether. The final SSL certificate file is 4.36KB. It includes three certificates. The guide is from Comodo official site. Sectigo site has a similar guide here.

Now, I remove the last one. Just keep the site certificate and the middle one. Total size is  3.01KB.

The certificate I deleted from the old file is for USERTrust ECC Certification Authority. It is already included in the Trusted Root CA list.

Then, I tested the new certificate file, which has two certificates only, on different online SSL checking tools.

 

Geocerts SSL checking Result

Continue reading “SSL Certificate Checker”

  • Archives