Archive for the ‘Redhat / CentOS’ Category

how to install flash in Firefox for CentOS

Saturday, December 19th, 2009

* Go to youtube.com and try to play a video. You should not be able to play it
* Instead of the video, there should be a link like ‘Install Flash’
* You should be redirected to the Adobe website where you can download an RPM package
* After downloading it, install it with the rpm -i command (as root)
* Then, launch:
sudo yum install flash-plugin

Rolling Back yum Packages - CentOS Roll Back After Installation

Sunday, August 16th, 2009

Rolling back yum packages:
http://dailypackage.fedorabook.com/index.php?/archives/17-Wednesday-Why-Repackaging-and-Rollbacks.html
http://www.vincentverhagen.nl/2007/12/10/how-to-roll-back-packages-on-centos-5-rhel-5/

When you’ve installed/updates packages with yum or rpm, you can quite easily roll back the updates/installations using rpm.
For this, yum and rpm need to save roll back information, which they do not do by default.
To enable the roll back feature, do the following:

Add tsflags=repackage to /etc/yum.conf.
Add %_repackage_all_erasures 1 to /etc/rpm/macros. If /etc/rpm/macros does not exist, just create it.

You can now install, erase and update packages with yum and/or rpm, and they will save roll back information.

When you want to roll back, use rpm to do so.
You do this by specifying the –rollback switch and a date/time, like the examples below:

rpm -Uhv –rollback ‘19:00′
rpm -Uhv –rollback ‘8 hours ago’
rpm -Uhv –rollback ‘december 31′
rpm -Uhv –rollback ‘yesterday’

CentOS - Setting the Network / Internet Interface

Tuesday, December 16th, 2008

http://www.cyberciti.biz/faq/rhel-centos-fedoracore-linux-network-card-configuration/

Installing an SVN System On CentOS

Monday, December 8th, 2008
  • yum install httpd subversion mod_dav_svn
  • You need also SSH
  • To run the server:

    svn serve --daemon --root /home/mike/svn-repos

    It will be bound to the port 3690

Networking with svn+ssh
If you specify a svn+ssh schema to access the repo, every user must have an account on the server. Every user of the repository must have read and write access to the files in the repo. Moreover, every file they create must be both writable and readable by the other users of the repo.
In order for multiple Unix users to access the repository, they should all be in a single Unix group and have a umask 002 when running svnserve via SSH. You also need to set the group ’sticky bit’ on the repository directories. Here’s a step-by-step guide to set this up.

/usr/sbin/groupadd subversion
/usr/sbin/usernmod -G subversion -a svn_user1
/usr/sbin/usernmod -G subversion -a svn_user2
chgrp -R subversion /home/svn-repos
chown -R 770 subversion /home/svn-repos
chmod g+s /home/svn-repos/db

Now we can try to checkout:

svn checkout svn+ssh://mike@oilo/home/svn-repos/sesame/trunk sesame

Networking with Apache
We will see how to set up Apache to host a Subversion repository.
Install mod_dav_svn. Installing it, we wiil add a new subversion.conf file, where you need to write:

<Location /svn-repos>
    DAV svn
    SVNPath /home/svn-repos
</Location>

Make sure the svn-repos directory is owned by the Apache user, and restart the Apache server.
Ah this point the repository is unsecured, allowing read and write access to anonymous users.

CentOS - Useful Programs (also for SVN)

Sunday, October 26th, 2008

Admin

List of installed packages and available packages (to check whether an update is available):
php list ‘php*’

Upgrade a package
yum upgrade php

Install a package
yum install php

RapidSVN

  • Install RapidSVN (find an rpm)
  • yum install meld [this is a graphic diff tool]
  • In RapidSVN go in View > Preferences > ‘Programs’ Tab > ‘Diff tool’ Tab > Insert ‘meld’
  • You can start importing an existing working copy: Bookmarks > Add existing working copy

Java

  • You need JRE: http://java.sun.com/javase/downloads/
  • find / -name “java” (to find out where Java has been installed)
  • you need to edit some symbolic link like (or something similar): /etc/alternatives/java

SmartSVN

  • You need JRE: http://java.sun.com/javase/downloads/
  • find / -name “java” (to find out where Java has been installed)
  • Download the free version of SmartSVN
  • Edit the file bin/smartsvn.sh setting the correct JAVA_HOME (read the README for more info)
  • Run SmartSVN

Yakuake
Fedora package
32 bit
rpm package
(CentOS 5.2, KDE 3.5.4-16)
yakuake-275-4fc6i3861

OpenOffice
Just download the rpm from the website and launch setup

Flash

 Download the YUM package
yum install package_filename

Filezilla

Download from the site (you don't need installation)

Redhat - Change Your Hostname Without Rebooting

Tuesday, April 29th, 2008

The first two steps to make the change permanent

vim /etc/sysconfig/network

Change to:

HOSTNAME=pippo

Second step:

vi /etc/hosts

Replace your old hostname with the new one.

This step to change the hostname immediately:

hostname pippo

SELinux

Wednesday, January 9th, 2008

A good resource is:

http://www.crypt.gen.nz/selinux/faq.html

There, the most important thing is this.

It is important that server daemons are started within the correct context, if they are not then they will probably not run properly.

For Fedora and RedHat Enterprise Linux, use the normal command,

service (name) start/stop

For Debian and Gentoo, use the run_init command to run scripts in /etc/init.d within the correct context, for example sshd:

run_init /etc/init.d/sshd start

which starts up the sshd daemon. Note that run_init will prompt the user for their password before performing the function: this is to prevent unauthorised acces to the functionality such as being executed by a trojan program.

To know if selinux is installed

rpm -qa | grep selinux

To know if it is enabled

/usr/sbin/getenforce

CentOS: Problems & Solutions

Sunday, December 16th, 2007

Trying to connect to Apache but ‘Connection Refused’.
Either iptables is blocking the connection or the Apache server is not running

/////////////////////////////////////////////////////////////////////
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
The MySQL server is not running

CentOS: Knowledge Base

Thursday, December 13th, 2007

Finding out which version you installed:
cat /etc/redhat-release

Installing a package:
yum install packet_name

Updating all the packages:
yum check-update [just for checking]
yum update

Check whether the package pp is installed:
rpm -qa | grep pp

CentOS: Firewall & LAMP Installation

Monday, December 10th, 2007

There’s an iptables entry that doesn’t allow connection to the web server from an external PC.
To remove it, you need to launch iptables with flags similar to these ones:
iptables -D RH-Firewall-1-INPUT 10
Basically you need to remove the REJECT rule
Better, you can act directly on the configuration of iptables:
system-config-securitylevel
and customize the filtering rules
The configuration file is /etc/sysconfig/iptables

Alternatively (you don’t need system-config-securitylevel), you can insert in the command line manually all the rules you’d like and then save them permanently through this command:

/sbin/service iptables save

Installing PHP5
yum install php
yum install php-gd

The Mysql client is already installed, whilst the server isn’t.
yum install mysql-server
yum install php-mysql

/etc/init.d/mysqld start

Setting up MySQL root password:
mysqladmin -u root password NEWPASSWORD

Now we want the Apache Webserver and the MySQL Server to start at the boot of the machine.

Let’s find out which runlevel we are running:

runlevel

To set the services to start at the boot:

/usr/sbin/ntsysv