code-test

2013年5月2日 星期四

FreeBSD 安裝 phpmyadmin

 

安裝完FAMP後 接下來使用網頁管理 mysql 的部分 所以通常我的都是使用 phpmyadmin來做管理

 

# cd /usr/ports/databases/phpmyadmin/

# vmake install clean

 

****************************************************************************

===> Adjusting file ownership in /usr/local/www/phpMyAdmin

phpMyAdmin-suphp-3.5.3 has been installed into:

    /usr/local/www/phpMyAdmin

Please edit config.inc.php to suit your needs.

To make phpMyAdmin available through your web site, I suggest
that you add something like the following to httpd.conf:

    Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"

    <Directory "/usr/local/www/phpMyAdmin/">
        Options none
        AllowOverride Limit

        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1 192.168.0.0/16 .example.com
    </Directory>

****************************************************************************

修改apache 設定檔

# vi /usr/local/etc/apache22/httpd.conf

Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"

<Directory "/usr/local/www/phpMyAdmin/">
Options none
AllowOverride Limit

Order Deny,Allow
Deny from all
Allow from 127.0.0.1 192.168.0.0/16 .example.com
</Directory>

重新啟動 apache22

/usr/local/etc/rc.d/apache22 restart

連接你的主機

http://your.ip.address/phpmyadmin

打開網頁 就可以看到管理程式頁面

[雜記]更新

 

這個部落格擱置很久了 希望現在開始可以持續更新

Vyatta router 設定 DNS

 

利用 vyatta router 做簡單的DNS 設定


建立 record
set system static-host-mapping host-name mail.internal.lan
set system static-host-mapping host-name mail.internal.lan inet 192.168.1.250

刪除 record
delete system static-host-mapping host-name mail.internal.lan
delete system static-host-mapping host-name mail.internal.lan inet 192.168.1.250

這樣就可以解析出 mail.internal.lan 這個名稱

【FreeBSD9.1】用 Ports 安裝 Apache + PHP + MySQL

===================================
1. 安裝 MySQL
===================================
# cd /usr/ports/databases/mysql55-server
# make install clean
安裝好之後
複製 MySQL 的系統設定檔到 /etc 下
# cp /usr/local/share/mysql/my-midden.cnf /etc/my.cnf
設定 MySQL 資料庫權限,並且啟動它
# chown -R mysql:mysql /var/db/mysql
# echo “mysql_enable=yes” >> /etc/rc.conf
# /usr/local/etc/rc.d/mysql-server start

設定 MySQL Root 的密碼
# mysqladmin -u root password 新密碼

最後我們可以測試登入一下 MySQL,有出現以下畫面就 OK
# mysql -u root -p
Enter password: (請輸入密碼)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.60-log FreeBSD port: mysql-server-5.1.60
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Mysql 安裝完成

===================================
2. 安裝 Apache
===================================
# cd /usr/ports/www/apache22
# make install clean
===================================
3. 安裝 PHP
===================================
# cd /usr/ports/lang/php5
# make config install clean
記得要勾選此選項喔,不然 Apache 會不認得 PHP
APACHE     Build Apache module
再安裝 PHP Extensions
# cd /usr/ports/lang/php5-extensions
# make config install clean
建議加勾選 GD、MYSQL、MySQLI、MBSTRING、ZIP 和 ZLIB
===================================
4. 修改設定檔
===================================
首先設定 PHP 的設定檔,以後就是設定 php.ini 這檔
# cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
修改 Apache 的設定
# vi /usr/local/etc/apache22/httpd.conf
在最上面加入
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
找到
DirectoryIndex index.html
把它變成
DirectoryIndex index.php index.html index.htm
設定一開機啟動 Apache & MySQL
# vi /etc/rc.conf
加入這三行
apache22_enable="YES"
apache22_http_accept_enable="YES"
mysql_enable="YES"
在 /usr/local/www/apache22/data 裡新增一個檔案叫 index.php,內容如下
<?php phpinfo(); ?>
重開機,大功告成!

Freebsd91-安裝 mysql+apache+php+phpmyadmin

2013年3月31日 星期日

Oracle 11G 安裝在RedHat 6


安裝 oracle

安裝所需套件

# yum list


yum install binutils glibc compat-libstdc++-33 glibc-common \
glibc-devel glibc-headers elfutils-libelf elfutils-libelf-devel \
elfutils gcc gcc-c++ ksh libaio libaio-devel libgcc libstdc++-devel \
make numactl-devel sysstat mksh

增加群組

############## Add Groups and User#############

groupadd -g 502 oinstall
groupadd -g 503 dba
groupadd -g 504 oper
groupadd -g 505 asmadmin
useradd -u 502 -g oinstall -G dba,asmadmin,oper oracle
passwd oracle

############## End Add Groups and User#############


建立目標目錄及相對應的權限
###############Make Target Directories ############

mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

###############End Make Target Directories ############

################Parameters Configuration SetUp

######## vi /etc/sysctl.conf

編輯 /etc/sysctl.config 增加下面參數

#### Oracle 11g Kernel Parameters ####
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

#### end Oracle 11g Kernel Parameters ####

取消 下面幾項 在前面加#字號就可以了

#########Comment out these lines below that Gives an Error #########

#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0

######vi /etc/security/limits.conf file.

編輯oracle 安全性權限

#### oracle User Settings 4 Oracle 11g ####
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240

#######Disable SELINUX
#######vi /etc/selinux/config
#######Disable Secure Linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows.
SELINUX=disabled
########Load the New Kernel Parameters.
/sbin/sysctl -p
########Add Environment Variables to oracle's .bAashrc

###Login as oracle User
su oracle

####Edit .bashrc file

vi /home/oracle/.bashrc

############## For Oracle Settings ###################
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=HOSTNAME; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID

PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
export LD_BIND_NOW=1

############## End For Oracle Settings ###################

讓 .bashrc 設定生效  (其實還是建議重新開機比較保險)

source ~/.bashrc

編輯  .bash_profile 檔案 (跟上面檔案不同,兩個不同的檔案)
####### edit oracle user .bash_profile ############

# vi ~/.bash_profile

if [ -f ~/.bashrc ]; then
        source ~/.bashrc
fi
####### Edn edit oracle user .bash_profile ############

設定完上面的相關設定後 就可以安裝 oracle 11G

cd /tmp/database
./runInstaller