How to install Webhosting Guide

Apache PHP Mysql Bind DNS Yum

Archive for the 'AdminTutorials' Category

Fantastico Error: enc_restrictions.inc.php is protected by SourceGuardian

Fantastico Error: enc_restrictions.inc.php is protected by SourceGuardian and requires file ixed.lin.4.X.X.pxp, 4.3.7.pxp, 4.3.8.pxp, 4.3.9.pxp error

/usr/local/cpanel/base/3rdparty/fantastico/includes/enc_restrictions.inc.php is protected by SourceGuardian and requires file ixed.lin.4.3.9.pxp.
Please read SourceGuardian protected scripts manual.

Unfortunately many server administrators get this error ever now and then on their server, netenberg has failed to address the problem and has only provided the following temporary fix everytime the problem arises. This tutorial provides the steps needed to fix the problem on your server. This is a very simple tutorial and throughout most of it you can simply copy and paste via your SSH terminal.

Simple way: (Please note that if this does not work try the complex way):

Linux Code:
cd /tmp
chattr -i ixed
rm -Rf ixed*
wget -N http://netenberg.com/files/ixed.tgz
tar xzpf ixed.tgz
rm -f ixed.tgz
chattr +i ixed

FreeBSD Code:
cd /tmp
chflags noschg ixed
rm -Rf ixed*
wget -N http://netenberg.com/files/ixed.tgz
tar xzpf ixed.tgz
rm -f ixed.tgz
chflags schg ixed

PLEASE NOTE: If you’ve already done this in the past, but you start receiving errors again, check to see if PHP has been upgraded to a newer version. If so, you may need to fetch newer ixed files to cover your version of PHP. SourceGuardian updates ixed files fairly quickly, but if you can’t find an ixed file for your version of PHP, then try renaming the latest version of the ixed file prior to your version to match your version:

FreeBSD and Linux Code:
cd /tmp/ixed
cp ixed.lin.4.3.8.pxp ixed.lin.4.3.9.pxp

This fix may or may not work, on each version of PHP a new ixed file is released, so by doing this you are creating a fake version. As soon as the real ixed files gets released for your version of PHP then replace your fake version with the real version (by following the first set on instructions).

Complex Fix: (Adds ixed decoder files as a Dynamic Extentions to the php.ini file. However CPanel may modify php.ini on a daily basis and you may have to fix over and over again)

Code:
cd /usr/local/cpanel/3rdparty/etc/
rm -f ixed.tgz
wget http://netenberg.com/files/ixed.tgz
tar xzpf ixed.tgz
rm -f ixed.tgz

Linux
chattr -i /usr/local/cpanel/3rdparty/etc/php.ini

FreeBSD
chflags noschg /usr/local/cpanel/3rdparty/etc/php/ini

Last Step
/usr/local/cpanel/bin/checkphpini

Retry to load Fantastico. If you still get the errors, do this:

Code:
/scripts/upcp –force

If you still get errors:

Linux Code:
chattr -i /usr/local/cpanel/3rdparty/etc/php.ini
pico -w /usr/local/cpanel/3rdparty/etc/php.in
i

FreeBSD Code:
chflags noschg /usr/local/cpanel/3rdparty/etc/php.ini
pico -w /usr/local/cpanel/3rdparty/etc/php.ini

and edit the following line:
extension_dir = ./ ; directory in which …

and remove the ./ if it appears (just those two characters, so it is set like this:
extension_dir = ; directory in which …

instead.

Note: Some users find that changing the extension_dir to “/” (no period) works better for them.

Scroll down to the Dynamic Extentions area of the file and add the following line at the end of this section (before Module Settings):
extension=”/usr/local/cpanel/3rdparty/etc/ixed/ixed.lin.4.3.8.pxp”

Change the number in ixed.lin.4.X.X.pxp to match whatever version of PHP you have installed.

If you get no more errors enter this:

Linux Code:
chattr +i /usr/local/cpanel/3rdparty/etc/php.ini

FreeBSD Code:
chflags schg /usr/local/cpanel/3rdparty/etc/php.ini

Last of all if you are still having problems, make sure you ixed directories are all chmoded to 0755:

Code:
chmod -Rf 0755 ixed

This may need to be done in either the /tmp dir or the /usr/local/cpanel/3rdparty/etc/ dir.

 

Credits: parts of this tutorial from the http://www.netenberg.com website.

No comments

How to Copy Files Across a Network/Internet in UNIX/LINUX

How to Copy Files Across a Network/Internet in UNIX/LINUX (Redhat, Debian, FreeBSD, etc) - scp tar rsync

One of the many advantages of Linux/UNIX is how many ways you can do one thing. This tuturial is going to show you some of the many ways you can ttransfer files over a network connection.

In this article/tutorial we will cover rsync, scp, and tar. Please note that there are many other ways these are just some of the more common ones. The methods covered assume that SSH is used in all sessions. These methods are all much more secure and reliable than using rcp or ftp. This tutorial is a great alternative for those looking for an FTP alterative to transfering files over a network.

 

scp

scp or secure copy is probably the easiest of all the methods, its is designed as a replacement for rcp, which was a quick copy of cp with network funcationability.

scp syntax

scp [-Cr] /some/file [ more … ] host.name:/destination/file

-or-

scp [-Cr] [[user@]host1:]file1 [ more … ] [[user@]host2:]file2

Before scp does any copying it first connects via ssh. Unless proper keys are in place, then you will be asked for usernames. You can test if this is working by using ssh -v hostname

The -r switch is used when you want to recursively go through directories. Please note you must specify the source file as a directory for this to work.

scp encrypts data over your network connection, but by using the -C switch you can compress the data before it goes over the network. This can significantly decrease the time it takes to copy large files.

Tip: By default scp uses 3DES encryption algorithm, all encryption algorithms are slow, but some are faster than others. Using -c blowfish can speed things up.

What scp shouldn’t be used for:
1. When you are copying more than a few files, as scp spawns a new process for each file and can be quite slow and resource intensive when copying a large number of files.
2. When using the -r switch, scp does not know about symbolic links and will blindly follow them, even if it has already made a copy of the file. The can lead to scp copying an infinite amount of data and can easily fill up your hard disk, so be careful.

 

rsync

rsync has very similar syntax to scp:

rsync -e ssh [-avz] /some/file [ more … ] host.name:/destination/file

-or-

rsync -ave ssh source.server:/path/to/source /destination/dir

rsync’s speciality lies in its ability to analyse files and only copy the changes made to files rather than all files. This can lead to enormous improvements when copying a directory tree a second time.

Switches:

-a Archive mode, most likely you should always keep this on. Preserves file permissions and does not follow symlinks.

-v Verbose, lists files being copied

-z Enable compression, this will compress each file as it gets sent over the pipe. This can greatly decrease time depending on what sort files you are copying.

-e ssh Uses ssh as the transport, this should always be specified.

Disadvantages of using rsync:
1. Picky syntax, use of trailing slashes can be confusing.
2. Have to remember that you are using ssh.
3. rsync is not installed on all computers.

 

tar

tar is usually used for achiving applications, but what we are going to do in this case is tar it then pipe it over an ssh connection. tar handles large file trees quite well and preserves all file permissions, etc, including those UNIX systems which use ACLs, and works quite well with symlinks.

the syntax is slightly different as we are piping it to ssh:

tar -cf - /some/file | ssh host.name tar -xf - -C /destination

-or with compression-

tar -czf - /some/file | ssh host.name tar -xzf - -C /destination

Switch -c for tar creates an archive and -f which tells tar to send the new archive to stdout.

The second tar command uses the -C switch which changes directory on the target host. It takes the input from stdin. The -x switch extracts the archive.

The second way of doing the transfer over a network is with the -z option, which compresses the stream, decreasing time it will take to transfer over the network.

Some people may ask why tar is used, this is great for large file trees, as it is just streaming the data from one host to another and not having to do intense operations with file trees.

If using the -v (verbose) switch, be sure only to include it on the second tar command, otherwise you will see double output.

Using tar and piping can also be a great way to transfer files locally to be sure that file permissions are kept correctly:

tar cf - /some/file | (cd /some/file; tar xf -)

This may seem like a long command, but it is great for making sure all file permissions are kept in tact. What it is doing is streaming the files in a sub-shell and then untarring them in the target directory. Please note that the -z command should not be used for local files and no perfomance increase will be visible as overhead processing (CPU) will be evident, and will slow down the copy.

Why tar shouldn’t be used:
1. The syntax can be hard to remember
2. It’s not as quick as to type scp for a small number of files
3. rsync will beat it hands down for a tree of files that already exist in the destination.

There are several other ways of copying over a network, such as FTP, NAS, and NFS but these all requre specialised software installed on either the receiving or sending end, and hence are not as useful as the above commands.

No comments

wget tutorial

wget tutorial

Ever logged into your server via ssh and needed to download a file, then
wget is what you are looking for. wget is used for retrieving files via
FTP or HTTP. Most Linux/UNIX servers come by default with wget, although
on FreeBSD you may need to install using the following set of commands

cd /usr/ports/ftp/wget
make
make install

Here is an example of how to use it:

wget http://kernel.org/pub/linux/kernel/v2.6/patch-2.6.9.bz2

No comments

Upgrading CentOS 3.3 to 3.4 using yum

Upgrading CentOS 3.3 to 3.4 using yum

CentOS is a great alternative to the expensive Red Hat Enterprise Linux 3. CentOS is RHEL 3 built from source, and on all servers we are using it on at Crucial Paradigm we have found it very stable and a great OS to work with. The CentOS 3.4 release is the same as Red Hat Enterprise Linux 3 Release 4 update.

First step, download

rpm -ivh http://mirror.centos.org/centos/3.4/os/i386/RedHat/RPMS/centos-yumcache-3.1-0.20050105.3.noarch.rpm
rpm -Fvh http://mirror.centos.org/centos/3.4/os/i386/RedHat/RPMS/centos-release-3-4.2.i386.rpm
yum update

Your yum config should look something like the following:

[main]
exclude=mod_ssl* httpd* perl mysql* php* #this is mainly for cpanel servers
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
name=CentOS-$releasever - Base
baseurl=http://beta.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1

#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://beta.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://beta.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://beta.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1

#centosplus repo - updated packages that extend beyond rhel release versions
#run auto update with this repo enabled only if you know you want extended functonality
#[centosplus]
#name=CentOS-$releasever - CentOSplus
#baseurl=http://beta.centos.org/centos/$releasever/centosplus/$basearch/
#gpgcheck=1

#packages in testing
#[testing]
#name=CentOS-$releasever - Testing
#baseurl=http://beta.centos.org/centos/$releasever/testing/$basearch/
#gpgcheck=1

Some users have reported having problems when updating the caching-nameserver package on CentOS 3.3 with cPanel. Please ensure you backup of your /etc/named.conf file before upgrading.

No comments

Redhat 7.3, 8.0, and 9.0 upgrade to CentOS 3 using yum

Redhat 7.3, 8.0, and 9.0 upgrade to CentOS 3 using yum

Why CentOS?
CentOS (CentOS.org) is a rebuild/recompile of the Red Hat Enterprise Linux 3 code and is free to use. It is a great performer with cPanel, and as it is free, usually a much better alternative to RHEL.

The following tutorial is intructions on upgrading from just about any Red Hat release (below Fedora) to CentOS. This tutorial is specifically dealing with Red Hat 9 and CentOS 3.4.

As with any upgrade on a production server is is highly recommended to backup your data.

You will need to download and install Yum for this. You can download yum from: http://linux.duke.edu/projects/yum/download.ptml

You may also want to rebuild your RPM database:

rpm -vv –rebuilddb

You should update your /etc/yum.conf to look something like the following:

[main]
exclude=mod_ssl* httpd* perl mysql* php* #add this line for cpanel servers
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1

[base]
name=CentOS-$releasever - Base
baseurl=http://beta.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1

#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://beta.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://beta.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://beta.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1

#centosplus repo - updated packages that extend beyond rhel release versions
#run auto update with this repo enabled only if you know you want extended functonality
#[centosplus]
#name=CentOS-$releasever - CentOSplus
#baseurl=http://beta.centos.org/centos/$releasever/centosplus/$basearch/
#gpgcheck=1

#packages in testing
#[testing]
#name=CentOS-$releasever - Testing
#baseurl=http://beta.centos.org/centos/$releasever/testing/$basearch/
#gpgcheck=1

 

You may want to adjust the URLs to pickup from a mirror closest to you, mirrors are available at centos.org.

Import the GPG key for CentOS 3.4 rpms:

rpm –import http://mirror.centos.org/centos/3.4/os/i386/RPM-GPG-KEY-CentOS-3

Start the upgrade via yum:

yum upgrade

This will take a while, and time varies depending on your connection speed. Be sure to check on progress as you will be prompted several times if you wish to continue.

You will want to check if your kernel has been properly installed and added to your bootloader.

If all looks ok you can go ahead and restart your computer:

reboot

No comments

« Previous PageNext Page »