Plesk autoinstaller GPG error on Ubuntu 14.04 Trusty

Getting error for Plesk auto installer on Ubuntu 12 Trusty:


Reading package lists...
W: GPG error: http://autoinstall.plesk.com trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 227C38D6AF741DEB
W: GPG error: http://autoinstall.plesk.com trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 227C38D6AF741DEB
W: GPG error: http://autoinstall.plesk.com trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 227C38D6AF741DEB
W: GPG error: http://autoinstall.plesk.com trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 227C38D6AF741DEB
W: GPG error: http://autoinstall.plesk.com trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 227C38D6AF741DEB
Gathering information about installed license key...
Checking whether the package dependencies are resolved.
E: Unable to correct problems, you have held broken packages.
---X--- `apt-get` output ---------------------
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
plesk-base : Depends: sw-engine (>= 2.13.9) but it is not going to be installed
plesk-core : Depends: libmyodbc but it is not installable
Depends: pigz but it is not installable
plesk-php56-dba : Depends: libdb5.1 but it is not installable
plesk-php56-imap : Depends: libc-client2007e but it is not installable
plesk-php56-mcrypt : Depends: libmcrypt4 but it is not installable
plesk-service-node-utilities : Depends: libxml-dumper-perl but it is not installable
Depends: sysv-rc-conf but it is not installable
pp12.0.18-bootstrapper : Depends: sw-engine (>= 2.0) but it is not going to be installed
psa-courier-imap : Depends: libdb5.1 but it is not installable
Depends: libssl0.9.8 but it is not installable
psa-php5-configurator : Depends: php5-imap but it is not installable
psa-updates : Depends: sw-engine (>= 2.13.12) but it is not going to be installed

Check following:

1. /etc/apt/sources.list

2. uncomment the deb repos listed as universal/multiverse

3. re-run apt-get update

4. re-run plesk installer

I have also noticed that it tends to give an error about the hostname as well, which I resolved by temporarily setting the hostname to pretty much anything, such as newserver.

Other Information: http://forum.odin.com/threads/plesk-autoinstaller-gpg-error.332686/

Change Date for Ubuntu Server

Check your current timezone by just running


# date
Thu Mar 21 18:02:49 MST 2012

Or checking the timezone file at


# more /etc/timezone
US/Arizona

So to change it just run


$ sudo dpkg-reconfigure tzdata

And follow on screen instructions. Easy.

Also be sure to restart cron as it won’t pick up the timezone change and will still be running on UTC.

# /etc/init.d/cron stop
# /etc/init.d/cron start

A chkconfig alternative to Ubuntu

sysv-rc-conf is an alternate option for Ubuntu.


# sudo apt-get install sysv-rc-conf


# sysv-rc-conf --list xxxx

Also, to disable a process at boot, you could simply disable it by:

# sudo update-rc.d apache2 disable

and then if you would like to enable it again:


# sudo update-rc.d apache2 enable

Add resolvers to ubuntu server


sudo nano /etc/network/interfaces


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static 
address ipAddress 
netmask 255.255.255.0 
gateway gatewayIP 
dns-nameservers 69.64.66.11 69.64.66.10

Once you have entered the values correctly, press Ctrl+Enter to save it with the current filename, then press Ctrl+X to exit the editor.

Provided you entered your values correctly, verify the new settings by retyping the cat command:


cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static 
address 123.45.67.89
netmask 255.255.255.0 
gateway 123.45.67.1 
dns-nameservers 8.8.8.8 8.8.4.4

Apply setting to Interface

After you have determined the values entered are correct, restart networking with the following command:


sudo service networking restart
stop: Unknown instance: 
networking stop/waiting
administrator@ubuntu:~#

Verify it works
To verify the resolvers are working, simply ping a known domain.


ping google.com
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=45 time=42.1 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=45 time=42.2 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=45 time=42.0 ms

Server time off in Ubuntu 14.04

To install ntp on Ubuntu, Linux or debian based distribitions


# apt-get update
# apt-get install ntp

To install ntp on Fedora, Centos or redhat based distribitions


# yum install ntp
After you set your timezone correcly, you should be able to synce your date and time with ntp command


# ntpdate pool.ntp.org


# ntpdate 0.ubuntu.pool.ntp.org
19 Feb 18:42:09 

You can edit the file /etc/ntp.conf to control certain variables with the NTP service, and can start and stop the file using “/etc/init.d/ntp [status|start|stop]”.

Ghost Vulnerability

A very serious security problem has been found and patched in the GNU C Library called Glibc. It was announced on 27th January 2015.

Here are the affected Linux distros:

  • RHEL (Red Hat Enterprise Linux) version 5.x, 6.x and 7.x
  • CentOS Linux version 5.x, 6.x & 7.x
  • Ubuntu Linux version 10.04, 12.04 LTS
  • Debian Linux version 7.x
  • Linux Mint version 13.0
  • Fedora Linux version 19 or older
  • SUSE Linux Enterprise 11 and older (also OpenSuse Linux 11 or older versions).
  • SUSE Linux Enterprise Software Development Kit 11 SP3
  • SUSE Linux Enterprise Server 11 SP3 for VMware
  • SUSE Linux Enterprise Server 11 SP3
  • SUSE Linux Enterprise Server 11 SP2 LTSS
  • SUSE Linux Enterprise Server 11 SP1 LTSS
  • SUSE Linux Enterprise Server 10 SP4 LTSS
  • SUSE Linux Enterprise Desktop 11 SP3
  • Arch Linux glibc version <= 2.18-1

Read More to Fix the GHOST vulnerability on a CentOS/RHEL/Fedora/Ubuntu Linux

Read more

Reset the Mysql password

How to reset the mysql password on a linux server.

CentOS

First, stop the MySQL service/daemon. On Centos/RHEL you would run:

# service mysqld stop

Next, edit the MySQL config file (/etc/my.cnf on CentOS/RHEL) and add the following to the [mysqld] section.

# skip-grant-tables

Start MySQL back up

# service mysqld start 

You will now be able to connect as user root without any password.

Run the following SQL queries:

mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; 
FLUSH PRIVILEGES;

Remove the skip-grant-tables line from the MYSQL config file, and restart MySQL one final time.

Ubuntu 16

First off stop mySQL

# sudo service mysql stop

Now manually create the socket directory for MySQLD to be able to start up and give mysql permissions to it. (THIS is the most important step that all guides fail to mention leading people into doing very stupid thing when they cannot get mysqld to start)

# sudo mkdir /var/run/mysqld; sudo chown mysql /var/run/mysqld

Now start mysql with the –skip-grant-tables option because you are not checking user privs at this point

# sudo mysqld_safe --skip-grant-tables &

Now log into mysql as root

# sudo mysql -u root

Now run the following commands in the mysql console

mysql> use mysql;
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR root@'localhost' = PASSWORD('yournewpassword');
mysql> FLUSH PRIVILEGES;
mysql> exit

Now stop mySQL and Restart it

# sudo service mysql stop
# sudo service mysql start

or

# sudo /etc/init.d/mysql stop
# sudo /etc/init.d/mysql start

Check if mySQL started properly by running

# sudo service mysql status

Now to make sure everything is OK reboot your server and after reboot run

# sudo service mysql status

Now you can test logging into mySQL with your new password by running

# mysql -u root -p

Add additional IP’s to Ubuntu Server

Here is how to add additional IP’s to your Ubuntu server

Add it to the server just on a temporary basis. A reboot will erase the changes.

Using ifconfig

If you want to add a secondary IP address to a NIC already in use in Linux, and have that change only temporary. Enter this command:

# ifconfig [nic]:0 [IP-Address] netmask [mask] up

Example:

#ifconfig eth0:0 192.168.1.2 netmask 255.255.255.0 up

If you prefer to use the ip command instead of ifconfig

# ip address add [ip]/[mask-digits] dev [nic]

IP command example

#ip address add 192.168.99.37/24 dev eth0

With this command you can add more ip address to the same NIC, the second is considered as secondary.

Add a permanent IP address to the Server

For Ubuntu systems, edit the /etc/network/interfaces file

# nano /etc/network/interfaces

Example:


auto eth0:1
iface eth0:1 inet static
address 192.168.0.1
gateway 192.168.0.254
netmask 255.255.255.0

The restart networking for the changes to take effect

~# service networking restart
 * Reconfiguring network interfaces... 

Check to see if the IP’s re enabled

# ifconfig

You should see the additional IP’s here

You can add What you need. Just change eth0:1 for eth0:2, eth0:3 etc. This can also be done for any other network cards like eth1, eth2, etc.

If the network show this:

# nano /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto em1
iface em1 inet static
address 162.xx.xx.xx
netmask 255.255.255.0
gateway 162.xx.xx.1
broadcast 162.xx.xx.255
dns-nameservers 8.8.4.4

Add this

auto em2
iface em1 inet static
address 10.156.1.xxx
netmask 255.255.255.224