Posts Tagged ‘centos’

PHP 5.2 in CentOS 5 and “Could not find update match for php” error

Tuesday, March 3rd, 2009 by The BCM Team

If you are here then you probably already know how to install PHP 5.2 on your CentOS 5.2. One of the ways would be to use a third-party repository like Remi. Here is a good article about how to use it.

If after trying to use a third-party repository to install PHP 5.2 you get a “Could not find update match for php” error then there is a big chance you have a priorities package installed in your CentOS distribution and some repos are not properly configured priorities wise: basically your third-party repo does not have a chance to look for PHP 5.2 binaries because other (default CentOS) repositories get priority.

The easiest way to fix the problem is to temporarily disable the priorities package.

Edit the priorities file:

sudo vi /etc/yum/pluginconf.d/priorities.conf

and set “enabled” equal to 0

To check if the priorities package is installed on your system run:

rpm -q yum-priorities

Install GeoIP on CentOS

Thursday, January 15th, 2009 by The BCM Team
  1. Install geoip via yum:
    
    yum install geoip geoip-devel
    
  2. You also might want to download database with ip addresses from Maxmind website and place it in /usr/share/GeoIP (which is a default location of geoip upon installation).
  3. Install PECL extension:
    
    pecl install geoip
    
  4. Add extension=geoip.so to your /etc/php.ini
  5. Restart apache:
    
    /etc/init.d/httpd restart
    

Hello VPS

Wednesday, December 24th, 2008 by The BCM Team

ServersI have decided to say goodbye to the shared hosting once and for all and finally moved all of my personal sites and blog to a virtual private server (VPS) running CentOS 5.2 and Plesk.

I didn’t do this because I was unhappy with my former shared hosting provider as they had good up-time and the support was fast and helpful. I did it because I needed greater access to my hosting then shared hosting can provide; e.g. tweaking the server, installing custom software and controlling the versions of software installed on the server (e.g. symfony and subversion).

The switching process took a little more than a week. A little slow I know, but it wasn’t a full time gig. But at last I can announce that my switchover to a VPS set-up is complete.

Now here’s hoping my new host does not upset me with frequent downtime :)

Just in case you were curious, my shared hosting was with A2hosting and I highly recommend them if you are after shared hosting. They also offer VPS hosting but I have not tried their offering yet.

Photo Credit: http://www.flickr.com/photos/philschatz/312633642

Configuring Exim under CentOS to send emails through an ISP’s SMTP server

Wednesday, October 1st, 2008 by The BCM Team

Edit your /etc/exim/exim.conf file

Add to Routers section


send_to_gateway:
driver = manualroute
transport = remote_smtp
route_list = * mail.optusnet.com.au

If your SMTP server requires authentication you also need to do this:

Add to Authentication section

  • Enable authentication for hosts host1.example.com, host2.example.net and host3.example.org (you have to list all smarthosts where Exim may authenticate users):
    
    remote_smtp:
      debug_print     = "T: remote_smtp for $local_part@$domain"
      driver = smtp
      hosts_try_auth  = host1.example.com:host2.example.net:host3.example.org
    
  • SMTP-Auth with the name “usera” and the password “secrect” (cram_md5 encrypted):
    
    cram_md5:
         driver = cram_md5
         public_name = CRAM-MD5
         client_name = usera
         client_secret = secrect
    
  • SMTP-Auth with the name “usera” and the password “secrect” (plaintext):
    
    plain:
         driver = plaintext
         public_name = PLAIN
         client_send = ^usera^secrect
    
  • Or get name, password and send method automatically from my config-file:
    
    cram_md5:
         driver = cram_md5
         public_name = CRAM-MD5
         client_name = "${extract{auth_name}{${lookup{$sender_address}lsearch{/etc/exim/smtp_users}{$value}fail}}}"
         client_secret = "${extract{auth_pass}{${lookup{$sender_address}lsearch{/etc/exim/smtp_users}{$value}fail}}}"
    plain:
         driver = plaintext
         public_name = PLAIN
         client_send = "${extract{auth_plain}{${lookup{$sender_address}lsearch{/etc/exim/smtp_users}{$value}fail}}}"
    

Add to Transports section


remote_smtp:
  debug_print     = "T: remote_smtp for $local_part@$domain"
  driver = smtp
  hosts_try_auth  = your.smtp.server.com

More information on this topic can be found at http://www.tgunkel.de/docs/exim_smarthosts.en

Exim on CentOs 4/5

Monday, September 29th, 2008 by The BCM Team

This is a quick guide (by jervis) on how to do an install and basic setup of exim on CentOS. This is not meant as a fully inclusive guide but it will get you on the way. Following this you should get a working exim install.

I will assume you have built a CentOS 4 / 5 Server, have yum working and have logged in as root.


yum update

Install exim and mail switching tools


yum install exim
yum install system-switch-mail

Switch your MTA & set exim to start on boot
system-switch-mail
service sendmail stop
service exim start
chkconfig exim on
chkconfig sendmail off

Add a root alias, eg:  “root: me@example.com”
vi /etc/aliases

You may also wish to add some config to your routers section like this, if you want to relay through a smart host.


vi /etc/exim/exim.conf

Then add this before the “dnslookup:” section.


to_smart_host:
driver = manualroute
domains = ! +local_domains
transport = remote_smtp
route_list = “* mail1.example.com:mail2.example.com;”


Restart exim
service exim restart

To test, send an email


echo “test” |mail -s “$HOSTNAME” me@example.com

Then you can flush the Exim Que and watch the log like this


exim -qff ; tail -f /var/log/exim/main.log

Good luck!

Installing FFmpeg on CentOS 5.x

Thursday, August 21st, 2008 by The BCM Team
  1. Configure RPMForge so the installation passes GPG key check. See RPMForge website for more details
  2. Create a new repo difinition with: nano -w /etc/yum.repos.d/dag.repo
  3. Insert the following into the newly created file:
    
    [dag]
    name=Dag RPM Repository for Red Hat Enterprise Linux
    baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
    gpgcheck=1
    enabled=1
    
    
  4. Install ffmpeg: yum install ffmpeg

List of useful CentOS commands

Sunday, May 25th, 2008 by The BCM Team

Below is a list of common commands in CentOS that I tend to forget:

Crontabs

  • "crontab -l" – list all crontabs
  • "crontab -e" – edit crontabs

Mindquarry under CentOS: mod_perl2 and LWP::Agent dependancies

Saturday, May 24th, 2008 by The BCM Team

If you, like me, got to the point where you have Mindquarry installed on your linux distribution together with Java Runtime but still can not run Mindquarry successfully and the error says something like:
“you need to install mod_perl2 and LWP::Agent” then this post is for you.

To install LWP::Agent: Download it and install by placing into the directory accessible via global PATH variable.

To install mod_perl2: execute in your terminal yum install mod_perl and make sure that the version you are installing is >2.x

Setting environment variables in CentOS

Friday, May 23rd, 2008 by The BCM Team

If you are using Bash as your terminal, here’s what you need to do:

Edit ~/.bash_profile by adding the following (if you want to set TESTVAR variable to “This_is_a_value” value)


export TESTVAR=This_is_a_value

Install VMWare Tools (Host – Windows, Guest – Linux)

Thursday, May 22nd, 2008 by The BCM Team

Install software needed by VMware Tools

Note: you need to boot the 1-1 kernel from grub for this to work.

  1. Install packages to build the kernel modules: yum install gcc kernel-devel
  2. Check the running kernel matches the kernel headers:
    
    uname -r             # running kernel
    rpm -q kernel-devel  # installed kernel headers
    
    
  3. If the two versions do not match, run:
    
    yum -y upgrade kernel kernel-devel
    reboot
    
    
  4. Find out where the kernel headers are (you may need this later): ls -d /usr/src/kernels/$(uname -r)*/include

Prepare and install VMware Tools

Note: this guide is for you If you are running the VM inside VMware Workstation 5.5+

  1. From VMware Workstation: go to VM> Install VMware Tools
  2. From the VM: mount the virtual cd drive: mount /dev/cdrom /mnt/
  3. Extract VMware Tools to: /tmp/tar -C /tmp -zxvf /mnt/VMwareTools-5.5.3-34685.tar.gz
  4. Unmount the virtual cd drive: umount /mnt
  5. Now run the installer:
    
    cd /tmp/vmware-tools-distrib
    ./vmware-install.pl
    
    
  6. When asked “Do you want to run vmware-config-tools.pl?”, answer “Yes”.