- Community Home
- >
- HPE Community, Korea
- >
- HP-UX
- >
- 혹시.. hpux 용.. php가..
HP-UX
1819545
회원
3133
온라인
109603
솔루션
포럼
범주
Company
Local Language
뒤로
포럼
토론 게시판
포럼
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
토론 게시판
토론 게시판
토론 게시판
포럼
토론 게시판
뒤로
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
블로그
정보
커뮤니티 언어
언어
포럼
블로그
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
날짜: 01-05-2004 11:00 PM
날짜: 01-05-2004 11:00 PM
혹시.. hpux 용.. php가..
좀 바보같은 질문일지 모르겠는데...
아차피 깔 때 하도 고생을 해서요.. 노파심에.. ^^;;
혹시 hp ux용으루 php도 따로 있나요~? ㅡㅡ;;
그리구.. hp ux 용 아파치는 따로 컴파일 할 필요가 없잖아요..
리눅스나.. 다른 때 깔때는.. 아파치 컴파일하구.. php컴파일하구.. .. make하구.. 머.. 이렇게 순서가 있는데..
hp ux는 그냥.. php만 파일 올리구 컴파일(옵션포함)하구..
아파치설치하구.. 그러면 되는건가요~?
정확한 순서와 방법을 알고싶습니다.(쉽게 설명해주세여.. ^^;;;)
아차피 깔 때 하도 고생을 해서요.. 노파심에.. ^^;;
혹시 hp ux용으루 php도 따로 있나요~? ㅡㅡ;;
그리구.. hp ux 용 아파치는 따로 컴파일 할 필요가 없잖아요..
리눅스나.. 다른 때 깔때는.. 아파치 컴파일하구.. php컴파일하구.. .. make하구.. 머.. 이렇게 순서가 있는데..
hp ux는 그냥.. php만 파일 올리구 컴파일(옵션포함)하구..
아파치설치하구.. 그러면 되는건가요~?
정확한 순서와 방법을 알고싶습니다.(쉽게 설명해주세여.. ^^;;;)
3 응답 3
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
날짜: 01-06-2004 11:00 PM
날짜: 01-06-2004 11:00 PM
혹시.. hpux 용.. php가..
php를 따로 설치할수도 있지만 hp-ux apache web server로 충분합니다.
따로설치하시지 마십시오.
;ora815상에서 ocilogon()
별루 수정한게 없는데 잘 되더군요...
아래는 php.net에서 가져온 source입니다.
이부분을 web-browser상에서 실행시켰을때
"Connected!"라고 정확히 올라왔습니다.
처음엔 님과 똑같은 error를 맞아 system call상에 문제가
있나 check해보았는데 별문제가 없었습니다.
#nm /opt/hpws/apache/php/lib/php/extensions/oci8.sl|
grep -i ocilogon
zif_ocilogon | 99488|extern|entry |
zif_ocilogon | 99512|extern|code |$CODE$
#apachectl stop/start(ps -ef |grep -i httpd)
< ? php
putenv("ORACLE_SID=ora815");
//putenv("ORACLE_HOME=/oracle/ora90");
//putenv("TNS_ADMIN=/oracle/ora90/network/admin");
$username = "scott";
$passwd = "tiger";
$db="(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)
(HOST=krcbcs2)(PORT=1521)
)
)
(CONNECT_DATA=(SERVICE_NAME=ora815))
)";
$conn = OCILogon($username,$passwd,$db);
if (!$conn)
{
echo "Connection failed";
echo "Error Message: ";
exit;
}
else
{
echo "Connected!";
}
?>
;oracle 9i는 아래내용에 충실해야 될것 같은데요.
Under $ORACLE_HOME/lib create a symbolic link named
libclntsh.sl.8.0 that points to libclntsh.sl.9.0
The libclntsh.sl.9.0 file should be present in $ORACLE_HOME/lib
bye~
따로설치하시지 마십시오.
;ora815상에서 ocilogon()
별루 수정한게 없는데 잘 되더군요...
아래는 php.net에서 가져온 source입니다.
이부분을 web-browser상에서 실행시켰을때
"Connected!"라고 정확히 올라왔습니다.
처음엔 님과 똑같은 error를 맞아 system call상에 문제가
있나 check해보았는데 별문제가 없었습니다.
#nm /opt/hpws/apache/php/lib/php/extensions/oci8.sl|
grep -i ocilogon
zif_ocilogon | 99488|extern|entry |
zif_ocilogon | 99512|extern|code |$CODE$
#apachectl stop/start(ps -ef |grep -i httpd)
< ? php
putenv("ORACLE_SID=ora815");
//putenv("ORACLE_HOME=/oracle/ora90");
//putenv("TNS_ADMIN=/oracle/ora90/network/admin");
$username = "scott";
$passwd = "tiger";
$db="(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)
(HOST=krcbcs2)(PORT=1521)
)
)
(CONNECT_DATA=(SERVICE_NAME=ora815))
)";
$conn = OCILogon($username,$passwd,$db);
if (!$conn)
{
echo "Connection failed";
echo "Error Message: ";
exit;
}
else
{
echo "Connected!";
}
?>
;oracle 9i는 아래내용에 충실해야 될것 같은데요.
Under $ORACLE_HOME/lib create a symbolic link named
libclntsh.sl.8.0 that points to libclntsh.sl.9.0
The libclntsh.sl.9.0 file should be present in $ORACLE_HOME/lib
bye~
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
날짜: 01-06-2004 11:00 PM
날짜: 01-06-2004 11:00 PM
혹시.. hpux 용.. php가..
어차피 오라클 연동이 문제가 된다면 아래의 내용을 참조하시길...
물론 환경은 리눅스지만..
compile 하는 부분 빼놓고는 똑같은니깐요...
www.javaservice.net 에서 펀글입니다..
님에게 혹시 도움이 될까해서...
REDHAT 6.2(영문) + ORACLE 8.1.6 + MySQL 3.22.32(Crypt-CBC-1.20, DBI-1.13, Data-Dumper-2.101,
Msql-Mysql-modules-1.2209) + imap 4.7b + openssl-0.9.5a + mod_ssl-2.6.6-1.3.12
+ gd-1.8.3 + mod_perl-1.24 + xml(expat-1.1-1.i386.rpm) + php-4.0.2 + zlib-1.1.3
+ ZendOptimizer-0.99-php4.0.2-Linux-glibc2.1 + apache 1.3.12 + freetype-1.3.1
+ ApacheJServ-1.1.2 + jdk1.3 + jsdk2.0
1. oracle + php 간단 연동
2. oracle 구동 script
3. c언어 + mysql연동 (배석준님이 도와주셨음)
작성자 : 금 유 환(ch3cooh@hitel.net, ch3cooh@golden21.net)
작성일 : 2000년 10월 18일
작성목적 : 단순한 a+p+m연동이 아니라 요즘 많이 쓰는 개발 플랫폼을 전부 포용하고 싶었다.
또한 누구나 쉽게 따라 하면 설치 할수 있게 하고 싶었다.
그리고, 나같이 삽질하는 사람이 없었으면 하는 생각에.....
(이문서는 자유롭게 배포 가능하다. 나만의 실력으로 이문서를 만든건 아니고 다른 사람들의 문서를
나도 많이 참고 하였기에....)
주의 사항 : 아레와 같은 방법으로 설치시 혹시, 서버에 문제가 생겼을 경우 책임못짐
==============================================================================================
# ls
8161Std apache_1.3.12.tar.gz mod_ssl-2.6.6-1.3.12.tar.gz
ApacheJServ-1.1.2 expat-1.1-1.i386.rpm mysql-3.22.32
ApacheJServ-1.1.2.tar.gz freetype-1.3.1 mysql-3.22.32.tar.gz
Crypt-CBC-1.20 freetype-1.3.1.tar.gz openssl-0.9.5a
Crypt-CBC-1.20.tar.gz gd-1.8.3 openssl-0.9.5a.tar.gz
DBI-1.13 gd-1.8.3.tar oracle-8161SE.i386.tar.gz
DBI-1.13.tar.gz imap-4.7b php-4.0.2
Data-Dumper-2.101 imap-4.7b.tar php-4.0.2.tar.gz
Data-Dumper-2.101.tar.gz j2sdk-1_3_0-linux.sh..sh red_update
Msql-Mysql-modules-1.2209 jsdk20-solaris2-sparc.tar.Z snort-1.6.2.tar.gz
Msql-Mysql-modules-1.2209.tar.gz libpng-1.0.6 ssh-1.2.30
ZendOptimizer-0.99-php4.0.2-Linux-glibc2.1 libpng-1.0.6.tar ssh-1.2.30.tar.gz
ZendOptimizer-0.99-php4.0.2-Linux-glibc2.1.tar.gz mod_perl-1.24 zlib-1.1.3
ZendOptimizer-RC1-Linux-glibc2.1.tar.gz mod_perl-1.24.tar.gz zlib-1.1.3.tar
apache_1.3.12
mod_ssl-2.6.6-1.3.12
**********************************************************************************
***** ---- 사전 작업 ---- *****
***** 설치할 프로그램에 해당하는 rpm을 모드 제거 한다 *****
***** ex) rpm -e *****
***** 설치할 프로그램의 압축 제거 *****
***** ex) tar xzvf .tar.gz (.tar.Z도 동일) *****
***** tar xvf .tar *****
**********************************************************************************
-=-=-=-=-= oracle user로 설치 =-=-=-=-=-=-
# cat .bash_profile
# .bash_profile
# Get the aliases and functions
if ; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""
export USERNAME BASH_ENV PATH
export ORACLE_BASE=/oracle/oracle8i
export ORACLE_HOME=/oracle/oracle8i/8.1.6
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export ORACLE_SID=ORCL
export ORACLE_TERM=vt100
export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
umask 022
# cd /temp/8161Std/
-=-=-=-=-=-= =-=-=-=-=-=-
**, oracle설치에 대해서는 http://technet.oracle.co.kr에 가시면 인스톨에 대한
자세한 설명이 나와있습니다.
# ./runInstaller
.....
.....
.....
.....
-=-=-=-=-=-= =-=-=-=-=-=-
$ cd ./oracle8i/8.1.6/bin/
$ ./svrmgrl
Oracle Server Manager Release 3.1.6.0.0 - Production
Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.
Oracle8i Release 8.1.6.1.0 - Production
JServer Release 8.1.6.0.0 - Production
SVRMGR> connect internal;
Connected.
SVRMGR> startup;
ORACLE instance started.
Total System Global Area 92712944 bytes
Fixed Size 69616 bytes
Variable Size 75694080 bytes
Database Buffers 16777216 bytes
Redo Buffers 172032 bytes
Database mounted.
Database opened.
SVRMGR> quit
Server Manager complete.
$ ./lsnrctl start
LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 01-SEP-2000 11:02:00
(c) Copyright 1998, 1999, Oracle Corporation. All rights reserved.
Starting /oracle/oracle8i/8.1.6/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 8.1.6.0.0 - Production
System parameter file is /oracle/oracle8i/8.1.6/network/admin/listener.ora
Log messages written to /oracle/oracle8i/8.1.6/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.golden21.net)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.golden21.net)(PORT=2481)) \
(PROTOCOL_STACK=(PRESENTATION=GIOP)(SESSION=RAW)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 8.1.6.0.0 - Production
Start Date 01-SEP-2000 11:02:01
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /oracle/oracle8i/8.1.6/network/admin/listener.ora
Listener Log File /oracle/oracle8i/8.1.6/network/log/listener.log
Services Summary...
ORCL has 1 service handler(s)
PLSExtProc has 1 service handler(s)
The command completed successfully
-=-=-=-=- -=-=-=-=-=-
$ ./svrmgrl
Oracle Server Manager Release 3.1.6.0.0 - Production
Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.
Oracle8i Release 8.1.6.1.0 - Production
JServer Release 8.1.6.0.0 - Production
SVRMGR> connect internal;
Connected.
SVRMGR> shutdown;
(##, shutdown immediate; )
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR> quit
Server Manager complete.
$ ./lsnrctl stop
LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 01-SEP-2000 11:00:21
(c) Copyright 1998, 1999, Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
The command completed successfully
-=-=-=-=-=-= =-=-=-=-=-=-
# vi ./apache_1.3.12/src/include/httpd.h
#define HARD_SERVER_LIMIT 8192 ===> 적당히 조절
# rpm -ivh expat-1.1-1.i386.rpm
# cd mysql-3.22.32
# ./configure --with-charset=euc_kr
# ./configure --prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data
# make; make install
# cp ./scripts /usr/local/mysql/ -R
# /usr/local/mysql/scripts/mysql_install_db
# /usr/local/mysql/bin/safe_mysqld &
# /usr/local/mysql/bin/mysqladmin version
# /usr/local/mysql/bin/mysqlshow
# /usr/local/mysql/bin/mysqlshow mysql
# cd ../Data-Dumper-2.101
-=-=-=-=- -=-=-=-=-=-
# perl Makefile.PL ; make ; make test ;make install
# cd ../DBI-1.13
# perl Makefile.PL ; make ; make test ;make install
# cd ../Msql-Mysql-modules-1.2209
# perl Makefile.PL ; make ; make test ;make install
(첫번째 질문에 을 치고 엔터하시고 여기서 머라고 자꾸 묻는데..신경끄시고 그냥 엔터만 계속 치면 됩니다.)
# cd ..
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# cd imap-4.7b
# make slx
# cp ./ipopd/ipop2d /usr/sbin
# cp ./ipopd/ipop3d /usr/sbin
# vi /etc/inetd.conf
pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
# /etc/rc.d/init.d/inet restart
Stopping INET services:
Starting INET services:
# cp c-client/c-client.a /usr/lib/libc-client.a
# mkdir /usr/local/include
# cp c-client/mail.h /usr/local/include
# cp c-client/rfc822.h /usr/local/include
# cp c-client/linkage.h /usr/local/include
# cd ../zlib-1.1.3
# ./configure ; make ; make install
# cd ../libpng-1.0.6
# cp scripts/makefile.linux makefile
# make test; make install
# cd ../gd-1.8.3
# make all
# cd ../freetype-1.3.1
# ./configure ; make; make install
# cd ../apache_1.3.12
# ./configure
# cd src
# ./Configure
# cd ../php-4.0.2
# ./configure --with-apache=/temp/apache_1.3.12 \
--with-language=korean \
--with-charset=euc_kr \
--with-oracle=/oracle/oracle8i/8.1.6 \
--with-oci8=/oracle/oracle8i/8.1.6 \
--with-mysql=/usr/local/mysql \
--with-gd=/temp/gd-1.8.3 \
--with-freetype=/temp/freetype-1.3.1 \
--with-imap=/temp/imap-4.7b \
--with-xml \
--enable--track-vars=yes \
--enable-sigchild \
--disable-debug
# make ; make install
# cp php.ini-dist /usr/local/lib/php.ini
# vi /usr/local/lib/php.ini
zend_optimizer.optimization_level = 7
zend_extention="/usr/local/Zend/lib/ZendOptimizer.so"
# cd ../mod_perl-1.24
# perl Makefile.PL APACHE_src=/temp/apache_1.3.12/src DO_HTTPD=1 USE_APACI=1
# cd ../openssl-0.9.5a
# ./config ; make ; make test ; make install
# cd ../mod_ssl-2.6.6-1.3.12
# ./configure --with-apache=/temp/apache_1.3.12 \
--with-ssl=/usr/local/ssl \
--prefix=/usr/local/apache \
--datadir=/usr/local/apache \
--disable-module=auth_dbm \
--disable-rule=SSL_COMPAT \
--disable-rule=WANTHSREGEX
# cd ../apache_1.3.12
# SSL_BASE=/usr/local/ssl ./configure --enable-module=ssl \
--prefix=/usr/local/apache \
--activate-module=src/modules/php4/libphp4.a \
--activate-module=src/modules/perl/libperl.a \
--enable-rule=SHARED_CORE \
--enable-module=so
# make ; make certificate ;make install
(make certificate실행시 SSL에 대한 인증정보를 입력하게 된다.)
# mkdir /usr/local/Zend
# mkdir /usr/local/Zend/lib
# ln -s /usr/local/lib/php.ini /usr/local/apache/conf/pnp.ini
# cd ../ZendOptimizer-0.99-php4.0.2-Linux-glibc2.1/
# cp ZendOptimizer.so /usr/local/Zend/lib
# cd ..
# cp JSDK2.0/ /usr/local/ -R
# cp jdk1.3/ /usr/local/jdk1.3 -R
# vi /etc/profile.d/java-init.sh
#!/bin/sh
export PATH=$PATH:$HOME/bin:/usr/local/JSDK2.0/bin:/usr/local/jdk1.3/bin
# cd ApacheJServ-1.1.2
# ./configure --with-apxs=/usr/local/apache/bin/apxs \
--prefix=/usr/local/jserv \
--with-jdk-home=/usr/local/jdk1.3 \
--with-JSDK=/usr/local/JSDK2.0 \
--disable-debugging
# make ; make install
# vi /usr/local/apache/conf/httpd.conf
Include /usr/local/apache/conf/jserv/jserv.conf
# pwd
/usr/local/apache/bin
# vi apachectl
export ORACLE_HOME=/oracle/oracle8i/8.1.6
export ORACLE_SID=ORCL
export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
export TNS_ADMIN=$ORACLE_HOME/network/admin
# vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .inc
AddType application/x-httpd-php .ph
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
AddType application/x-httpd-php-source .phps
# /usr/local/apache/bin/apachectl startssl
-=-=-=-=-=-=-= =-=-=-=-=-=-=-
https:///servlet/Hello
Example Apache JServ Servlet
Congratulations, ApacheJServ 1.1.2 is working!
-=-=-=-=-=-= =-=-=-=-=-=-=-
(id : php, password : oracle)
# su - oracle
$ svrmgrl system/manager
Oracle Server Manager Release 3.1.6.0.0 - Production
Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.
Oracle8i Release 8.1.6.1.0 - Production
JServer Release 8.1.6.0.0 - Production
SVRMGR> connect internal;
Connected.
SVRMGR> create user php identified by oracle;
Statement processed.
SVRMGR> grant resource, connect to php;
Statement processed.
SVRMGR> alter user php default tablespace users;
Statement processed.
SVRMGR> alter user php temporary tablespace temp;
Statement processed.
SVRMGR> exit
Server Manager complete.
$ cat ociserver.php
$conn = OCILogon("php","oracle");
print "Server Version: ".OCIServerVersion($conn);
OCILogOff($conn);
?>
-=-=-=-=-=-=-= <웹브라우져에서 설치한 url로 확인> =-=-=-=-=-=-=-
Server Version: Oracle8i Release 8.1.6.1.0 - Production JServer Release 8.1.6.0.0 - Production
-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-
==============================================================================================
# cat oracle
#! /bin/sh
# Oracle Start/Stop the Oracle ServerManager & Listener
#
# chkconfig: 2345 75 15
# description: Oracle 8.1.6.1 is an Enterprise Database System
# processname: oracle
# pidfile: /var/run/oracle.pid
# 2000-08-07, by mlrd (hshan2@cs.kookmin.ac.kr)
# Source function library.
. /etc/rc.d/init.d/functions
# Oracle Location (According to your configuration, modify it)
ORACLE_HOME=/oracle/oracle8i/8.1.6
# See how we were called.
case "$1" in
start)
# Start Oracle ServerManager
echo -n "Staring Oracle: "
su - oracle -c "$ORACLE_HOME/bin/svrmgrl <
connect internal
startup
EOF"
# Start Oracle Listener
su - oracle -c "$ORACLE_HOME/bin/lsnrctl start"
# Record PIDs
pidof -x oracle > /var/run/oracle.pid
pidof tnslsnr > /var/run/tnslsnr.pid
echo
touch /var/lock/subsys/oracle
touch /var/lock/subsys/tnslsnr
;;
stop)
echo -n "Shutting down Oracle: "
su - oracle -c "$ORACLE_HOME/bin/svrmgrl <
connect internal
shutdown
EOF"
su - oracle -c "$ORACLE_HOME/bin/lsnrctl stop"
echo
rm -f /var/lock/subsys/oracle
rm -f /var/lock/subsys/tnslsnr
rm -f /var/run/oracle.pid
rm -f /var/run/tnslsnr.pid
;;
status)
status oracle
status tnslsnr
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
===============================================================================================
-=-=-=-=-=-=-= <script 사용법> =-=-=-=-=-=-=-
# /etc/rc.d/init.d/oracle start ; 시작
# /etc/rc.d/init.d/oracle stop ; 중지
# /etc/rc.d/init.d/oracle restart ; 재시작
# /etc/rc.d/init.d/oracle status ; 실행상태 보기
===============================================================================================
*** c언어 + mysql연동
===> 선행작업 : mysql db에 user만들고 또한db 만들고,그리고 임의의 table에 test할 data 예제
column넣고 컴파일 하세요.
===== 소스 ====================================================================================
# cat test_capi.c
/* test_capi.c */
#include
#include "mysql.h"
#define def_host_name NULL /* host to connect to */
#define def_user_name NULL /* user name */
#define def_password NULL /* password */
#define def_db_name NULL /* database to use */
MYSQL *conn;
int main (int argc, char *argv[])
{
MYSQL_RES *res_set;
MYSQL_ROW row;
char *strSql = (char *) malloc(1000);
unsigned int i;
printf("Content-type: text/html%c%c",10,10); /* CGI Header */
conn = mysql_init(NULL);
mysql_real_connect(
conn, /* pointer to connection handler */
"", /* host to connect to */
"", /* user name */
"", /* password */
"", /* database to use */
0, /* port (use default) */
NULL, /* flags (none) */
0);
strcpy(strSql, "select * from test_member");
if (mysql_query(conn, strSql)) /* Execute the query */
{
printf("Something is wrong!\n");
exit(1);
}
else
res_set = mysql_use_result(conn);
while ((row = mysql_fetch_row(res_set)) != NULL)
{
for (i = 0; i < mysql_num_fields(res_set); i++)
{
printf("column %u: value is %s
", i, (row == NULL ? "NULL" : row));
}
}
mysql_close(conn);
exit(0);
}
================================================================================================
소스 설명은 안해도 대충 보시면 아시겠죠..!!
-=-=-=-=-= 위소스 컴파일 하기 =-=-=-=-=-=-
# gcc -c -I/usr/local/mysql/include/mysql test_capi.c
# gcc -o test_capi test_capi.o -L/usr/local/mysql/lib/mysql -lmysqlclient
# ./test_capi
Content-type: text/html
물론 환경은 리눅스지만..
compile 하는 부분 빼놓고는 똑같은니깐요...
www.javaservice.net 에서 펀글입니다..
님에게 혹시 도움이 될까해서...
REDHAT 6.2(영문) + ORACLE 8.1.6 + MySQL 3.22.32(Crypt-CBC-1.20, DBI-1.13, Data-Dumper-2.101,
Msql-Mysql-modules-1.2209) + imap 4.7b + openssl-0.9.5a + mod_ssl-2.6.6-1.3.12
+ gd-1.8.3 + mod_perl-1.24 + xml(expat-1.1-1.i386.rpm) + php-4.0.2 + zlib-1.1.3
+ ZendOptimizer-0.99-php4.0.2-Linux-glibc2.1 + apache 1.3.12 + freetype-1.3.1
+ ApacheJServ-1.1.2 + jdk1.3 + jsdk2.0
1. oracle + php 간단 연동
2. oracle 구동 script
3. c언어 + mysql연동 (배석준님이 도와주셨음)
작성자 : 금 유 환(ch3cooh@hitel.net, ch3cooh@golden21.net)
작성일 : 2000년 10월 18일
작성목적 : 단순한 a+p+m연동이 아니라 요즘 많이 쓰는 개발 플랫폼을 전부 포용하고 싶었다.
또한 누구나 쉽게 따라 하면 설치 할수 있게 하고 싶었다.
그리고, 나같이 삽질하는 사람이 없었으면 하는 생각에.....
(이문서는 자유롭게 배포 가능하다. 나만의 실력으로 이문서를 만든건 아니고 다른 사람들의 문서를
나도 많이 참고 하였기에....)
주의 사항 : 아레와 같은 방법으로 설치시 혹시, 서버에 문제가 생겼을 경우 책임못짐
==============================================================================================
# ls
8161Std apache_1.3.12.tar.gz mod_ssl-2.6.6-1.3.12.tar.gz
ApacheJServ-1.1.2 expat-1.1-1.i386.rpm mysql-3.22.32
ApacheJServ-1.1.2.tar.gz freetype-1.3.1 mysql-3.22.32.tar.gz
Crypt-CBC-1.20 freetype-1.3.1.tar.gz openssl-0.9.5a
Crypt-CBC-1.20.tar.gz gd-1.8.3 openssl-0.9.5a.tar.gz
DBI-1.13 gd-1.8.3.tar oracle-8161SE.i386.tar.gz
DBI-1.13.tar.gz imap-4.7b php-4.0.2
Data-Dumper-2.101 imap-4.7b.tar php-4.0.2.tar.gz
Data-Dumper-2.101.tar.gz j2sdk-1_3_0-linux.sh..sh red_update
Msql-Mysql-modules-1.2209 jsdk20-solaris2-sparc.tar.Z snort-1.6.2.tar.gz
Msql-Mysql-modules-1.2209.tar.gz libpng-1.0.6 ssh-1.2.30
ZendOptimizer-0.99-php4.0.2-Linux-glibc2.1 libpng-1.0.6.tar ssh-1.2.30.tar.gz
ZendOptimizer-0.99-php4.0.2-Linux-glibc2.1.tar.gz mod_perl-1.24 zlib-1.1.3
ZendOptimizer-RC1-Linux-glibc2.1.tar.gz mod_perl-1.24.tar.gz zlib-1.1.3.tar
apache_1.3.12
mod_ssl-2.6.6-1.3.12
**********************************************************************************
***** ---- 사전 작업 ---- *****
***** 설치할 프로그램에 해당하는 rpm을 모드 제거 한다 *****
***** ex) rpm -e *****
***** 설치할 프로그램의 압축 제거 *****
***** ex) tar xzvf .tar.gz (.tar.Z도 동일) *****
***** tar xvf .tar *****
**********************************************************************************
-=-=-=-=-=
# cat .bash_profile
# .bash_profile
# Get the aliases and functions
if ; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""
export USERNAME BASH_ENV PATH
export ORACLE_BASE=/oracle/oracle8i
export ORACLE_HOME=/oracle/oracle8i/8.1.6
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export ORACLE_SID=ORCL
export ORACLE_TERM=vt100
export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
umask 022
# cd /temp/8161Std/
-=-=-=-=-=-=
**, oracle설치에 대해서는 http://technet.oracle.co.kr에 가시면 인스톨에 대한
자세한 설명이 나와있습니다.
# ./runInstaller
.....
.....
.....
.....
-=-=-=-=-=-=
$ cd ./oracle8i/8.1.6/bin/
$ ./svrmgrl
Oracle Server Manager Release 3.1.6.0.0 - Production
Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.
Oracle8i Release 8.1.6.1.0 - Production
JServer Release 8.1.6.0.0 - Production
SVRMGR> connect internal;
Connected.
SVRMGR> startup;
ORACLE instance started.
Total System Global Area 92712944 bytes
Fixed Size 69616 bytes
Variable Size 75694080 bytes
Database Buffers 16777216 bytes
Redo Buffers 172032 bytes
Database mounted.
Database opened.
SVRMGR> quit
Server Manager complete.
$ ./lsnrctl start
LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 01-SEP-2000 11:02:00
(c) Copyright 1998, 1999, Oracle Corporation. All rights reserved.
Starting /oracle/oracle8i/8.1.6/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 8.1.6.0.0 - Production
System parameter file is /oracle/oracle8i/8.1.6/network/admin/listener.ora
Log messages written to /oracle/oracle8i/8.1.6/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.golden21.net)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle.golden21.net)(PORT=2481)) \
(PROTOCOL_STACK=(PRESENTATION=GIOP)(SESSION=RAW)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 8.1.6.0.0 - Production
Start Date 01-SEP-2000 11:02:01
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /oracle/oracle8i/8.1.6/network/admin/listener.ora
Listener Log File /oracle/oracle8i/8.1.6/network/log/listener.log
Services Summary...
ORCL has 1 service handler(s)
PLSExtProc has 1 service handler(s)
The command completed successfully
-=-=-=-=-
$ ./svrmgrl
Oracle Server Manager Release 3.1.6.0.0 - Production
Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.
Oracle8i Release 8.1.6.1.0 - Production
JServer Release 8.1.6.0.0 - Production
SVRMGR> connect internal;
Connected.
SVRMGR> shutdown;
(##, shutdown immediate; )
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR> quit
Server Manager complete.
$ ./lsnrctl stop
LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 01-SEP-2000 11:00:21
(c) Copyright 1998, 1999, Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
The command completed successfully
-=-=-=-=-=-=
# vi ./apache_1.3.12/src/include/httpd.h
#define HARD_SERVER_LIMIT 8192 ===> 적당히 조절
# rpm -ivh expat-1.1-1.i386.rpm
# cd mysql-3.22.32
# ./configure --with-charset=euc_kr
# ./configure --prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data
# make; make install
# cp ./scripts /usr/local/mysql/ -R
# /usr/local/mysql/scripts/mysql_install_db
# /usr/local/mysql/bin/safe_mysqld &
# /usr/local/mysql/bin/mysqladmin version
# /usr/local/mysql/bin/mysqlshow
# /usr/local/mysql/bin/mysqlshow mysql
# cd ../Data-Dumper-2.101
-=-=-=-=-
# perl Makefile.PL ; make ; make test ;make install
# cd ../DBI-1.13
# perl Makefile.PL ; make ; make test ;make install
# cd ../Msql-Mysql-modules-1.2209
# perl Makefile.PL ; make ; make test ;make install
(첫번째 질문에 을 치고 엔터하시고 여기서 머라고 자꾸 묻는데..신경끄시고 그냥 엔터만 계속 치면 됩니다.)
# cd ..
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# cd imap-4.7b
# make slx
# cp ./ipopd/ipop2d /usr/sbin
# cp ./ipopd/ipop3d /usr/sbin
# vi /etc/inetd.conf
pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
# /etc/rc.d/init.d/inet restart
Stopping INET services:
Starting INET services:
# cp c-client/c-client.a /usr/lib/libc-client.a
# mkdir /usr/local/include
# cp c-client/mail.h /usr/local/include
# cp c-client/rfc822.h /usr/local/include
# cp c-client/linkage.h /usr/local/include
# cd ../zlib-1.1.3
# ./configure ; make ; make install
# cd ../libpng-1.0.6
# cp scripts/makefile.linux makefile
# make test; make install
# cd ../gd-1.8.3
# make all
# cd ../freetype-1.3.1
# ./configure ; make; make install
# cd ../apache_1.3.12
# ./configure
# cd src
# ./Configure
# cd ../php-4.0.2
# ./configure --with-apache=/temp/apache_1.3.12 \
--with-language=korean \
--with-charset=euc_kr \
--with-oracle=/oracle/oracle8i/8.1.6 \
--with-oci8=/oracle/oracle8i/8.1.6 \
--with-mysql=/usr/local/mysql \
--with-gd=/temp/gd-1.8.3 \
--with-freetype=/temp/freetype-1.3.1 \
--with-imap=/temp/imap-4.7b \
--with-xml \
--enable--track-vars=yes \
--enable-sigchild \
--disable-debug
# make ; make install
# cp php.ini-dist /usr/local/lib/php.ini
# vi /usr/local/lib/php.ini
zend_optimizer.optimization_level = 7
zend_extention="/usr/local/Zend/lib/ZendOptimizer.so"
# cd ../mod_perl-1.24
# perl Makefile.PL APACHE_src=/temp/apache_1.3.12/src DO_HTTPD=1 USE_APACI=1
# cd ../openssl-0.9.5a
# ./config ; make ; make test ; make install
# cd ../mod_ssl-2.6.6-1.3.12
# ./configure --with-apache=/temp/apache_1.3.12 \
--with-ssl=/usr/local/ssl \
--prefix=/usr/local/apache \
--datadir=/usr/local/apache \
--disable-module=auth_dbm \
--disable-rule=SSL_COMPAT \
--disable-rule=WANTHSREGEX
# cd ../apache_1.3.12
# SSL_BASE=/usr/local/ssl ./configure --enable-module=ssl \
--prefix=/usr/local/apache \
--activate-module=src/modules/php4/libphp4.a \
--activate-module=src/modules/perl/libperl.a \
--enable-rule=SHARED_CORE \
--enable-module=so
# make ; make certificate ;make install
(make certificate실행시 SSL에 대한 인증정보를 입력하게 된다.)
# mkdir /usr/local/Zend
# mkdir /usr/local/Zend/lib
# ln -s /usr/local/lib/php.ini /usr/local/apache/conf/pnp.ini
# cd ../ZendOptimizer-0.99-php4.0.2-Linux-glibc2.1/
# cp ZendOptimizer.so /usr/local/Zend/lib
# cd ..
# cp JSDK2.0/ /usr/local/ -R
# cp jdk1.3/ /usr/local/jdk1.3 -R
# vi /etc/profile.d/java-init.sh
#!/bin/sh
export PATH=$PATH:$HOME/bin:/usr/local/JSDK2.0/bin:/usr/local/jdk1.3/bin
# cd ApacheJServ-1.1.2
# ./configure --with-apxs=/usr/local/apache/bin/apxs \
--prefix=/usr/local/jserv \
--with-jdk-home=/usr/local/jdk1.3 \
--with-JSDK=/usr/local/JSDK2.0 \
--disable-debugging
# make ; make install
# vi /usr/local/apache/conf/httpd.conf
Include /usr/local/apache/conf/jserv/jserv.conf
# pwd
/usr/local/apache/bin
# vi apachectl
export ORACLE_HOME=/oracle/oracle8i/8.1.6
export ORACLE_SID=ORCL
export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
export TNS_ADMIN=$ORACLE_HOME/network/admin
# vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .inc
AddType application/x-httpd-php .ph
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
AddType application/x-httpd-php-source .phps
# /usr/local/apache/bin/apachectl startssl
-=-=-=-=-=-=-=
https:///servlet/Hello
Example Apache JServ Servlet
Congratulations, ApacheJServ 1.1.2 is working!
-=-=-=-=-=-=
(id : php, password : oracle)
# su - oracle
$ svrmgrl system/manager
Oracle Server Manager Release 3.1.6.0.0 - Production
Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.
Oracle8i Release 8.1.6.1.0 - Production
JServer Release 8.1.6.0.0 - Production
SVRMGR> connect internal;
Connected.
SVRMGR> create user php identified by oracle;
Statement processed.
SVRMGR> grant resource, connect to php;
Statement processed.
SVRMGR> alter user php default tablespace users;
Statement processed.
SVRMGR> alter user php temporary tablespace temp;
Statement processed.
SVRMGR> exit
Server Manager complete.
$ cat ociserver.php
$conn = OCILogon("php","oracle");
print "Server Version: ".OCIServerVersion($conn);
OCILogOff($conn);
?>
-=-=-=-=-=-=-= <웹브라우져에서 설치한 url로 확인> =-=-=-=-=-=-=-
Server Version: Oracle8i Release 8.1.6.1.0 - Production JServer Release 8.1.6.0.0 - Production
-=-=-=-=-=-=-=
==============================================================================================
# cat oracle
#! /bin/sh
# Oracle Start/Stop the Oracle ServerManager & Listener
#
# chkconfig: 2345 75 15
# description: Oracle 8.1.6.1 is an Enterprise Database System
# processname: oracle
# pidfile: /var/run/oracle.pid
# 2000-08-07, by mlrd (hshan2@cs.kookmin.ac.kr)
# Source function library.
. /etc/rc.d/init.d/functions
# Oracle Location (According to your configuration, modify it)
ORACLE_HOME=/oracle/oracle8i/8.1.6
# See how we were called.
case "$1" in
start)
# Start Oracle ServerManager
echo -n "Staring Oracle: "
su - oracle -c "$ORACLE_HOME/bin/svrmgrl <
connect internal
startup
EOF"
# Start Oracle Listener
su - oracle -c "$ORACLE_HOME/bin/lsnrctl start"
# Record PIDs
pidof -x oracle > /var/run/oracle.pid
pidof tnslsnr > /var/run/tnslsnr.pid
echo
touch /var/lock/subsys/oracle
touch /var/lock/subsys/tnslsnr
;;
stop)
echo -n "Shutting down Oracle: "
su - oracle -c "$ORACLE_HOME/bin/svrmgrl <
connect internal
shutdown
EOF"
su - oracle -c "$ORACLE_HOME/bin/lsnrctl stop"
echo
rm -f /var/lock/subsys/oracle
rm -f /var/lock/subsys/tnslsnr
rm -f /var/run/oracle.pid
rm -f /var/run/tnslsnr.pid
;;
status)
status oracle
status tnslsnr
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
===============================================================================================
-=-=-=-=-=-=-= <script 사용법> =-=-=-=-=-=-=-
# /etc/rc.d/init.d/oracle start ; 시작
# /etc/rc.d/init.d/oracle stop ; 중지
# /etc/rc.d/init.d/oracle restart ; 재시작
# /etc/rc.d/init.d/oracle status ; 실행상태 보기
===============================================================================================
*** c언어 + mysql연동
===> 선행작업 : mysql db에 user만들고 또한db 만들고,그리고 임의의 table에 test할 data 예제
column넣고 컴파일 하세요.
===== 소스 ====================================================================================
# cat test_capi.c
/* test_capi.c */
#include
#include "mysql.h"
#define def_host_name NULL /* host to connect to */
#define def_user_name NULL /* user name */
#define def_password NULL /* password */
#define def_db_name NULL /* database to use */
MYSQL *conn;
int main (int argc, char *argv[])
{
MYSQL_RES *res_set;
MYSQL_ROW row;
char *strSql = (char *) malloc(1000);
unsigned int i;
printf("Content-type: text/html%c%c",10,10); /* CGI Header */
conn = mysql_init(NULL);
mysql_real_connect(
conn, /* pointer to connection handler */
"", /* host to connect to */
"", /* user name */
"", /* password */
"", /* database to use */
0, /* port (use default) */
NULL, /* flags (none) */
0);
strcpy(strSql, "select * from test_member");
if (mysql_query(conn, strSql)) /* Execute the query */
{
printf("Something is wrong!\n");
exit(1);
}
else
res_set = mysql_use_result(conn);
while ((row = mysql_fetch_row(res_set)) != NULL)
{
for (i = 0; i < mysql_num_fields(res_set); i++)
{
printf("column %u: value is %s
", i, (row == NULL ? "NULL" : row));
}
}
mysql_close(conn);
exit(0);
}
================================================================================================
소스 설명은 안해도 대충 보시면 아시겠죠..!!
-=-=-=-=-= 위소스 컴파일 하기 =-=-=-=-=-=-
# gcc -c -I/usr/local/mysql/include/mysql test_capi.c
# gcc -o test_capi test_capi.o -L/usr/local/mysql/lib/mysql -lmysqlclient
# ./test_capi
Content-type: text/html
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
날짜: 01-06-2004 11:00 PM
날짜: 01-06-2004 11:00 PM
혹시.. hpux 용.. php가..
허걱... 대형사고가 일어나버렸습니다.
분명.. /opt/hpws/apache/bin/에.. apachectl 파일이 디렉토리에 있는데두.. stop도 start도 안되구요..
에러가 있다고 나와서 수정하려고 해도 열리지도 않습니다. ㅡㅡ;;
실행한 과정은 이렇거든요..
-----------------------------------------
: 18679 Abort(coredump)
: 18697 Abort(coredump)
[root=ib5:/opt/hpws/apache/bin> vi apachectl
"/fsoracle/app/oracle/product/tmp" No such file or directory
---------------------------------------------
휴... 정말이지 이거야 원.. ㅡㅡ;;;
분명.. /opt/hpws/apache/bin/에.. apachectl 파일이 디렉토리에 있는데두.. stop도 start도 안되구요..
에러가 있다고 나와서 수정하려고 해도 열리지도 않습니다. ㅡㅡ;;
실행한 과정은 이렇거든요..
-----------------------------------------
: 18679 Abort(coredump)
: 18697 Abort(coredump)
[root=ib5:/opt/hpws/apache/bin> vi apachectl
"/fsoracle/app/oracle/product/tmp" No such file or directory
---------------------------------------------
휴... 정말이지 이거야 원.. ㅡㅡ;;;
위에 명시된 의견은 Hewlett Packard Enterprise가 아닌 저자의 개인 의견입니다. 이 사이트를 사용하면 이용 약관에 동의하게되며 참여 규칙 .
회사
주요 내용 알아보기
뉴스 및 이벤트
© Copyright 2025 Hewlett Packard Enterprise Development LP