CentOS

User login

Configuring drupal cron jobs in crontab.

Drupal 7 has the ability to run cron automatically, but if there are tasks that really depend on cron, it only makes sense to ensure that cron is running in pre-defined time spans.

To make sure of that, we can configure the drupal cron to run from a server side command. So from the console, In crontab, the following line will trigger Drupal's cron

How to test cron in Centos

Here you can find some simple tests that would confirm the smooth functionality of your crontab.

Test if cron is running

Type the following command:

ps ax | grep cron 

Make sure that cron shows up. Expected output should be something like

[konordo@konordoserv]# ps ax | grep cron
1185 pts/1    S+     0:00 grep cron
1771 ?        Ss     0:00 crond

Test if cron is working

Add the following entry to your crontab. To do so, enter the command

crontab -e

PHP Fatal error: Class 'Console_Table' not found in... drush error

After a fresh drush installation, drush status returned this error message:

[konordo@konordo ~]# drush status
<strong>PHP Fatal error:  Class 'Console_Table' not found in drush/path/drush.inc on line 955 </strong>

The solution was to install the php pear extension

How to install drush

In this example, we will install drush under the directory /usr/local/share/. The path is not really important as long as you adjust the following commands accordingly.

If the directories do not exists, we create them:

sudo mkdir /usr/local/share/
sudo mkdir /usr/local/bin/

And now it time to download and extract drush. Make sure that you have the latest version available and replace the url in the command accordingly.

We also create a symlink so that we can use it everywhere without typing the parent path all the time...



How to install APC & Uploadprogress on Centos 5

First things first, we need the pecl command in order to download and install APC from the repositories.

Let's run the following command in our terminal:

yum install php-pear

Then, we are making availlable a required package for the phpize command:

yum install php-devel

The followng package will allow apxs command:

yum install httpd-devel

Once we have all the above pakages installed, we are ready to install apc by running the pecl command:

pecl install apc

Configure: error: Please reinstall the libcurl distribution

While trying to setup nginx web server, I received the following error on compilation of php from source: Configure: error: Please reinstall the libcurl distribution

As it turns out, curl-devel was not installed.

So after installing that, the problem was fixed.

For CentOS:

yum -y install curl-devel

Note:
More might be missing - if so try installing:

yum install freetype-devel libpng-devel libjpeg-devel libpng libjpeg t1lib  libc-client-devel  libmcrypt-devel gmp-devel mysql-devel 

Also check:

Installing Git in Centos 5.5 with yum

Installing Git in Centos 5.5 with yum is just a matter of seconds.

First we need to set up the Webtatic repository (http://www.webtatic.com/projects/yum-repository/) in yum.
We can do this with the following command in our terminal:

rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-1.noarch.rpm

Once the repository is available, we can install Git with the following:

Upgrade Java 1.4 to 1.5 on Centos 5.5

While trying to install Solr in Centos, I noticed that Java 1.5 is required, however Java 1.4 is installed by default.
Now, in order not to have Tomcat start the old Java version, we need to uninstall it using a simple yum line:

sudo yum remove java

Next on the list is to install the new Java versions. Good thing it is included :)

sudo yum install java-1.6.0-openjdk

and

yum install java-1.6.0-openjdk-devel

Finally, we are ready to install Tomcat:

sudo yum install -y tomcat5

Start tomcat with:

service tomcat5 start

How to install APC PHP accelerator

Here is a list of commands to install APC php accelerator on CentOS:

yum install php-pear
yum install pcre-devel
yum install php-devel
yum install httpd-devel
pecl install apc-beta
echo "extension=apc.so" > /etc/php.d/apc.ini
service httpd restart

To see if APC is loading, create a php file e.g. info.php with the code phpinfo();.
Search for the APC section in the output of this file.

Subscribe to CentOS