Monday, February 1, 2010

How to install wordpress!

WordPress is an open source blog publishing application. WordPress is the official successor of b2\cafelog which was developed by Michel Valdrighi. The latest release of WordPress is version 2.7.1, released on 10 February 2009.WordPress has a templating system, which includes widgets that can be rearranged without editing PHP or HTML code, as well as themes that can be installed and switched between. The PHP and HTML code in themes can also be edited for more advanced customizations. WordPress also features integrated link management; a search engine-friendly, clean permalink structure; the ability to assign nested, multiple categories to articles; multiple author capability; and support for tagging of posts and articles. Automatic filters that provide for proper formatting and styling of text in articles (for example, converting regular quotes to smart quotes) are also included. WordPress also supports the Trackback and Pingback standards for displaying links to other sites that have themselves linked to a post or article. Finally, WordPress has a rich plugin architecture which allows users and developers to extend its functionality beyond the features that come as part of the base install.

The instllation of wordpress is quite simple.

1)Download the latest version of wordpress and extract it.

2)Place the WordPress files in the desired location on your web server,using FTP

* If you want to integrate WordPress into the root of your domain (e.g. http://example.com/), move or upload all contents of the unzipped WordPress directory (but excluding the directory itself) into the root directory of your web server.
* If you want to have your WordPress installation in its own subdirectory on your web site (e.g. http://example.com/blog/), rename the directory wordpress to the name you'd like the subdirectory to have and move or upload it to your web server. For example if you want the WordPress installation in a subdirectory called "blog", you should rename the directory called "wordpress" to "blog" and upload it to the root directory of your web server.


3)Here i am uploading the folder(blog) to public_html, using ftp. Make sure that you upload the folder as a user, not the root.

4)now goto the cpanel,and create a mysql user and a database.please remember the dbname, user and password.

5)then goto filemanager, inside the uploaded folder (blog), edit the file wp-config-sample.php

6)rename the wp-config-sample.php to wp-config.php.

7)edit the wp-config.php and insert the db details of the one which we have created.


Here is the default wp-config-sample.php, you will need to replace the default values in this file with your own specific database settings.

define('DB_NAME', 'putyourdbnamehere'); // The name of the database
define('DB_USER', 'usernamehere'); // Your MySQL username
define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

usually the DB_HOST must be 'localhost'.if it is not working contact your web hosting provider.

8)Run the WordPress installation script by accessing wp-admin/install.php in your favorite web browser.

* If you installed WordPress in the rootl directory, you should visit: http://example.com/wp-admin/install.php
* If you installed WordPress in its own subdirectory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php

9)The instllation process will now beging. The screen shots fir the instllation is given below.
10)goto www.yourdomain.com/blog/wp-login.php to login for the next time.



Thursday, January 14, 2010

Howto: enable TUN module on a VPS

TUN module is required to configure VPN tunneling and to configure VPN on a VPS, you need to enable the module from the Hardware node. Login to your Host server and execute the following command:

First check if the TUN module is enabled on the hardware node:

lsmod | grep tun

If not, load the module using modprobe:

modprobe tun

Now, enable the TUN module on a VPS:

vzctl set VEID  devices c:10:200:rw  save
vzctl exec VEID mkdir -p /dev/net
vzctl exec VEID mknod /dev/net/tun c 10 200
vzctl exec VEID chmod 600 /dev/net/tun

where, VEID is the VPS ID you want to enable the TUN module on.

Wednesday, January 13, 2010

Fantastico shows error 'You cannot install more than one script in the root directory of a domain'

1. Login to your  cpanel
2. Go to "file manager"
3. click on the ".fantasticodata" folder
4. open up "installed_in_root.php" and edit it.

This is an example of what I mean:

If you open up "installed_in_root.php" you will see something like this:

$installed_in_root["domain.com"] = 1;

This is what you need to delete.

(this is just an example from my "installed_in_root,php" file).

Keep in mind that every install of wordpress you have made will be stored in this file, be very carefull not to delete any of your other wordpress sites out of it.

I hope this makes sense lol, I'm not very good at explaining things.

Change Time Zone for a particular account on cpanel server

To change the timezone for only a particular account using .htaccess:

SetEnv TZ  

Monday, December 21, 2009

How To Add DomainKeys and SPF Records on CPanel Servers

This how to describe how to add domainkeys and SPF (Sender Policy Framework) records on CPanel Servers. Whenever you create a domain on CPanel server using WHM, it wont add domainkeys and SPF records for particular domains. To add domainkeys and SPF records please use following steps.

We consider here we have a domain howtodolinux.com with cpanel username dothelinux

Please note on CPanel servers most of the work is done using cpanel username which then reflect setting on particular domains. If you have several domains / sub domains under one username, it will add domainkeys and SPF records for all domains / subdomains.

Execute the following command on your CPanel server using root.

1 DomainKeys

1.1 Add DomainKeys for single user

/usr/local/cpanel/bin/domain_keys_installer dothelinux

1.2 Add DomainKeys for all CPanel users.

If you wish to add DomainKeys for all Cpanel users on your server, execute following command.

cat /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/domain_keys_installer $a
done


2 SPF (Sender Policy Framework)

2.1 Add SPF for single account.


/usr/local/cpanel/bin/spf_installer dothelinux



2.2 Add SPF for all Cpanel accounts.

If you want to add SPF records for all cpanel accounts exist on your server then use the following command.


cat /var/cpanel/users | while read a; do
/usr/local/cpanel/bin/spf_installer $a
done


3 Enable DomainKeys and SPF for every new CPanel account.

If you want to add DomainKeys and SPF for every new account created on Cpanel, then do the following.


vi /scripts/postwwwacct


postwwwacct is a file which execute after wwwacct (used to create account), paste following lines in the file


#!/usr/bin/perl

my %OPTS = @ARGV;
$ENV{USER} = “$OPTS{’user’}”;
system q(/usr/local/cpanel/bin/domain_keys_installer $USER);
system q(/usr/local/cpanel/bin/spf_installer $USER);





Saturday, December 12, 2009

How to Install FFmpeg in Linux

FFmpeg is a very fast video and audio converter. It can also grab from a live audio/video source. FFmpeg is so important if you are planning to run a video website with streaming with conversion of video files to different video formats. This blog is intended for Centos/Redhat versions of Linux where any novice user can install ffmpeg without compiling the source which is a more traditional way of installing the FFmpeg software on linux servers. In this blog i will show you the easy way to install ffmpeg and ffmpeg-php (php extension) with just yum rather than compiling ffmpeg from source files.

Installation

First you need to add a file in yum repository directory for dag packages installation. For this edit the following file:


Vi /etc/yum.repos.d/dag.repo

add the following contents to the file,

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=0
enabled=1

Then enter the command,

yum install ffmpeg ffmpeg-devel

To check what audi/video formats are supported

ffmpeg -formats > ffmpeg-format.txt

Open the ffmpeg-formats.txt to see the ooutput

D means decode
E means encode
V means video
A means audio
T = Truncated

Installation of FFMPEG-PHP Extension

FFmpeg-php is a very good extension and wrapper for PHP which can pull useful information about video through API interface. Inorder to install it you will need to download the source file and then compile and install extension in your server.
For downloading the source tarball click here

or

wget http://biznetnetworks.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2

Extract the souce tarball.

tar -xjf ffmpeg-php-0.6.0.tbz2

cd ffmpeg-php-0.6.0/

phpize

Some time you will get an error like "Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script."

YOU CAN SEE THE FIX OF THIS ERROR UNDER COMMON ERRORS.

./configure

make

make install

Editing PHP.INI

Once you have done that without any problems then you will see the php extension file /usr/local/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so and you will need mention that extension in php.ini file

vi /usr/local/lib/php.ini

Put the below two lines at the end of the php.ini file

[ffmpeg]
extension=ffmpeg.so

Then restart the server

service httpd restart
To check whether ffmpeg enabled with php, point your browser to test.php file. It should show the confirmation of installed ffmpeg php extension

// # vi test.php


phpinfo();

?>

Picture.................................................paste here...

If any case the ffmpeg does not show in the phpinfo() test make sure that php.ini path to ffmpeg.so is correct. Still the problem occures, the reason could be you might be using older version of ffmpeg-php which is buggy. just download the latest version of ffmpeg-php sourse then complile it.

Common Errors

1. If you get command not found error for phpize, then you will need to do yum install php-devel

2.

2. If you get error like "ffmpeg headers not found" while configuring the source.

configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option

then it means you have not installed ffmpeg-devel packages.

To Fix: Just install ffmpeg-devel using

yum install ffmpeg-devel

3. If you get an error like shared libraries not found problem and the program halts in the middle, then you must specify the ffmpeg installed path explicitly to the ./configure.

A) configure: error: ffmpeg shared libraries not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option

To Fix:

1. First find out the ffmpeg path with ffmpeg --help command. The prefix default path should be like /usr/local/cpffmpeg
2. Conf./configure --with-ffmpeg=/usr/local/cpffmpeg

That should resolve the problem!


B)


Installing Mplayer + Mencoder

Just issue the following yum commands to install the rest of the packages.

yum install mplayer mencoder

Installing FlvTool2

Flvtool2 is a flash video file manipulation tool. It can calculate metadata and can cut and edit cue points for flv files.

yum install flvtool2

Installing LAME MP3 Encoder, Libogg, LIBVORBIS

LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL. Both quality and speed improvements are still happening, probably making LAME the only MP3 encoder still being actively developed.

yum install lame libogg libvorbis

Sunday, November 1, 2009

Unable to open pty: No such file or directory

While trying to SSH or enter into a VPS from the node, you may get the following error :

Unable to open pty: No such file or directory

or

root@tip~]# vzctl enter 900
enter into VE 900 failed
Unable to open pty: No such file or directory

There is a temporary and permenant fix for this issue.

Temporary Fix :-

Execute the following commands from the node

vzctl exec VEID /sbin/MAKEDEV pty

vzctl exec VEID /sbin/MAKEDEV tty

vzctl enter VEID

Where VEID is the VPS id.

Permanent Fix :-

First temporarly fix the issue and enter into the VPS.

1) vzctl enter VEID

2) Edit the file /etc/rc.sysinit of the VPS

vi /etc/rc.sysini

3) Search for the line /sbin/start_udev and comment it

#/sbin/start_udev

4) Add the following two lines under /sbin/start_udev

#/sbin/start_udev
/sbin/MAKEDEV tty
/sbin/MAKEDEV pty

Logout from your VPS (Ctrl d)

5) Reboot the VPS and you are done!

vzctl restart VEID