oracle 11g安裝在centos5.9x64下過程php
1.
先檢查是否安裝開發工具、JAVA、ksh等,及其它以下html
yum search檢查,若沒有安裝,則用mysql
yum groupinstall 開發工具 開發庫 Java開發 linux
yum install pdkshnginx
yum install sysstat
yum install libaio-devel
yum install numactl-devel
yum install unixODBC unixODBC-develsql
#ulimit -S -c unlimitedcentos
2.
vi /etc/sysctl.confbash
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6553560
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
#kernel.shmall = 2097152
#kernel.shmmax = 536870912網絡
3.
vi /etc/pam.d/login
session required pam_limits.so
vi /etc/security/limits.conf
(在該文件的最後添加下面四行)
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536session
4.
groupadd oinstall
groupadd dba
useradd oracle -g oinstall -G dba
passwd oracle
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/11g/db_1
ls -l
chown -R oracle:oinstall /u01
ls -l
chmod 755 -R /u01
5.
su - oracle
vi .bash_profile
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11g/db_1
export ORACLE_SID=jxwpxdb
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
6.
移動ORACLE安裝文件到 /u01/app
mv database /u01/app
chown -R oracle.oinstall database
至此配置完畢,設置靜態IP地址,而後重啓。
7.
運行安裝程序
/u01/app/database/runInstaller
8.
提示進行,會創建庫。等待完成(而後創建網絡偵聽和庫實例 netca dbca)
9.完成後用oracle用戶登陸,執行
sqlplus sys as sysdba
show user;
select * fromt tabs;
---------oracle 11g安裝在centos5.9x64下過程-過程說明--------------------------------
安裝開發工具、JAVA等,及其它
yum install libaio-devel
yum install numactl-devel
yum install sysstat unixODBC unixODBC-devel
ulimit -S -c unlimited
vi /etc/sysctl.conf
fs.suid_dumpable = 1 #容許coredump
fs.aio-max-nr = 1048576 #同時能夠擁有的異步IO請求數目
fs.file-max = 6553560 #系統全部進程一共能夠打開的文件數量
kernel.shmmni = 4096 #系統範圍內共享內存段的最大數量
kernel.sem = 250 32000 100 128 #設置信號量(信號集最大信號數量、信號的最大量、能夠執行的信號操做的數量、信號集最大數量)
net.ipv4.ip_local_port_range = 9000 65500 #設置端口使用範圍
net.core.rmem_default = 262144 #默認的接收窗口大小
net.core.rmem_max = 4194304 #最大的TCP數據接收緩衝
net.core.wmem_default = 262144 #默認的發送窗口大小
net.core.wmem_max = 1048586 #最大的TCP數據發送緩衝
#kernel.shmall = 2097152 #(能夠以默認爲準,設置爲內存的90%,值爲shmmax/4k)所有容許使用的共享內存大小
#kernel.shmmax = 536870912 (能夠以默認爲準,設置爲內存的90%)單個段容許使用的共享內存大小
vi /etc/security/limits.conf
(在該文件的最後添加下面四行)
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@localhost ~]#groupadd oinstall
[root@localhost ~]#groupadd dba
[root@localhost ~]#useradd oracle -g oinstall -G dba
[root@localhost ~]#passwd oracle
[root@localhost ~]# mkdir -p /u01/app/oracle
[root@localhost ~]# mkdir -p /u01/app/oracle/product/11g/db_1
[root@localhost ~]#ls -l
[root@localhost ~]# chown -R oracle:oinstall /u01
[root@localhost ~]#ls -l
[root@localhost ~]# chmod 755 -R /u01
su - oracle
vi .bash_profile
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11g/db_1
export ORACLE_SID=linux-oracle
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
移動ORACLE安裝文件到 /u01/app
mv database /u01/app
chown -R oracle.oinstall database
運行安裝程序
/u01/app/database/runInstaller
提示進行,而後創建網絡偵聽和庫實例
netca
dbca
----------------------------------
LEMP集成環境安裝
wget http://nginx.org/download/nginx-1.5.3.tar.gz
tar zxvf nginx-1.5.3.tar.gz
cd nginx-1.5.3
useradd nginx
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module
make
make install
cd /usr/local/nginx/
chown nginx.nginx logs
vi /usr/local/nginx/conf/nginx.conf
tar zxvf mysql-5.1.70.tar.gz
cd mysql-5.1.70
./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-collation=utf8_general_ci --with-extra-charsets=gbk,gb2312
make;make install
cp support-files/my-medium.cnf.sh /etc/my.cnf
cp support-files/mysql.server.sh /etc/init.d/mysql51d
/etc/init.d/mysql51d start
cat /etc/my.cnf
[client]
port = 3306
socket = /usr/local/mysql/var/mysql51.sock
[mysqld]
datadir = /data/mysql51
port = 3306
socket = /usr/local/mysql/var/mysql51.sock
skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[mysqld_safe]
log-error=/usr/local/mysql/var/mysqlerr.log
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
tar zxvf php-5.3.27.tar.gz
cd php-5.3.27
./configure --prefix=/usr/local/php53 --with-gd --with-zlib --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/php53 --enable-mbstring --enable-fpm
make
make install
cp php.ini-production /usr/local/php53/php.ini
tar zxvf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
cd ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/
cp ZendGuardLoader.so /usr/local/php53/lib/php/
vi /usr/local/php53/ php.ini
;report_zend_debug = 0
zend_extension=/usr/local/php53/lib/php/ZendGuardLoader.so
zend_loader.enable=1
cd /usr/local/php53/etc
cp php-fpm.conf.default php-fpm.conf
vi /usr/local/php53/etc/php-fpm.conf
[global]
pid = run/php-fpm.pid
error_log = log/php-fpm.log
[www]
user = nginx
group = nginx
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 35
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
vi /usr/local/nginx/conf/nginx.conf
location ~ \.php$ {
root phphtml;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi.conf;
}
cat /etc/init.d/nginxfpm
#!/bin/bash
# chkconfig: - 65 55
# description: nginx
# processname: nginx
case $1 in
start)
/usr/local/php53/sbin/php-fpm -c /usr/local/php53/php.ini
/usr/local/nginx/sbin/nginx
;;
stop)
kill -s QUIT $(cat /usr/local/php53/var/run/php-fpm.pid)
kill -s QUIT $(cat /usr/local/nginx/logs/nginx.pid)
;;
*)
echo "You input wrong."
esac
[root@jxwpx phphtml]# cat index.php
<?php
$link=mysql_connect('localhost','dbuser','123123');
if($link) echo "<h1>Success to mysql.</h1>";
else
echo "<h1> No to db</h1>";
mysql_close();
?>
[root@jxwpx phphtml]# cat i.php
<?php
phpinfo();
?>
注:若網頁鏈接不正常。
排錯
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /usr/local/nginx/phphtml/index.php on line 2
Warning: mysql_close(): no MySQL-Link resource supplied in /usr/local/nginx/phphtml/index.php on line 6
通常是因爲沒有/tmp/mysql.sock文件形成的,可連接此文件到此位置解決。
附加:
模塊curl 安裝擴展
在PHP的安裝目錄中進行
cd php-5.3.27/ext/curl/
phpize
./configure --with-curl=/usr/local/curl2 --with-php-config=/usr/local/php53/bin/php-config
make
cp modules/curl.so /usr/local/php53/lib/php/
vi /usr/local/php53/php.ini
extension="/usr/local/php53/lib/php/curl.so"