Posts

Showing posts from 2008

How To Configure Web Access To Subversion Repositories Using Apache

Image
This how to is going to describe the steps to get the mod_dav_svn module to work in an Apache web server. First I'll assume that we don't have Apache and Subversion installed on our FreeBSD box, in a second part I'll explain how to add the module using our current installation. First we have to install our Apache 2.0.x with Berkeley DB support (because Subversion will use Berkeley DB to save the repositories). To do this we have to go to the ports dir and do this: box# cd /usr/ports/www/apache20/ box# make -DWITH_BDB4 install clean some installation steps... Add apache ability to start automatically at boot time: box# echo 'apache2_enable="YES"' >> /etc/rc.conf After we have apache20 installed with bdb support, we'll have to install Subversion: box# cd /usr/ports/devel/subversion box# make -DWITH_MOD_DAV_SVN install clean some installation steps... After installation we'll have to ensure that mod_dav_svn module was properly in...

nohup Execute Commands After You Exit From a Shell Prompt

Most of the time you login into remote server via ssh. If you start a shell script or command and you exit (abort remote connection), the process / command will get killed. Sometime job or command takes a long time. If you are not sure when the job will finish, then it is better to leave job running in background. However, if you logout the system, the job will be stopped. What do you do? nohup command Answer is simple, use nohup utility which allows to run command./process or shell script that can continue running in the background after you log out from a shell: nohup Syntax: nohup command-name & Where, command-name : is name of shell script or command name. You can pass argument to command or a shell script. & : nohup does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an & symbol. nohup command examples 1) Login to remote server $ ssh user@remote.server.com 2) Execute script called pull...

autostart apache during boot

i just finished my apache, php, mysql installation for my new server.  i used Centos 5.1. Those not started when i reboot my server. Oh..i forgot to make it autostart during boot time.  Here the steps to auto run apache or mysql during the boot time.. run command runlevel to check your current Centos run level Running  runlevel  command on my centos linux machines displays default run level as 5.You must be wondering what runlevel has to do with by autostarting apache server. There is reason for that Linux uses different run levels to boot and you should know default runlevel where you would like to configure apache to autostart during boot. Next you have to use magic command called  chkconfig  on fedora to list the apache (httpd) services runlevel: [root@node12 ~]# chkconfig --list httpd httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off In chkconfig output  off  means apache (httpd) service is set with no autostart for associated runlevels. Since my default runlevel is 5 , I need to se...

configure: error: C compiler cannot create executables

Today I have tried to compile a software in a Linux machine, when I run ./configure I got checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for multicast... checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. Then I installed gcc with: apt-get install gcc  for Ubuntu and for Centos i used yum install gcc  and try again, this time I got: and try again, this time I got: checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for multicast... checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create exe...

enable and disable SElinux

Important Changes you make to files while SELinux is disabled may give them an unexpected security label, and new files will not have a label. You may need to relabel part or all of the file system after re-enabling SELinux. From the command line, you can edit the  /etc/sysconfig/selinux  file. This file is a symlink to /etc/selinux/config . The configuration file is self-explanatory. Changing the value of  SELINUX  or SELINUXTYPE  changes the state of SELinux and the name of the policy to be used the next time the system boots. [root@host2a ~]# cat /etc/sysconfig/selinux # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=permissive # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # ...

Configure PHP connection to Oracle DB – the RPM way

I have CentOS 4.4 box which I want to connect to Oracle DB 10g via PHP There are 2 way to configure PHP to connect to Oracle DB using OCI: A. Use PHP RPMs (which included all php module in RPM package) but nowadays oci8 module no longer provider by CentOS and you might use older version of PHP - easiest and quickest way B. Use current version of PHP and enable oci8 via PEAR. You will get current PHP version with oci8 enable but still in RPM way Lets begin A. Use PHP RPMs packages 1. Install Apache if not installed CODE: # yum install httpd 2. Download Oracle Client Software -- if you are using GUI or download Oracle InstantClient BasicLite (the rpm version) -- I choose this and install it. to get latest version download it from http://www.oracle.com/technology/tech/oci/instantclient/instantclient.html CODE: # rpm –ivh oracle-instantclient-basiclite-*.rpm my copy of Oracle Instant Client BasicLite is here http://www.am3n.profusehost.net/phpoci/oracle-instantclient-basic-10.2.0.3-1.i386....

nstalling PHP and the Oracle 10g Instant Client for Linux and Windows

Updated for PHP 5.1.2 Author: Christopher Jones, Consulting Technical Staff, Oracle Corporation Updated: January 2006 Oracle 10 g  Instant Client ( free download  available) is the easiest way for PHP to connect to a remote Oracle database, requiring installation of only three libraries. The Instant Client libraries used by PHP access Oracle's current API, called OCI8. (This C interface takes its name from being first introduced in Oracle8.) PHP  Oracle 8 Functions  can call Oracle 8.1.7, 9.x, or 10.x directly, or optional abstraction classes like  PEAR MDB2  and  ADOdb  can be used for convenience. The older PHP "oracle" extension can also be used with Instant Client but it calls a deprecated Oracle API. New development with this extension is not recommended by the PHP community or by Oracle. To use Instant Client with PHP 4 or 5 on Apache, follow the steps below. (See  this section  for details about 5.1.2 and its refactored OCI8 extension.) An existing Oracle database ...

Disable SELinux on CENTOS 5

To check and see if  SELINUX  (secure linux) is installed and running on your Red Hat ES 5 (CentOS 5, etc) server, use a text editor to open  /etc/selinux/config : vi /etc/selinux/config Inside you should see a line that says SELINUX=*some value* Where  *some value*  is either  enforcing ,  permissive  or  disabled . To shut  SELINUX  off, set the variable to disabled . To receive a set of errors to see what services would be affected if  SELINUX  was running, set it to perimissive . If you are sure all your services, daemons and everything else is set up with correct  SELINUX permissions, you can set it to  enforcing . If you're getting an error after  compiling and installing an Oracle OCI8 module for PHP  you might want to set SELINUX  to  permissive  or  disabled  until you are able to resolve the permission problem. If you have to change the setting you should reboot the server to make sure the change takes effect system wide.

install apache, mysql and php on centos

Below are the steps to install LAMP (Apache, PHP and MySQL in Linux) using Yum:- Go to  CentOS  and download a copy of CentOS Linux and install it (i’ll not go thru the how to install CentOS with you here) Once your CentOS is installed. Open a terminal (if you are using X-Window), and type  yum install httpd  and follow on screen instruction to install apache web server Once apache web server has been installed, type  yum install php Once php installed try to install it's  extension type   yum install php-common php-gd php-mcrypt php-memchache php-mhash php-mysql php-xml Once PHP installed successfully, type  yum install mysql-server mysql Once everything finish, type  service httpd start  to start your apache web server, screen will show you if web server service successfully started type  service mysqld start  to start your mysql server Once both services is running, you can point your browser to http://localhost and you should see a welcome page from CentOS If you see that welco...

Using ADOdb with PHP and Oracle: an advanced tutorial

1. Introduction Oracle is the most popular commercial database used with PHP. There are many ways of accessing Oracle databases in PHP. These include: The oracle extension The oci8 extension PEAR DB library ADOdb library The wide range of choices is confusing to someone just starting with Oracle and PHP. I will briefly summarize the differences, and show you the advantages of using ADOdb . First we have the C extensions which provide low-level access to Oracle functionality. These C extensions are precompiled into PHP, or linked in dynamically when the web server starts up. Just in case you need it, here’s a guide to installing Oracle and PHP on Linux . Oracle extension Designed for Oracle 7 or earlier. This is obsolete. Here is an example of using the oci8 extension to query the emp table of the scott schema with bind parameters: $conn = OCILogon("scott","tiger", $tnsName); $stmt = OCIParse($conn,"select * from emp where empno > :emp orde...