Archive

Archive for the ‘Cpanel Server’ Category

How to install subversion client on Linux server?

April 10th, 2009 1 comment

Svn(subversion) is used to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly-compatible successor to the widely used Concurrent Versions System (CVS).

It is very easy to install subversion client on linux OS using yum. You can us following command to install subversion client.

root@server [~]# yum install subversion

while installing subversion if you are getting following error  then it seem sot be perl-URI package is not installed on your server so you will have to install first before installing subversion client.

Please follow the following steps to install perl-URI package

You’ll login via SSH as root and run this command:

root@server [~]# yum install subversion

and then you may get this error:

Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

Here’s what you do next (copy/paste):

root@server [~]# wget  ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/
fedora/linux/releases/7/Everything/i386/os/Fedora/
perl-URI-1.35-3.noarch.rpm 

root@server [~]# rpm -i perl-URI-1.35-3.noarch.rpm

root@server [~]# yum install subversion

Installed: subversion.x86_64 0:1.4.2-4.el5 subversion.i386 0:1.4.2-4.el5

Dependency Installed: neon.x86_64 0:0.25.5-10.el5 neon.i386 0:0.25.5-10.el5

Complete!

That’s it subversion client is successfully installed on your server you can check it using following command.

root@server [~]#svn --version
svn, version 1.1.4 (r13838)
compiled Aug 21 2005, 20:56:55

Copyright (C) 2000-2004 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' schema
- handles 'https' schema
* ra_local : Module for accessing a repository on local disk.
- handles 'file' schema
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' schema

Regards

Alex P

How to Enable PHP function for a one account ?

April 9th, 2009 6 comments

IF you disable PHP function in php.ini file and if you want to enable any particular function only one account .Then You can however use suhosin to enable a function for one domain only.

How can you do that ?

After installing suhosin, remove all functions from disable_functions in php.ini and add in php.ini suhosin.executor.func.blacklist = “exec,passthru,shell_exec” and all the functions that you want to disable globally.

After that for each domain in the virtual host section you can add suhosin.executor.func.blacklist again but without the function that you need to enable. And so you will enable that function only for one domain.

Example:

<VirtualHost 127.0.0.1>
………..
………..
<IfModule mod_php4.c>
php_admin_value open_basedir “/usr/lib/php”
</IfModule>
<IfModule mod_php5.c>
php_admin_value open_basedir “/usr/lib/php”
php_admin_value suhosin.executor.func.blacklist = “passthru,shell_exec”
</IfModule>
…….
……
</VirtualHost>

In this example exec has been enabled for the VirtualHost. This way it will be better as you do not neet to modify all the virtual hosts only the ones that you need to enable one or more functions.

Regard’s

Alex P

How to install mod_ruby and eruby on Linux server ?

April 8th, 2009 5 comments

What is mod_ruby?

mod_ruby embeds the Ruby interpreter into the Apache web server, allowing Ruby CGI scripts to be executed natively. These scripts will start up much faster than without mod_ruby.


1) Install eRuby

# wget http://www.modruby.net/archive/eruby-1.0.5.tar.gz

# tar -xzvf eruby-1.0.5.tar.gz

# cd eruby-1.0.5/

# ./configure.rb –with-charset=euc-jp –enable-shared

# make; make install

2) Install mod_ruby

i)Download latest mod_ruby tar file

# wget http://www.modruby.net/archive/mod_ruby-1.2.6.tar.gz

# tar -xzvf mod_ruby-1.2.6.tar.gz

# cd mod_ruby-1.2.6/

#  ./configure.rb –enable-eruby –with-apxs=/usr/local/apache/bin/apxs

# make; make install

ii)Edit apache configuration file ( httd.conf) and add following code

LoadModule ruby_module libexec/mod_ruby.so
ClearModuleList
AddModule mod_ruby.c
AddHandler cgi-script .rb
<IfModule mod_mime.c>

# for Ruby/eRuby
<IfModule mod_ruby.c>
# for Apache::RubyRun
RubyRequire apache/ruby-run
# for Apache::ERubyRun
RubyRequire apache/eruby-run
# for development
# RubyRequire auto-reload
# for add library
#RubyAddPath /usr/local/lib/ruby
# exec *.rbx as ruby scripts.
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
# handle *.rhtml as eruby files.
<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>
</IfModule>
</IfModule>

iii) Restart apache service on server


Regards

Alex P