Posts

Showing posts from October, 2008

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...