Categories
centos gdm gnome gui How To Linux remove Tutorial uninstall x window

How To Remove GUI (GDM, Gnome, X Window) from CentOS

If you planned to install a CentOS server, but mistakenly also installed Desktop Environment such as GNOME, you can easily remove the GUI packages and return back to Command Line (CLI).

There are two ways to do that. You can simply disable GUI or completely uninstall it. I will provide steps to do both.

Disable GUI (GDM)

nano /etc/inittab

change id:5:initdefault: to id:3:initdefault:

Remove GUI

If you want to remove all GUI packages completely, please still use the disable GUI steps first otherwise once Gnome, GDM, X Windows removed CentOS will still try to load X Window.

To remove GUI packages follow the steps:

yum groupremove "GNOME Desktop Environment" -y
yum groupremove "X Window System" -y

If you want to temporarily stop GDM (GUI), you can issue this command:

init 3

and then back to start GDM:

init 5

If you have any questions please post in comments.

Categories
centos cpanel error Linux missing dependency perl(URI) subversion svn Tutorial

How To Fix “Missing Dependency: perl(URI) >= 1.17 is needed by package subversion”

If you are a cPanel user on CentOS 5.6 64 bit and wanting to install Subversion, you might get this error after running ‘yum install subversion’

Missing Dependency: perl(URI) >= 1.17 is needed by package subversion-1.6.11-7.el5_6.4.x86_64

yum seems to unable to find needed dependency and just fails

To fix this issue there’s a workaround.


cd /tmp
wget http://sdkit.com/download/centos/5/rpms/perl-URI-1.35-3.noarch.rpm
rpm -i perl-URI-1.35-3.noarch.rpm

The dependency is now fixed. You can proceed to installing subversion by running:

yum install subversion
Categories
centos cpanel How To Linux mod_wsgi Programming python Tutorial

How To Install Python 2.7 with mod_wsgi on CentOS 5.6 with cPanel

This is a step by step tutorial which will help you install Python 2.7 with mod_wsgi onto CentOS 5.6 and cPanel.

Prerequisites:

  • CentOS 5.6 32 or 64 bit with root access
  • cPanel

Note: we are not using cPanel custom modules guide because it only works with built-in Python 2.4.

Creating Python folder

mkdir /usr/src/python2.7
cd /usr/src/python2.7

If required by your project, you can install SQLite

wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
tar zxvf sqlite-autoconf-3070701.tar.gz
cd sqlite-autoconf-3070701
./configure
make
make install

Installing Python 2.7 into alternate location since we don’t want to break Centos 5.6 (yum) that uses Python 2.4

cd /usr/src/python2.7/
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar zxvf Python-2.7.2.tgz
cd Python-2.7.2
./configure --prefix=/opt/python2.7 --with-threads --enable-shared
make
make install

Creating symbolic link to the alternate Python version

ln -s /opt/python2.7/bin/python /usr/bin/python2.7
echo '/opt/python2.7/lib'>> /etc/ld.so.conf.d/opt-python2.7.conf
ldconfig

Let’s test if new Python version works

/usr/bin/python2.7

If successful you will see something like this:

Python 2.7.2 (default, Sep  3 2011, 18:28:42)[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2

press control+D to exit

Now we need to install Python setup-tools

cd /usr/src/python2.7/
wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
sh setuptools-0.6c11-py2.7.egg --prefix=/opt/python2.7

Installing virtualenv to our Python 2.7

cd /opt/python2.7/bin/
./easy_install virtualenv

Installing mod_wsgi (this module will work only with python 2.7)

cd /opt/python2.7/lib/python2.7/config/
ln -s ../../libpython2.7.so
cd /usr/src/python2.7/
wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
tar zxvf mod_wsgi-3.3.tar.gz
cd mod_wsgi-3.3
./configure --with-python=/opt/python2.7/bin/python
make
make install

We need to avoid cPanel’s easy_apache clearing up /usr/local/apache/modules folder

mkdir /usr/local/apache/extramodules
mv /usr/local/apache/modules/mod_wsgi.so /usr/local/apache/extramodules/

Include mod_wsgi into Apache configuration

nano /usr/local/apache/conf/includes/pre_virtualhost_global.conf

paste:

LoadModule wsgi_module /usr/local/apache/extramodules/mod_wsgi.so
AddHandler wsgi-script .wsgi

Before we restart Apache, lets test if we have the correct configuration

service httpd configtest

You should get this answer:

Syntax OK

Now restart Apache

/scripts/restartsrv httpd

Python 2.7 with mod_wsgi is now installed on your cPanel server.

You can create a test.wsgi file to test Python scripts

def application(environ, start_response):
"""Simplest possible application object"""
output = "Hello World"
status = '200 OK'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]

Please post your questions and comments below.

Categories
Internet Linux mac traceroute tracert Tutorial

How to do tracert on a Mac and Linux

Most of us, IT geeks use tracert a lot on Windows systems, but when it comes to Linux or a Mac system Windows System admins get lost.

For Linux and Mac users, you need to use:


traceroute
Categories
dns dns cache domain name server flush dns flush dns cache Internet Linux linux flush dns linux flush dns cache mac mac flush dns mac flush dns cache Networking nscd daemon Tutorial window flush dns windows flush dns cache winxp

How to Flush DNS on Mac and Windows

To flush or reset DNS on a Mac OS X type the following into terminal and run:

dscacheutil -flushcache

If you have older Mac OS X, this might work for you:

lookupd -flushcache

To flush DNS on any Windows version, click start > Run and type in command:

ipconfig /flushdns

Hope this fixes your DNS issues.

If you have any questions, please ask in comments.