22
Aug 10

iMac Makina Bilgisini Öğrenmek

To determine the physical RAM size, use System Profiler (/Applications/Utilities/System Profiler) or enter the following command:

# /usr/sbin/system_profiler SPHardwareDataType | grep Memory

To determine the size of the configured swap space, enter the following command:
# df -h /

To determine whether the system architecture can run the software, enter the following command:

# uname -p

To determine the operating system version, enter the following command:

# sw_vers
sh-3.2# cat /etc/hosts | grep `eval hostname`
127.0.0.1 Serkon.local

En üst düzey Grup Id ye sahip Grup numarası ve Grup adını listeler
# sudo dscl . list /groups gid name more | awk '{print $2 $1}' | sort -ug | tail -1

$ env | more
TERM=xterm-color
SHELL=/bin/bash
USER=oracle
ORACLE_HOSTNAME=Ss.local
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
PWD=/Users/soracle
SHLVL=1
HOME=/Users/oracle
_=/usr/bin/env

18
Aug 10

Quick Install Guide for Oracle 10g Release 2 on Mac OS X Leopard & Snow Leopard (Intel)

Posted by Alex Gorbachev on Apr 13, 2009

I was very surprised that Oracle released Oracle Database for Mac OSX, especially, version 10g now that 11g has been out for almost 2 years. Well, I guess Oracle wanted to please Mac users expecting things just work and decided that good proved 10g is the way to go. On the other hand, we’ve been supporting 11g in production for quite a while and I must say it’s much better quality compare to 10g when it came out. I’m pretty sure there was a significant customer that influenced that decision — interesting who might that be?

Anyway, there is no quick install guide for OS X but only a standard Oracle® Database Installation Guide
10g Release 2 (10.2) for Apple Mac OS X (Intel)
. It’s fine but if you want to install Oracle on your MacBook and not for production use then you might take some shortcuts and follow a quick instructions so I gathered my notes while installing just released Oracle Database 10.2.0.4 on my MacBook and this is what you see now.

First things first — prerequisites

  • You must be on OS X 10.5.4 or higher. You are probably keeping your system up to date and is on the current release (10.5.6 as I’m writing this). Note that the guide requires OS X Server but for your playground, desktop OS X will work just fine. Update 14-Sep-09: this Guide has been updated for Snow Leopard 10.6.
  • You need to install Xcode 3.0 but if you are a Mac enthusiast, you will have it installed already. If not, you can find Xcode on your OS X Installation DVD or you can download it from from Apple Developer Connection but it’s quite large.
  • Disk space — about 5GB for software installation including temporary needs.
  • You can run with as low as 1GB of RAM but you do want to have at least 2GB to avoid your system crawling.

Creating OS oracle user

Oracle installation guides always instruct to have at least two groups — oinstall as a software owner and dba as an OSDBA group. I never saw an organization with the natural split of these responsibilities so I always prefer to create a single dba group and use it for both purposes.

I use 4200 as GUI and UID so checking if they are available (Updated on 19-Apr-09: Thanks Gleb!):

macbook:~ gorby$ dscl . -list /groups gid | grep 4200
macbook:~ gorby$ dscl . -list /users uid | grep 4200
macbook:~ gorby$

To create user oracle with default dba group, run the following script. I assume you run it as “admin” user so that you can sudo to root (you will need to enter your user password at the first time):
Updated 01-May-09: oracle->dba group membership line added. Thanks Johannes.

sudo dscl . -create /groups/dba
sudo dscl . -append /groups/dba gid 4200
sudo dscl . -append /groups/dba passwd "*"
sudo dscl . -create /users/oracle
sudo dscl . -append /users/oracle uid 4200
sudo dscl . -append /users/oracle gid 4200
sudo dscl . -append /users/oracle shell /bin/bash
sudo dscl . -append /users/oracle home /Users/oracle
sudo dscl . -append /users/oracle realname "Oracle software owner"
sudo dscl . -append /Groups/dba GroupMembership oracle
sudo mkdir /Users/oracle
sudo chown oracle:dba /Users/oracle
sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add oracle
sudo passwd oracle

The last command will prompt for the new password and the command prior to the last will remove oracle user from login window — I find it annoying otherwise.

Kernel parameters

Next, you will need to set kernel parameters. Some of them are already good and some I would question changing on my MacBook just to have Oracle installed so I’d rather keep them. Use the following command to check current values (recommended values are after hash symbol as comment):

sysctl kern.sysv.semmsl # 87381
sysctl kern.sysv.semmns # 87381
sysctl kern.sysv.semmni # 87381
sysctl kern.sysv.semmnu # 87381
sysctl kern.sysv.semume # 10
sysctl kern.sysv.shmall # 2097152
sysctl kern.sysv.shmmax # max SGA you need.
sysctl kern.sysv.shmmni # 4096
sysctl kern.maxfiles # 65536
sysctl kern.maxfilesperproc # 65536
sysctl net.inet.ip.portrange.first # 1024
sysctl net.inet.ip.portrange.last # 65000
sysctl kern.corefile # core
sysctl kern.maxproc # 2068
sysctl kern.maxprocperuid # 2068

From semaphores and shared memory setting, I only needed to change shmall and shmmni. maxfiles and maxfilesperproc were set lower (12288 and 10240 respectively) but I would prefer to keep it this way – my test database won’t need so many open files descriptors unless something is wrong with it. IP port range by default is 49152-65535 and I would prefer to keep it this way to have as little impact on my environment as possible. I also don’t want the core files to be generated in oracle way as a file core in a process’ current directory so I’ll leave the corefile value at “/cores/core.%P”. Finally, I believe values for maxproc and maxprocperuid should be enough if I set 1024 and 512 respectively.

Unfortunately, 4 values I need to change can’t be modified at run-time so I have to configure them in /etc/sysctl.conf and reboot. For this, add the following to /etc/sysctl.conf (you probably will need to create a new file) and reboot:

kern.sysv.shmall=2097152
kern.sysv.shmmni=4096
kern.maxproc=1024
kern.maxprocperuid=512

Update 30-Apr-09: I obviously miscounted zeroes in shmmax and it’s set to 4MB and not 4GB. :) Interesting, it still works! This makes me think that shmall (max shared segment size in pages) overrides shmmax or the kernel chooses the highest setting.

After reboot here are my kernel parameters:

kern.sysv.semmsl: 87381
kern.sysv.semmns: 87381
kern.sysv.semmni: 87381
kern.sysv.semmnu: 87381
kern.sysv.semume: 10
kern.sysv.shmall: 2097152
kern.sysv.shmmax: 4194304
kern.sysv.shmmni: 4096
kern.maxfiles: 12288
kern.maxfilesperproc: 10240
net.inet.ip.portrange.first: 49152
net.inet.ip.portrange.last: 65535
kern.corefile: /cores/core.%P
kern.maxproc: 1024
kern.maxprocperuid: 512

Creating ORACLE_BASE directory

I want to have my Oracle binaries installed on a non-system partition HD2 so I’m creating directory there:

sudo mkdir /Volumes/HD2/oracle
sudo chown oracle:dba /Volumes/HD2/oracle
sudo chmod 775 /Volumes/HD2/oracle

You can also use oracle’s home directory /Users/oracle if you just have one disk/partition.

Update 14-Sep-09: If you don’t have another hard disk or partition mounted, the DO NOT use path in /Volumes/… You can use oracle’s home directory instead — /Users/oracle.

User environment

Next I login as oracle user (su - oracle) and create bash profile ~/.bash_profile:

# Must match kern.maxprocperuid
ulimit -Hu 512
ulimit -Su 512
# Must match kern.maxfilesperproc
ulimit -Hn 10240
ulimit -Sn 10240

export ORACLE_BASE=/Volumes/HD2/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=mac10g
PATH=$PATH:/$ORACLE_HOME/bin

Starting X11 server

X11 server is not running by default but you can kick it off either from Applications -> Utilities -> X11 or from command line (by default DISPLAY variable is pointing to a socket file):

macbook:~ gorby$ echo $DISPLAY
/tmp/launch-ArvCjk/:0
macbook:~ gorby$ xclock
Warning: locale not supported by Xlib, locale set to C
^C
macbook:~ gorby$ netstat -an | grep 6000 | grep LISTEN
tcp4       0      0  *.6000                 *.*                    LISTEN
tcp6       0      0  *.6000                 *.*                    LISTEN

Update 14-Sep-09: If you don’t see X11 listening on this port (and by default it doesn’t listen on Snow Leopard 10.6) then enable it in X11 preferences “Allow connections from network clients” or use this command line sudo defaults write org.x.X11 nolisten_tcp 0 (Thanks Tomasz).

Installing the software

Become oracle user with su - oracle, export DISPLAY variable and verify it works by running xclock:

macbook:~ oracle$ export DISPLAY=localhost:0
macbook:~ oracle$ xclock
^C
macbook:~ oracle$

Update 14-Sep-09: Above works only for OS X 10.5 Leopard. OS X 10.6 Snow Leopard has stricter security settings so you cannot simply su to oracle user and export DISPLAY — you actually have to login as oracle user (logout in GUI and login as oracle “Oracle software owner”) instead of “su – oracle”. Thanks to Raimond for this.

I assume you have already downloaded and unzipped Oracle 10g Release 2 installation binaries. If not do it now and unzip in a temporary location.

I use DHCP for network configuration of my MacBook and it changes IP address as well as hostname dynamically so I’d rather install database for localhost as it never changes. There is a trick with Oracle Installer for exactly that purpose — just set ORACLE_HOSTNAME environment variable before running the Installer. Don’t do that if you want your Oracle database to be accessible by other computers on the network but then you probably want to have your network configured with static IP. You can always change it later by reconfiguring the listener.

export ORACLE_HOSTNAME=localhost

Update 01-Sep-09: Thanks to Chris Murphy for an update re installation on OS X 10.6 Snow Leopard:
* Edit runInstaller and change /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2 to /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0. Raimond Simanovskis proposes to just create a link which is probably a better solution — sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2.
* Use additional option — ./runInstaller -J-d32
Kudos Chris!

Update 1-Mar-10: Nicolas reported another way — install 1.4.2 JDK.

Now, run the installer from Disk1 directory:

macbook:~ oracle$ /Users/oracle/db/Disk1/runInstaller
Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-04-13_08-24-33PM. Please wait ...macbook:~ oracle$

Select Advanced installation option on the first screen. On the next screen, specify location for Oracle inventory to be under ORACLE_BASE — /Volumes/HD2/oracle/oraInventory and inventory OS group dba. The rest of the screens leave with defaults unless you know what you need to tweak so keep clicking next… next… next… Specify desired ORACLE_SID for the new database and make Global Database Name the same (I use mac10g as you could see from my .bash_profile). Plus, you can also tick the box to create sample schemas on the same screen so you have some data to play with. Finally, set some tough passwords for internal Oracle users (we all know that it’s the best to use system/manager and sys/change_on_install as top secret) and you are ready to rock-n-roll.

The last part (installation and linking) is usually the most troublesome when installing Oracle software but in case of Mac OS X there are very few dependencies so it should work just fine unless you missed Xcode 3.0 install. Well, at least it did work fine for me. Binaries installation took just few minutes on my Macbook and Configuration Assistants were relatively quick as well. Oh, you will be prompted to accept network connections to application oracle and you should answer “Yes” — it’s only asked the first time and answer is valid until oracle binaries are changed. At the end, you will need to run couple scripts as root user — usual stuff.

Snow Leopard update 14-Sep-09: If you get Error in invoking target ‘all_no_orcl ipc_g ihsodbc32 error during linking then edit file $ORACLE_HOME/rdbms/lib/ins_rdbms.mk (without exiting installer – just switch to the terminal) and comment out line with $(HSODBC_LINKLINE) — just place hash # in front. Then switch back to the error in the installer and click “Retry”. I picked it up from Raimonds Simanovskis’s post — thanks a bunch.

Raimond also suggests how to fix Java GUI tools (netca and dbca) so that they run on Snow Leopard. Quoting him — “modify $ORACLE_HOME/jdk/bin/java script and change …java -Xbootclasspath… to …java -d32 -Xbootclasspath…“.

Completing network configuration

The installer doesn’t start the listener automatically so do that as oracle user if you need network connectivity using lsnrctl start. Automatic instance registration won’t work because the PMON process it trying to register with a listener on the default port 1521 of the main host IP but we forced Oracle Installer to use localhost. Not a problem, just set local_listener parameter accordingly:

SQL> show parameter listener

NAME             TYPE        VALUE
---------------- ----------- -----------------
local_listener   string
remote_listener  string

SQL> alter system set local_listener='localhost';

System altered.

SQL> alter system register;

System altered.

I personally don’t want to start an Oracle database instance automatically on reboot of my MacBook so I use command-line prompt. Automatic shutdown on reboot — well, I can shutdown manually or just let it crash. I’m way too confident in Oracle crash recovery mechanism.

We are done!

macbook:~ oracle$ uname -a
Darwin macbook 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386
macbook:~ oracle$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.5.6
BuildVersion:   9G55
macbook:~ oracle$ sqlplus system@mac10g

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Apr 13 21:04:56 2009

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Enter password: 

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

What’s next? Perhaps, get APEX working on Mac OS X?

So now, dear reader, we hope we have helped you figure out something you needed to know. It turns out that you can help us here at Pythian with something we need to know! If you are aware of a DBA requirement within your organization, salaried or consulting, please pop in your email address here:


We respect your privacy and will not share your address with any third party. As a thank you for just participating, we will enter you into a monthly draw for a year’s membership in the ACM, which includes access to 600 books from the O’Reilly Bookshelf Online, 500 books from Books24×7 and 3000 online courses from SkillSoft, including tons of courseware on Oracle, SQL Server, and MySQL.

Category: Oracle, Oracle E-Business Suite, SQL Server
Tags: , , , , , ,


18
Aug 10

How to install Oracle 10g on Mac OSX 10.4

As still a lot of people seem to look for my old Oracle & Mac OSX posts I have chosen to keep them here:

I finally managed to get Oracle to install on Mac OS X 10.4. Most of it I did with the help of Journeyman’s blog and the Oracle Documentation.

Pre-requisites
You have downloaded oracle 10.1 from otn.oracle.com

Create users and groups

1. As root create the dba group:
Picture 4

Check that the creation succeeded with:
Picture 5

2. As root create the Oracle user:
Picture 7
Please note that there is a type in line 3 above: It should be “nicl . – append /users/oracle gid 601″

Check that the creation succeeded with:
Picture 8

3. As root set up the software and directories:

Picture 14

4. As root extract the Oracle software to the correct location and change the ownership to the Oracle user:

Picture 1

Basic Tiger setup:
1. Set OSX to use the gcc 3.3 compiler:

Picture 2

Oracle setup:
1. As root configure the kernel parameters:

Picture 3

To keep those paramters add the following lines to your /etc/sysctl.conf file:
kern.maxproc=2068
kern.maxprocperuid=2068

2. As Oracle create the oracle bash profile
Create a file named .bash_profile in the oracle user’s home directory with your ORACLE_BASE and ORACLE_SID.

Example:
Picture 5

3. As oracle launch the Oracle installer:

Picture 8
The installation will fail towards the end complaining lost TNS when running database creation wizard. Just hit abort.

Picture 9

5. As Oracle relink Oracle:

Picture 10

6. As Oracle run dbca to create an instance:
Just type dbmca in a terminal window.

Picture 12

7. Run root.sh as root when asked to:
This script will appear hang at end and displaying a message “Expecting the CRS daemons to be up within 600 seconds.”
The CRS is only available on OSX Server so simply Ctrl-C terminate the process.

8. You are done. Start up your new Oracle instance from a command prompt …

I got Oracle to start automatically on my Power Book. Reading the Oracle documentation helped a lot but it still took a lot of fiddling around to get it to work.

How to automatically start Oracle on Mac OSX 10.4
1. Sudo to root

2. Edit the file /etc/oratab: Set the line SID:ORACLE_HOME:{Y|N} to Y

3. Create a new directory (as root) /Library/StatupItems/Oracle

4. Download the Oracle startup script and edit it in a text editor (Note that the name of this file must be Oracle):
Change the ORACLE_HOME variable to reflect the location of your local ORACLE_HOME
If you don’t use Oracle http server remove the startup and shutdown lines for the http server

5. Copy the file Oracle to /Library/StatupItems/Oracle

6. Download the script StartupParameters.plist file and place it in the same directory

7. Change the ownership of the new files:
cd to /Library/StatupItems/Oracle
chown root:wheel *
chmod 700


18
Aug 10

Set up Oracle 10g on Tiger

This describes how I set up Oracle 10g on OSX Tiger for development use.

Sergio has an excellent instruction on how to install Oracle 10g on Panther. However because the Oracle requires gcc 3.3 and Tiger uses gcc 4 by default. Some hacks are in order.

Following Sergio’s instruction to prepare Oracle installation environment. Issue the following commands as root before launch installer.

sudo nicl . -append /groups/admin users oracle
sudo gcc_select 3.3

Then launch the Oracle installer. The installation will fail towards the end complaining lost TNS when running database creation wizard. Simply abort and do following extra steps.

Step 1: Firstly, set up $ORACLE_HOME and $PATH in your .bash_profile. By default, the ORACLE_HOME is at “/Volumes/u01/app/oracle/product/10.1.0/db_1″ if you follow Sergio’s instruction. While logged in as oracle, add following two lines to .bash_profile, adjust the ORACLE_HOME value as necessary.

export ORACLE_HOME="/Volumes/u01/app/oracle/product/10.1.0/db_1"
export PATH=$PATH:~/bin:$ORACLE_HOME/bin

Issue following command to activate new settings.

cd
. .bash_profile

Step 2: Relink Oracle libraries.

cd $ORACLE_HOME/lib
mv libnnz10.dylib libnnz10.dylib.ori
relink all
mv libnnz10.dylib.ori libnnz10.dylib

Step 3: Run ‘dbca’ to create a database. What to do when dbca does not start?

Step 4: Run ‘$ORACLE_HOME/root.sh’. This script will appear hang at end and displaying a message “Expecting the CRS daemons to be up within 600 seconds.” The CRS is only available on OSX Server so simply Ctrl-C terminate the process.

Step 5: Download Oracle startup and stop script and extract it to ‘oracle’ user home. Now you can start and stop Oracle instance by running ‘startup.sh’ and ‘stop.sh’ respectively.

Step 6: If your machine has a fixed IP, you probably don’t need to perform this step. Since I run Oracle on my powerbook and I am only going to use this Oracle for development purpose, I change listener.ora and tnsnames.ora under $ORACLE_HOME/network/admin to make it work with dynamic ip like 192.168.0.1 and only connectable from localhost.

My listener.ora looks like:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = test1)
      (ORACLE_HOME = /Volumes/u01/app/oracle/product/10.1.0/db_1)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      )
    )
  )

And my tnsnames.ora looks like:

TEST1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = test1)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

One final point, Oracle 10g has its own JDBC driver. Drivers for Oracle 9 won’t work with 10g.

Update (Tue Jul 26 08:48:23 PDT 2005): how to start isqlplus.

http://journeymanjournal.blogspot.com/2005/06/set-up-oracle-10g-on-tiger.html


17
Aug 10

Ubuntu Linux üzerinde PHP , OCI8 ve Oracle Instant Client Kurulumu

Kaynak: Sühan Erol

Bu makale ile, günümüzün en yaygın ve kullanışlı linux dağıtımlarından olan Ubuntu üzerinde Oracle bağlantı destekli PHP kurulumu anlatılarak bir sonraki  “PHP ile ‘OCI Client Result Cache’  (Sorgu sonuçlarının İstemci(webserver)  tarafında tutulması)“  konulu makalenin uygulanabilmesi için hazırlık yapılması amaçlanmıştır.

Bir terminal açınız ve aşağıdaki sudo komutunu yazarak sistem yöneticisi hakkını alınız.

# sudo -i

Aşağıdaki komut apache’nin son sürümünü yükleyecektir.

# apt-get install apache2

PHP ve diğer modüllerin kurulumu
# apt-get install php5-common php5 php5-dev libapache2-mod-php5 php5-cli

# apt-get install build-essential php-pear

# apt-get install libaio1

Aşağıdaki linki kullarak Oracle Instant Client BASIC ve SDK dosyalarını indiriniz.

http://www.oracle.com/technology/tech/oci/instantclient/index.html

Dosyalar muhtemelen kullanıcının masaüstüne kayıt edilecektir.

Aşağıdaki komut ile yeni bir dizin açınız.

# mkdir /opt/oracle

İndirdiğiniz iki dosyayı yeni oluşturulan /opt/oracle klasörüne taşıyınız.

# mv /home/ubuntu/Desktop/*.zip /opt/oracle

Yeni oluşturulan klasöre geçiniz

# cd /opt/oracle

InstantClient dosyalarını aşağıdaki komut ile açınız.
# unzip \*.zip

Unzip işlemi sonunda yeni bir klasör oluşacaktır. Bu klasörün ismini aşağıdaki komut ile değiştiriniz.

# mv instantclient_11_1 instantclient

Yeni klasöre giriniz.
# cd instantclient

Yeni Sembolik linkler oluşturmak için aşağıdaki komutlar çalıştırınız.

# ln –s libclntsh.so.11.1 libclntsh.so
# ln –s libocci.so.11.1 libocci.so

Aşağıdaki komut ile yeni bir klasör oluşturunuz. Bu klasör OCI8 kütüphane dosyalarını içerecektir.

# mkdir /opt/oracle/src

Yeni oluşturulan klasöre geçiniz ve pecl ile OCI8 tar dosyasını indiriniz. Pecl son sürüm OCI8 dosyasını indirecektir. Şuanda son sürüm 1.3.5 dir. 1.3 sürümünden itibaren "Client Result Cache" özelliği kullanılabilmektedir.

# cd /opt/oracle/src
# pecl download oci8

İndirilen OCI8 dosyasını açınız.

# tar xvf oci8-1.3.5.tgz

Yeni oluşan klasöre giriniz.

# cd oci8-1.3.5

phpize komutu, PHP için yeni bir eklenti derlemek gerektiğinde sistemde gerekli hazırlıkların yapılmasını sağlamaktadır. OCI8 Eklentisini derlemek için bu komutu çalıştırınız.

# phpize

Aşağıdaki komutu kullarak ORACLE_HOME çevre değişkenini tanımlayınız.
# export ORACLE_HOME=/opt/oracle/instantclient

OCI8 eklentisinin derlemesi işleminin ilk adımı olarak aşağıdaki configure komutunu çalıştırınız.
# ./configure --with-oci8=share,instantclient,/opt/oracle/instantclient

make komutuyla derlemeyi başlatınız.

# make

Aşağıdaki komut ile oluşan oci8.so dosyasının ilgili klasöre kopyalanmasını sağlayınız.

# make install

PHP ve OCI8 bağlantısının sağlanması için php.ini dosyalarına “extension=oci8.so” satırının eklenmesi gerekmektedir. Aşağıdaki komutlar ile bunu gerçekleştirebilirsiniz.

# echo extension=oci8.so >> /etc/php5/apache2/php.ini
# echo extension=oci8.so >> /etc/php5/cli/php.ini

Apacheyi Yeniden Başlatınız.

# /etc/init.d/apache2 restart

Bu işlemlerden sonra PHP, OCI aracılığıyla Oracle veritabanı bağlantısı yapabilir hale gelmiştir. aşağıdaki örnek kod ile test yapabilirsiniz.

<?php
$c=oci_pconnect('hr','hr','//oracleserver:1521/xe');
$s=oci_parse($c,"select  * from hr.employees");
oci_execute($s);
oci_fetch_all($s,$res);
print_r($res);
?>

17 Yorum »

  1. peki sayın ustam, bi sorum olacak…

    oracle client yuklu makine üstünde php+mysql+apache var.
    buraya kadar her şey tamam.

    ama oracle server baska bir makinada (windows 2003).

    oracle client nasıl bağlanacak ona ?

    Yorum yapan ismail savran — Mart 25, 2009 @ 8:01 am

  2. Yukarıda anlatılan kurulum içinde sizin belirttiğiniz durum geçerli, yani oracle server başka bir makinada.

    $c=oci_pconnect(’hr’,’hr’,’//oracleserver:1521/xe’); komutundaki “oracleserver” oracle kurulu makinanin ismi veya ip olabilir. bu ismi değiştirerek bağlantı kurabilirsiniz.

    Yorum yapan suhanerol — Mart 25, 2009 @ 9:16 am

  3. teşekkürler…

    Yorum yapan ismail savran — Mart 25, 2009 @ 9:48 am

  4. Ubuntu üzerinde tam olarak yapmak istediğim şey buydu. Apache ve Oracle kurulumu…
    Konu için teşekkürler.

    ;)

    Yorum yapan Halkın Gündemi — Ekim 29, 2009 @ 11:47 am

  5. Merhaba ben yaklaşık 1 haftadır uğraşıyorum yapamamıştım sizin anlatımınız çok güzel ancak SDK paketini bulup kuramadım.Sanırım o yüzden # ln –s libclntsh.so.11.1 libclntsh.so
    # ln –s libocci.so.11.1 libocci.so bu komutlar çalışmadı ben görmezden gelip kuruluma devam ettim yine bikaç yerde sorun çıktı. Dolayısıyla şuanda apache çalışıyor ama oracle çalışmıyor..

    Yorum yapan Olcay SONAT — Aralık 9, 2009 @ 9:33 am

  6. Merhaba

    SDK ve diğer dosyaları aşağıdaki linkten indirebilirsiniz.

    http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html

    Yorum yapan suhanerol — Aralık 9, 2009 @ 10:04 am

  7. root@olci-desktop:/opt/oracle/instantclient# ln –s libclntsh.so.11.1 libclntsh.so
    ln: hedef ‘libclntsh.so’ bir dizin değil

    bu komutta hep bir hata alıyorum ne yapmayalıyım?

    Yorum yapan Olcay SONAT — Aralık 9, 2009 @ 12:16 pm

  8. Sanırım siz oracle client 11.2 sürümünü indirmişsiniz. yeni sürüm çıkmış. Bu yüzden komutu ln –s libclntsh.so.11.2 libclntsh.so olarak yazınız.

    Yorum yapan suhanerol — Aralık 9, 2009 @ 1:14 pm

  9. yok şuan kontrol ettim o dizindeki dosyada libclntsh.so.11.1 yazıyor oracle client versiyonu da
    Oracle Database 10g Express Edition Release 10.2.0.1.0 – Product
    PL/SQL Release 10.2.0.1.0 – Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 – Production
    NLSRTL Version 10.2.0.1.0 – Production

    böyle bir türlü kuramadım..

    Yorum yapan Olcay SONAT — Aralık 14, 2009 @ 8:25 am

  10. ln -s komutuyla ilgili bir sorun olabilir, dilerseniz ln -s ile link oluşturmak yerine cp komutuyla dosyaların bir kopyasını oluşturabilirsiniz.

    # cp libclntsh.so.11.1 libclntsh.so
    # cp libocci.so.11.1 libocci.so

    Yorum yapan suhanerol — Aralık 14, 2009 @ 8:51 am

  11. anlatılan her şeyi yaptım. kurulumu normal şekilde tamamladım. ama veri tabanına bir türlü bağlanamıyorum. şu hatayı veriyor.
    Warning: oci_connect() [function.oci-connect]: ORA-12154: TNS:could not resolve the connect identifier specified in /var/www/oracle.php on line 2
    sistemim ubuntu 9.10, oracle 10g exp. edi.
    teşekkürler

    Yorum yapan Hamza Apaydın — Aralık 16, 2009 @ 12:29 pm

  12. Kurulumunuz başarılı olmuş, sorun oci_connect() fonksiyonunda kullandığınız parametre ile alakalıdır. oci_connect() fonksiyonun 3.parametresinde kullandığınız değer nedir? oci_pconnect(’hr’,’hr’,’//oracleserver:1521/xe’); örneğinde olduğu gibi server ismimi kullandığız? isim yerine ip yazarak deneyebilirsiniz.

    Yorum yapan suhanerol — Aralık 16, 2009 @ 12:57 pm

  13. oci_pconnect(’SYSTEM’,’root’,’//oracleserver:1521/xe’);
    dabase adi XE, son aparametre olarak “XE”, “http://127.0.0.1/XE”, vb. denedim olmadı.

    Yorum yapan Hamza Apaydın — Aralık 16, 2009 @ 1:03 pm

  14. oci_pconnect(‘hr’,’hr’,’//localhost:1521/xe’);

    bu şekilde deneyiniz. kullanıcı adı ve şifreyi değiştirmeniz gerekebilir. http:// kullanmayınız.

    Yorum yapan suhanerol — Aralık 16, 2009 @ 1:36 pm

  15. Fatal error: Call to undefined function oci_pconnect() in /home/kahraman/public_html/ocitestpconnect.php on line 2

    merhaba yukarıdaki gibi bir hata alıyorum ben kurulumu aşağıdaki linkte anlatıldığı gibi yaptım.

    http://www.oracle.com/technology/pub/notes/technote_php_instant.html

    Centos 5.4 64 bit kullanıyorum ve oracle extensionun 11.2 versiyonunu yeni çıkanı yani kurdum.Anlatılan kurulumdan farklı yaptığım tek şey “pecl install oci8″ bu komutu kullandığımda bir hata verdi kullanıcı yetki felan bişey diyodu tamamlamıyodu kurulumu bende internette araştırdım böyle bi sorunla karşılaşmış bir arkadaşa bir kullanıcı aşağıdaki komutları kullandıktan sonra yeniden pecl komutunu kullanmasını söylemiş :

    export LC_ALL=”C”
    export LANG=”C”

    Bende bu komutları kullandıktan sonra “pecl install oci8″ komutu çalıştı ve kaldırğım yerden kuruluma devam ettim ve bitirdim acaba nerde yanlış yapıyo olabilirim.Teşekkür ederim.

    ocitestpconnect.php nin içeriği ise aşağıdaki şekilde ;

    Yorum yapan Çağdaş Çakmak — Mart 6, 2010 @ 8:01 pm

  16. $c=oci_pconnect(‘KULLANICI_ADI’,’PASSWORD’,’//xxx.xxx.xxx.xxx:1521/ORCL’);
    $s=oci_parse($c,”select * from KULLANICI_ADI.TABLE”);
    oci_execute($s);
    oci_fetch_all($s,$res);
    print_r($res);

    Yorum yapan Çağdaş Çakmak — Mart 6, 2010 @ 8:20 pm

  17. php.ini dosyasına
    # echo extension=oci8.so >> /etc/php5/apache2/php.ini
    # echo extension=oci8.so >> /etc/php5/cli/php.ini

    şeklinde gerekli düzenlemeyi yaptınız mı? Hata mesajı OCI eklentisinin php tarafından tanınmadığını gösteriyor.

    Yorum yapan suhanerol — Mart 7, 2010 @ 10:46 am


16
Aug 10

Installing Mysql Manually on MacOsX

Source: http://hivelogic.com/articles/installing-mysql-on-mac-os-x

Update: I’ve posted updated instructions for compiling MySQL on Snow Leopard.

What follows are instructions for building and installing MySQL 5 on Mac OS X. These instructions should work perfectly on both Tiger and Leopard.

If you’re a pro at this type of thing already, if you’re impatient, or just feeling lucky, you can download the basic install steps as a shell script and give that a go. Just make sure you’ve installed Xcode and set your path correctly (if that doesn’t make sense, you should keep reading).

Why You Might Want to Build MySQL Yourself
Although there is a MySQL package-installer for Leopard (available here), there are a few reasons why you might still want to compile your own version of MySQL:

You’ll have a stand-alone, easy-to-update version of MySQL that you control and understand
When a new version of MySQL comes out, you won’t have to wait for the MySQL team to release a package for Mac OS X (or for your version of Mac OS X) … just download the latest source and follow the steps – they never change
You can easily uninstall MySQL yourself at any time
Compiling software yourself lets you learn how Mac OS X and the software you use really work behind the scenes
But … there are some downsides, too:

You won’t get a Preference Pane to start/stop MySQL (unless Mantorg agrees to build us one. Idea: email him and tell him you want him to)
It takes about 20 minutes to build and install
In the end, compiling and installing MySQL this way is well worth the effort, as the end result delivers an easy-to-upgrade, system-independent, stand-alone development platform that is impervious to potential problems that can be caused by system updates, operating system upgrades, etc.

By rolling our own from source this way, we also have full control over our environment. We know what’s installed and where, what version we’ve used, where it came from, and there’s no dependence on an external ports system and the breakage or issues that come from relying on others to manage our software.

These issues and additional background information about why one might roll their own tools in this fashion are detailed in the article, Using /usr/local/, which could be considered a prerequisite for this task.

A Quick Warning
While it’s unlikely anything we do here might do any kind of damage to the system, it’s good advice to have a current backup of everything, just in case. I don’t take any responsibility for anything that results from following these instructions. You’re following these instructions at your own risk.

Prerequisites
You’ll need to install Xcode. Xcode can be found in the Optional Installs folder of the installation DVD. You can also download the latest version from Apple by getting a (free) membership from the Apple Developer Connection.

Just double click the Xcode installer package, take the defaults, and you’ll be ready to roll.

A Note About Existing MySQL Installations
If you already have MySQL installed and used the package installer from MySQL to install it, you need to remove a single file (actually a symlink) to disable it:

sudo rm /usr/local/mysql
If you also installed the StartupItem package, you’ll want to remove it as well. Keep in mind that if you ever want to auto-start the old version of MySQL later on, you’ll need to re-download the package installer and reinstall the StartupItem.

sudo rm -rf /Library/StartupItems/MySQLCOM/
Exporting or migrating your old data isn’t difficult, but it is beyond the scope of this article. I may write something up to handle this in a subsequent article if it’s something people want.

Terminal
We’re going to be typing archaic commands into a window using a monospaced font, just like in a movie! And if things go well, later, your life-sized avatar will learn kung-fu.

Open the Terminal application. It can be found in the /Applications/Utilities folder.

Each of the lines below appearing in monospaced type should be entered into Terminal, and be followed by the Return key. But you knew that already.

Setting the Path
Do not skip this step! Most everything else will fail if you do.

Mac OS X, like other UNIX systems, uses something called a path to determine where it should look for applications on the command line (that is, when you’re using the Terminal app). The path is actually an environment variable, set by a special file that’s automatically executed when you open a new Terminal window.

To see if the path has been set properly, we can check the contents of the .bash_login file (the special file hidden in our home folder) for a PATH line using a text editor. TextMate, TextWrangler, BBEdit, and vi are all perfectly good options. To open the file with TextMate, for example, we can type:

mate ~/.bash_login
This will open the file if it already exists, or open a blank file if it doesn’t. Add the following line at the very end of the file:

export PATH=”/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH”
Now save and close the file.

It doesn’t matter how many other lines there are in the file, or what they say or do. Just make sure that this line comes last and you should be fine.

To make sure the changes are picked up correctly, we now need to execute the file with the following command:

. ~/.bash_login
It’s likely there will be no response from the shell here, just the prompt, but that’s OK, the changes have been picked up and we’re ready to move on.

You can also close your Terminal and open a new one instead if you’d like.

Setting Up
I like to create a folder to contain the MySQL source code file and build folder. This way, I can later uninstall MySQL easily, as well as download and compile new versions, all in one place.

For these examples, we’ll create a folder called src in our home folder, and change directories into that folder. It will be our workspace for everything we do here:

mkdir -p ~/src
cd ~/src
You’ll download and compile everything in this new folder.

Download, Extract, Etc.
Now we’re ready to start the real work. Just type (or cut-n-paste) each one of the following lines into Terminal, one by one. When one line finishes (some will take a while and dump a lot of information to the screen), enter the next one.

This will first download and then expand the MySQL source code distribution:

curl -O http://mysql.he.net/Downloads/MySQL-5.1/mysql-5.1.33.tar.gz
tar xzvf mysql-5.1.33.tar.gz
cd mysql-5.1.33
You then need to configure MySQL:

CC=gcc CFLAGS=”-O3 -fno-omit-frame-pointer” CXX=gcc
CXXFLAGS=”-O3 -fno-omit-frame-pointer -felide-constructors
-fno-exceptions -fno-rtti”
./configure –prefix=/usr/local/mysql
–with-extra-charsets=complex –enable-thread-safe-client
–enable-local-infile –enable-shared –with-plugins=innobase
When that process completes, you can initiate the actual compilation process:

make
This part can take a while. Now is a good time to go and get yourself a tasty beverage.

The last part of the build process is where MySQL actually gets installed. You’ll be prompted for your password here, because this is where files actually get written to their actual locations:

sudo make install
Next, we need to setup the initial databases and privileges. You may be prompted for your password again:

cd /usr/local/mysql
sudo ./bin/mysql_install_db –user=mysql
sudo chown -R mysql ./var
That’s it, MySQL is installed. But you’re not done yet.

Auto-Starting MySQL
Now that the install is done, you need to have MySQL auto-start every time you start or reboot your Mac. The easiest way to do this is using launchd.

I’ve prepared a launchd plist file that will manage MySQL, starting it at boot and stopping it cleanly at shutdown. Create a file named com.mysql.mysqld.plist using the text-editor of your choice, and save it to your Desktop. Enter the following text into the file:

< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">


KeepAlive

Label
com.mysql.mysqld
Program
/usr/local/mysql/bin/mysqld_safe
RunAtLoad

UserName
mysql
WorkingDirectory
/usr/local/mysql
Now we need to move the file into place and set the permissions on it. You may be prompted for your password again:

sudo mv ~/Desktop/com.mysql.mysqld.plist /Library/LaunchDaemons
sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist
With the file in place, the last step is to tell launchd to load and startup MySQL. You may be prompted for your password again:

sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
If things go well, you won’t see anything special happen, but MySQL will have started up. You can verify this, again back in Terminal:

mysql -uroot
This will initiate MySQL’s command-line monitor. If everything went well, you should see something like this:

Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.0.45 Source distribution
Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.
mysql&gt;
If you see that, that’s it, you’re done! Type exit to quit the MySQL monitor.

If you see something else, verify that your paths are set correctly and try the command again. If things still don’t work, it’s likely that something didn’t work and the compile didn’t finish. Try going through the steps once more and see if you can catch any error messages.

Starting and Stopping MySQL Manually
If you ever want to stop MySQL manually, use this command in Terminal, entering you password when prompted:

sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
To start it manually, use this command in Terminal, entering you password when prompted:

sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
A Note about Security
The easiest way to secure your MySQL installation without affecting the way you (or your applications) will need to communicate with it is to limit anything but local connections to your MySQL server. In other words, only you and the apps you run on your own Mac will be able to connect. You won’t need to enter passwords when interacting with MySQL locally, and won’t need to tweak the default database.yml files that Rails creates, for example.

We can limit access by creating (or editing) the /etc/my.cnf file. If you have TextMate installed, you can enter the following command to create (or edit) the file:

mate /etc/my.cnf
If you use BBEdit, you’d use this command:

bbedit /etc/my.cnf
The handy bit about using TextMate (or BBEdit) for this task is that it will handle authentication and setting permissions for you.

Enter the following text into the file save it and close it, authenticating as needed:

[mysqld]
bind-address = 127.0.0.1
Thanks to my friend Mike Clark for this tip.

If limiting access isn’t enough for you, you can read about setting a root access password for MySQL in this article.

Baking-In the MySQL Bindings
You can gain some bigtime Rails-to-MySQL speed improvements by building the MySQL C bindings for Ruby.

If you have an Intel Mac, just run the following command (entering your password when prompted):

sudo env ARCHFLAGS=”-arch i386″ gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
If you have a PPC Mac (I hear some still exist), you’d enter:

sudo env ARCHFLAGS=”-arch ppc” gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
You’ll see a prompt asking you which gem to install:

Select which gem to install for your platform (universal-darwin9.0)
1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (ruby)
4. mysql 2.6 (ruby)
5. Skip this gem
6. Cancel installation
Pick the option closest to the top that ends in “(ruby)”. In the example above, we’d want to select option 3.

Uninstalling MySQL
In case you one day decide that you’d like to remove MySQL, it’s easy to do when building from source:

cd ~/src/mysql-5.0.45
sudo make uninstall
sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
sudo rm /Library/LaunchDaemons/com.mysql.mysqld.plist
That’s It
So, you’re done. What are you waiting for? Go create the next Google or something.

Special thanks to Koz, Mike Clark, Ryan Schwartz, and Jason Seifer for their tips and suggestions.

Filed in Development, Tutorials.


07
Jul 10

Tüm Dış Linkleri Yeni Pencerede Açtırmak

This little bit of code, using JQuery, will parse every anchor

<a href="#"></a>

on your page, decide if it points to an external site. If it does, will instruct it to open in a new window.

// Open external links in new windows using jquery
$('a[href^="http://"]').filter(function() {
    return this.hostname && this.hostname !== location.hostname;
}).attr('target', '_blank');

I personally find it very useful when working in xHTML Strict mode as the the

target=""

attribute is no longer a valid property and will cause your page to return as invalid.

*Remember to include Jquery.js in the header of your page.


03
Jul 10

Word-wrap ile Uzun Kelimeleri Kısaltmak

Web sitelerinde oluşturulan tabloların ya da divlerin içlerine eklenen içerikler her ne olursa olsun belirtilen genişlikte ve yükseklikte olmasını isteriz.

Bazen dar bir tablo içine çok uzun bir linki sığdırmak gerekebilir. Linkler bir bütün olduğu için ve alan içerisinde herhangi bir yerinden bölünemeyeceği için sorun çıkarırlar. Bu durumlarda Css kullanarak uzun kelime alana  sığacak şekilde ayarlayabilinir.

Div içerisine texti sığdırmak için yapılacak şey aslında çok basit. Bunu CSS özelliklerini kullanarak kolayca halledebiliriz. Eski bir projede yine böyle bir şey lazım olmuştu ve biraz daha uzun bir method ile çözmüştüm. Şimdi o projeyi hatırlayamadığım için ve unutmamak için not alayım istiyorum. Aşağıdaki kod bu işi kolayca yapacaktır.

.break-word {
  word-wrap: break-word;
}

Word-wrap özelliği 2 adet değer almaktadır; normal ve break-word. Normal özelliği ile kelime uzamaya devam ederken, break-word bizim işimizi görmeye yetecektir. Word-wrap IE 5.5+, Firefox 3.5+, ve WebKit (Chrome ve Safari) gibi browserlar tarafından desteklenmektedir.

break-word Olmadan

http://www.serkankonakci.com_title_with_a_long_url_continue_here

break-word Kullanılınca

http://www.serkankonakci.com_title_with_a_long_url_continue_here


20
Jun 10

SVN, Apache Server Entegrasyonu

Subversion’u aktif hale getirmek için gereken birkaç basit ayar var. Öncelikle sistemde subversion’un ve Apache HTTPD serverin kurulu olması gerekir. Daha önceki makalelerde Subversion ve Apache’nin nasil kurulur anlatmıştım.

Subversion ile ilgili ayların başlatılması için Apache serverin içerisinde yer alan 2 adet modülün aktif hale getirilmesi gerekmektedir. Ben bu modülleri Zend Server için aktif hale getireyim dedim ama Zend Library’sinde bu modüllerin kullanıldığı *.so uzantılı dosyalar mevcut değildi. Mac ile gelen apache den aldım bu so dosyalarını sürüm ile ilgilimi bilmem ama yine de çalışmadı. O zaman bende mevcut OsX ile gelen Apache üzerinde Subversion’u çalıştırayım dedim ve de çalıştırdım.

Yapmak gereken basit :

/etc/apache2/httpd.conf

dosyası açılır ve içerisine şu sıralamada modüller aktif hale getirilir.

# Example:
# LoadModule foo_module modules/mod_foo.so
#

LoadModule dav_module         libexec/apache2/mod_dav.so
LoadModule dav_svn_module     libexec/apache2/mod_dav_svn.so

Daha sonra en alt satıra inilir ve gerekli paylaşımlar ve Svn adresleri servera bildirilir.

<location /repo>
 DAV svn
 SVNPath /Volumes/Svn/Lokman
 AuthType Basic
 AuthName "Subversion"
 AuthUserFile /Volumes/Svn/svn_passwd
 Require valid-user
</location>

Yukarıda SVNPath adresine konsol ekranından

svnadmin create [REAL_PATH]

ile yaratılmış SVN pathi girilir. AuthUserFile kısmına da SVN için gerekli onay bilgisi tanımlanır. Bu dosyanın formatı yani içeriği örnek olarak şöyle olmalıdır.

serkan@kamusm:Lh8QDEdjdddsQ

gibi. Tabiki şifre geçersiz bir şifre ve bu şifre direk kullanılan bir şifre değil. svn -password gibi bir şey ile üretmiştim ancak doğrumu hatırlayamadım. Şifre üretilirken şu komut kullanılır ve dosya belirtilen path’de kendiliğinden oluşur. Oluşurken iki defa şifre girilmesi istenir. Dosya incelendiğinde yukarıdaki gibi bir bilginin yer aldığını görürsünüz.

htpasswd -cm <password -file-path-name> <username>

Daha sonra ne yaptım:

  1. Önce Svn in yükleneceği REAL_PATH klasörüne _www:_www yetkisi verdim
  2. Sudo olarak Chown 777 REAL_PATH yaptım
  3. Svn import ile REAL_PATH [URL] -m “init” ile ilk çalışma sağlandı.
  4. Web browsera http://localhost/lh yazıp çalıştığını gördüm

Hepsi bu kadar!


17
Jun 10

Apache Httpd Server Directory Listing i Açmak

Apache Httpd server üzerde bir klasöre erişildiğinde klasör içerisindeki dosyaların neler olduğunu listeletme ihtiyacı doğabilir.

Bazı php dosyaların isimleri uzunca yazılmış olabilir. Adres satırına bu uzun isimleri tek tek yazmak biraz vakit kaybettirebilir. Bu nedenle directory listingi açarak tıkalamalar ile dosyalara erişim sağlanabilir.

Bu işlemleri test ortamında yapmak gerekir. Gerçek ortamda server içerisindeki hiçbir klasörün listelenmemesi kuralına dikkat edilmelidir.

Directory Listing için önce Apache nin kurulu olduğu dizine gidilir. Conf klasörü altında yer alan httpd.conf dosyası notepad ile editlenir. Listinge izin verilecek instance içerisine şu kod girilir.

Options All Indexes FollowSymLinks MultiViews

Sonuçta karşımıza şöyle bir kod çıkacaktır:

<Directory "D:\Web\Testler">
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
  Options All Indexes FollowSymLinks MultiViews
</Directory>