Ubuntu: PHP libphp5.so missing: cannot open shared object file

February 27, 2012    |   Posted by admin   |    Category: Linux Administration

If Apache2 service fails to start with a “libphp5.so: cannot open shared object file” message, it indicates that libphp5.so is missing on your Ubuntu server.

Apache2 has detected a syntax error in your configuration files:
Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load:
Cannot load /usr/lib/apache2/modules/libphp5.so into server:
/usr/lib/apache2/modules/libphp5.so: cannot open shared object file:
No such file or directory

Apache configuration calls the php5.load file which includes the path to the libphp5.so module. The php5.load cannot load libphp5.so file if it is missing from the /usr/lib/apache2/modules/ directory. See if it exists:

# ls -la /usr/lib/apache2/modules/libphp5.so
 ls: cannot access /usr/lib/apache2/modules/libphp5.so:
 No such file or directory

See if the libphp5.so module is installed elsewhere on the server using the find and locate command

# find / -name libphp5.so
# locate libphp5.so

if it is, copy it to /usr/lib/apache2/modules/ directory and restart Apache.

If the file is not present, install the ‘libapache2-mod-php5’ package, the PHP5 module for Apache2. It adds the required FilesMatch directives to the Apache configuration.

# apt-get install libapache2-mod-php5

The ‘libapache2-mod-php5’ package will create the libphp5.so file under the modules directory and apache2 will restart successfully

# /etc/init.d/apache2 restart
Comments Off on Ubuntu: PHP libphp5.so missing: cannot open shared object file

Unzip: skipping filename.zip need PK compat. v4.5

February 20, 2012    |   Posted by admin   |    Category: Linux Administration

Sometimes extracting a zip file using the unzip command may result in the “skipping: filename.zip  need PK compat. v4.5” error message.

# unzip filename.zip
Archive:  filename.zip
   skipping: filename.zip  need PK compat. v4.5 (can do v2.1)

This is due to the file been compressed with the latest version of PKZIP which the unzip command cannot handle. The solution is to install p7zip package which can handle the files compressed using PKZIP.

Download the latest version of p7zip:

# wget http://sourceforge.net/projects/p7zip/files/p7zip/\
9.20.1/p7zip_9.20.1_x86_linux_bin.tar.bz2

Extract the file

# tar -jxf p7zip_9.20.1_x86_linux_bin.tar.bz2

goto the extracted directory and run the installer

# ./install.sh

This will install the ‘7za’ command on your server using which the zip file can be extracted

# 7za x filename.zip
 Processing archive: filename.zip
 Extracting  filename
 Everything is Ok
Comments Off on Unzip: skipping filename.zip need PK compat. v4.5

Howto Install and Configure VNCserver in Linux?

January 5, 2012    |   Posted by admin   |    Category: Linux Administration

The common method to manage a Linux server remotely is through CLI interface via SSH, which many people often find it difficult as they are not familar with the Linux commands.

The solution is to install a KDE Or GNOME Desktop on the Linux server and access it through VNC. VNC (Virtual Network Computing) is a graphical desktop sharing system which allows you to share a desktop of a remote server as if you are sitting in front of it.

Following are the steps to install and configure VNC on a Linux server:

1. Install the vnc-server packages.

# yum install vnc*

2. Now, edit the file /etc/sysconfig/vncservers and add the following lines at the end:

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 800x600"

This will enable VNC on terminal 1 with 800×600 resolution.

3. Next step is to create a startup file in .vnc directory under the user’s home directory, in this case it is /root

# nano /root/.vnc/xstartup

4. Now, add the following in the file

###########################
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startkde &

#############################

The last line in the above file indicates that it will start the KDE desktop by default. To start the GNOME desktop, replace the last line with “exec gnome-session &”

5. Set execute permissions on the file:

# chmod 755 /root/.vnc/xstartup

6. Now set a vnc password for user ‘root’

# vncpasswd

7. Once done, start the vncserver and it should show something like below:

# vncserver
New 'server.hostname:1 (root)' desktop is server.hostname:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/server.hostname:1.log

where, server.hostname above is your server’s hostname. The log file will be created under the .vnc directory of the users home directory. The Linux server side part is done.

8. Now, download and install VNC-Viewer on your computer (client-side). Open vnc-viewer and enter “server.hostname:1” (use your server IP instead of server.hostname) and the vnc password you have set above. You will now be connected to the graphical interface of your Linux server.

Comments Off on Howto Install and Configure VNCserver in Linux?

error event.h: No such file or directory

December 19, 2011    |   Posted by admin   |    Category: Linux Administration

While compiling a package say, Greensql you may end up with the “event.h: No such file or directory”  error message as follows:

# make
g++ -g -Wno-deprecated -Wall -I/usr/local/include/ 
-c -o main.o main.cpp
main.cpp:23:19: error: event.h: No such file or directory

It indicates that the required ‘libevent’ package is missing from the server. You have to install the libevent and libevent-devel package either using YUM or from a RPM.

# yum install libevent libevent-devel

OR install the RPMs:

# rpm -ivh ftp://ftp.muug.mb.ca/mirror/centos/5.7/os/x86_64/\
CentOS/libevent-1.4.13-1.x86_64.rpm
# rpm -ivh ftp://ftp.muug.mb.ca/mirror/centos/5.7/os/x86_64/\
CentOS/libevent-devel-1.4.13-1.x86_64.rpm

(download the i386 version if you have a 32bit machine)

Comments Off on error event.h: No such file or directory

How to Install and Enable cPanel Proxy?

December 5, 2011    |   Posted by admin   |    Category: cPanel Management

cPanel, WHM and even Webmail uses non-common ports which some Internet Server Providers (ISP) do not allow and makes it impossible for people to access any of these. cPanel works on 2082/2083, WHM 2086/2087 and Webmail 2095/2096.

The workaround is to install cPanel Proxy which works as a proxy gateway for Apache and the requests to cPanel/WHM/Webmail are then served through port 80 instead of their respective ports which are blocked by the ISP.

Here’s how to Install cPanel Proxy:
——————————————————————————–
1. You have to recompile Apache with the cPanel proxy module.
a) You can either execute ‘/scripts/easyapache‘ script via SSH
OR
use WHM -> Software -> ‘EasyApache (Apache Update)‘ option.

b) On the next step, leave the current profile as it is and click ‘Start Customizing Based on Profile’

c) Click ‘Next Step’ in the Apache/PHP selection pages and goto the 5th step

d) On the Short Options List, click ‘Exhaustive Options List’ button to list all the Apache/PHP modules.

e) Scroll down a bit and select the “Proxy” module

f) Click ‘Save and Build‘ and proceed to build Apache with the Proxy module.

It may take around 30 minutes for the process to complete. Once the module is compiled, a VirtualHost entry for the cPanel/WHM/Webmail sub-domains is added in the Apache configuration file.

Here’s how to Enable cPanel Proxy for an Existing account:
——————————————————————————————————————————–

2)  The next step is to add ‘A’ records for cPanel/WHM/Webmail for the domain you need to enable proxy access on. To add the records,

a) Goto WHM ->  DNS Functions.

b) Click ‘Edit a DNS Zone’ option and select the domain to edit and click Edit.

c) Scroll down to the empty boxes and add the following records

cpanel 14400 IN A ServerIP
whm 14400 IN A ServerIP
webmail 14400 IN A ServerIP

where, ‘ServerIP’ is the actual IP of the server.

d) Click ‘Save’.

Once the records are added, allow sometime to propagate and then you should be able to access cPanel at, http://cpanel.yourdomain.tld. You will be able to access WHM/Webmail the same way.