Plesk ftp not working Linux.

Plesk ftp not working Linux?

If you are unable to connect to ftp on your server, xinetd failing to start the service due to being unable to resolve the hostname is one possible cause.

Attempt a connection to the ftp daemon.

[root@linserv01 ~]# ftp localhost
Connected to localhost.localdomain.
421 Service not available, remote server has closed connection
ftp>

Check the system messages log for errors

tail - f /var/log/messages

Here we see the error that ProFTPD is unable to resolve the servers hostname.

Feb 21 07:22:03 linserv01 xinetd[1614]: START: ftp pid=7454 from=127.0.0.1
Feb 21 07:22:03 linserv01 proftpd[7454]: warning: unable to determine IP address of ‘linserv01’
Feb 21 07:22:03 linserv01 proftpd[7454]: error: no valid servers configured
Feb 21 07:22:03 linserv01 proftpd[7454]: Fatal: error processing configuration file ‘/etc/proftpd.conf’
Feb 21 07:22:03 linserv01 xinetd[1614]: EXIT: ftp status=1 pid=7454 duration=0(sec)

Add the hostname to /etc/hosts

nano -w /etc/hosts

Add

hostname ipaddress

i.e

linserv01 192.128.125.161

Now press ctrl +x to exit and save.

[root@linserv01 ~]# ftp localhost
Connected to localhost.localdomain.
220 ProFTPD 1.3.1 Server (ProFTPD) [127.0.0.1]
500 AUTH not understood
500 AUTH not understood
KERBEROS_V4 rejected as an authentication type
Name (localhost:root):

Now your Plesk ftp is working.

FTP, Linux, Plesk Linux, Virtual & Dedicated Servers , , , , , , ,

Howto remove Dr Web Plesk Linux

Howto remove Dr Web Plesk on Linux servers.

Red Hat based package managers.

rpm -qa | grep drweb | xargs rpm -e

or,

yum remove packages listed by rpm -qa | grep drweb.

Debian based package managers.

dpkg -l | grep drweb | awk {‘print $2;’} | xargs aptitude remove -y

or,

aptitude remove the packages listed by dpkg -l | grep drweb

Linux, Plesk Linux, Virtual & Dedicated Servers , , , , , ,

Install PHP Ioncube loader Linux

Howto install PHP Ioncube loader Linux.

Download the ioncube loader to your server.

x86 (32 bit).

wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz

x86_64 (64 bit).

wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Extract the archive.

tar -zxf your-archive.tar.gz

Install the Ioncube loader PHP module.

x86 (32 bit).

cd ioncube && cp ioncube_loader_lin_5.3.so /usr/lib/php/modules/

x86_64 (64 bit).

cd ioncube && cp ioncube_loader_lin_5.3.so /usr/lib64/php/modules/

Add the Ioncube loader to the PHP configuration.

x86 (32 bit).

echo “zend_extension=/usr/lib/php/modules/ioncube_loader_lin_5.3.so” > /etc/php.d/ioncube-loader.ini

x86_64 (64 bit).

echo “zend_extension=/usr/lib64/php/modules/ioncube_loader_lin_5.3.so” > /etc/php.d/ioncube-loader.ini

Restart Apache.

service httpd restart

The Ioncube loader is now installed.

[root@linserv01 ~]# php -v
PHP 5.3.3 (cli) (built: Feb 2 2012 18:29:52)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.0.12, Copyright (c) 2002-2011, by ionCube Ltd.

Other versions of the Ioncube loader can be found in the downloads section.

 

Linux, PHP, Virtual & Dedicated Servers , , ,

Recover Plesk password Linux

If you have forgotten your Plesk admin login, heres how to recover Plesk password.

Plesk 9 password recovery.

cat /etc/psa/.psa.shadow

Plesk 10 password recovery.

/usr/local/psa/bin/admin --show-password

 

Linux, Plesk Linux, Virtual & Dedicated Servers , , , ,

Hyper V clock drift Linux

Hyper V clock drift issues Linux fix.

A fix if your Linux virtual machine clock is loosing time sync, using Programmable Interrupt Timer.

Modify the grub boot options.

nano -w /boot/grub/grub.conf

Look for the boot options for the kernel your using.

title CentOS (2.6.18-274.17.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-274.17.1.el5 ro root=/dev/VolGroup00/LogVol00 ide0=noprobe ide1=noprobe noacpi  hda=noprobe hdb=noprobe
initrd /initrd-2.6.18-274.17.1.el5.img

Look for the kernel boot line (will look similar but not exact to the example).

kernel /vmlinuz-2.6.18-274.17.1.el5 ro root=/dev/VolGroup00/LogVol00 ide0=noprobe ide1=noprobe noacpi hda=noprobe hdb=noprobe

add,

notsc divider=10 clock=pit

kernel /vmlinuz-2.6.18-274.17.1.el5 ro root=/dev/VolGroup00/LogVol00 ide0=noprobe ide1=noprobe noacpi hda=noprobe hdb=noprobe notsc divider=10 clock=pit

 

Press ctrl+x to exit and save.

Reboot the machine to boot the kernel with the updated instructions.

Whenever the kernel is updated you will need to modify /boot/grub/grub.conf for the new kernel.

 

Linux, Virtual & Dedicated Servers, Windows , , , , ,

Bash scripting tutorial. Bash scripting introduction Hello World!

Bash scripting tutorial 1.

One of the most powerful tools to have as a Linux administrator is BASH scripting.

Example 1 Simple Hello World!

Create the script using a text editor of your choice, will use nano in this instance.

nano -w hello-world.sh

To execute the script

./hello-world.sh

The numbers in brackets are to denote the explanation but don’t include these in the script.

Code

#!/bin/bash    (01)

echo Hello World    (02)

1. Defines the shell the script is using.

2. Echo outputs what is inputted after it to stdout (standard output/what is outputted to the terminal)

Example 2 Hello you, using hard coded variable.

Code

#!/bin/bash     (01)

name=User    (02)

echo Hi $name Im Bash    (03)

1. Defines the shell the script is using.

2. Sets the variable $name to User

3. Echo displays whats inputted after, in this case the Hi string and the variable we set earlier $name

Example 3 Hello You, using a variable set by input from stdin (standard input/what you type in the terminal)

Code

#!/bin/bash    (01)

echo Hi Im Bash whats your name?    (02)

read name    (03)

echo Hello  $name    (04)

1. Defines the shell the script is using.

2. we know echo by now. If not it displays whats inputted after it wether string or variable

3. Reads the input of stdin (standard input/what is inputted to the terminal) and sets the $name variable to what was inputted by the user

4. Echo ouputs to stdout the string Hello and the variable $name

 

 

Bash Scripting, Linux , ,

PHP info. Checking your PHP install

How to check your current PHP install using PHP info.

Need to find details of the PHP installed on your server?

Create a php script using the text editor of your choice and call it what you want as long as its extension is .php.

Insert the following.

<?php

phpinfo();

?>

Make the script executable (providing your in that directory).

chmod +x phpinfo.php

You will also need to set the ownership permissions on the file to what Apache is running them as so its executable in a browser.

chown user:group phpinfo.php

So if the site is running as an Apache module for example.

chown apache:apache phpinfo.php

Now load the page in your browser to get details of your PHP install.

 

Linux, PHP, Virtual & Dedicated Servers, Windows , ,

Linux package manager commands cheat sheet

Linux package manager commands cheat sheet.

Yum package manager Linux (Yellowdog updater modified).

Install package.

yum install packagename

Update a package.

yum update packagename

Check for updates.

yum check-update

Update a system.

yum update

Search for packages.

yum search packagename

Remove a package (Caution check what your confirming of removing as this will include dependencies sometimes that you dont want to remove).

yum remove packagename

APT-GET  package manager Linux (Advanced packaging tool).

Install package.

apt-get install packagename

Upgrade a package, this is the same as installing.

apt-get install packagename

Check for updates.

apt-get update

Update a system.

apt-get update && apt-get upgrade

Search for packages.

apt-cache search packagename

Removing a package (Not as risky as yum regarding removing dependencies you still need, but still always check what your removing).

apt-get remove packagename

Aptitude package manager Linux (Advanced package tool front end).

Install package.

aptitude install packagename

Update a package.

aptitude install packagename

Check for updates.

aptitude update

Update a system.

aptitude update && aptitude safe-upgrade

Search for a package.

aptitude search packagename

Removing a package (Not as risky as yum regarding removing dependencies you still need, but still always check what your removing).

aptitude remove packagename

To launch Aptitude’s text user interface.

aptitude

RPM package manager Linux (RPM package manager formerly known as Red Hat package manager).

Installing a package.

rpm -i package.rpm

Upgrading a package.

rpm -U packagename

Remove a package excluding dependencies.

rpm -e --nodeps packagename

Search for installed packages  (not piping to grep will list all installed packages).

rpm -qa | grep searchterm

Show package information.

rpm -qi packagename

DPKG package manager Linux (Debian package manager system).

Install or upgrade a package.

dpkg -i packagename.deb

Remove a package.

dpkg -r packagename

Search for installed packages (not piping to grep will list all installed packages).

dpkg -l | grep searchterm

slapt-get package manager Linux (A version of apt-get for Slackware).

Install package.

slapt-get --install packagename

Upgrade a package, this is the same as installing.

slapt-get --install packagename

Check for updates.

slapt-get --update

Update a system.

slapt-get --update && slapt-get --upgrade

Removing a package (Always check what your removing).

slapt-get --remove packagename

 

Portage (The package manager used by Gentoo, I think this is a fork/Linux version of ports used by BSD if it isn’t it works in a similar way) .

Install something.

emerge usbutils

Be prompted first.

emerge --ask usbutils

Simulate an Install.

emerge -pv usbutils

Rebuild kernel modules.

emerge --ask @module-rebuild

Install from a binary.  This needs a lot more in depth (but good for cheat sheet).

emerge -k usbutils

local binaries, if not available will install from source.

emerge -K usbutils

Will only use local binaries, no source.

emerge -g usbutils

Will install local or remote binaries(PORTAGE_BINHOST), or from source

emerge -G usbutils

(Same as the above but will only install from local or remote binary)

Upgrade.

As portage is a ‘package manager’ for a rolling release there isn’t a straight update feature. You have to sync with the Portage tree and then upgrade so will probably cover this in a later post.

There is alot more you can do with these for more info read the man pages (very useful).

i.e

man yum

Or type for more info on what a man page does (man is the manual).

man man

Linux , , , , , , ,