![]() |
||
*停權中*
加入日期: Jan 2011
文章: 29
|
[分享]Solaris 10 安裝 & mysql+php+phpmyadmin
下載 VMware Workstation 並安裝 Solaris OS x86 版本
VMware Workstation Download http://downloads.vmware.com/d/info/...workstation/7_0 Solaris OS x86 Download http://download.oracle.com/otn/sola...x86-dvd-iso.zip http://www.oracle.com/technetwork/s...oads/index.html VMware 設定 Flie(檔案) -> New(新建) -> Virtual Machine(虛擬機) Virtual Machine Wizard 選擇 Custom 按 Next(下一步) Choose the Virtual Machine Hardware Compatibility 選擇 Workstation 6.5-7.x 按 Next(下一步) Guest Operating System Iastallation Install from 有三個選項 1.Install disc(光碟安裝) 設定光碟機 2.Install disc image file(iso)(選擇ISO映像檔) 3.I will install the operating system later(後面設定) 三個選項自選 個人選擇 ISO 項目 Select a Guest Operating System 選擇 Sun Solaris 版本選擇 Solaris 10 按 Next(下一步) Name the Virtual Machine Location(安裝位置) 這個自訂 按 Next(下一步) Processors Confinguration Number of processors(處理器數量)看你幾個CPU Number of cores per processors(處理器核心數量)看你的CPU幾核心 按 Next(下一步) Memory for the Virtual Machine Memory for this Virtual Machine(給虛擬機多少記憶體) 按預設的設定值即可 按 Next(下一步) Network Type 選擇 Use networkaddress translation(NAT) 按 Next(下一步) Select I/O Controller Types 使用預設值 LSI Logic 即可 按 Next(下一步) Select a Disk 選擇 Create a new Virtual disk (建立一個新的虛擬機磁碟) 按 Next(下一步) Select a Disk Type 使用預設值 IDE 即可 按 Next(下一步) Specify Disk Capacity Maximum disk size(磁碟最大大小) 最少設定 10 GB 個人自訂 12 GB 按 Next(下一步) Specify Disk File 指定虛擬機磁碟檔案 Solaris 10.vmdk 存放處 可自訂 按 Next(下一步) 然後按Finish(完成) Solaris 10 x86 64bit 詳細教學 http://solaris.tophk.net/basicse ... solaris10/index.htm http://linux.vbird.org/solaris/0110...l.php#login_1st 設定光碟開機 ----------------------------------------------------- Solaris Solaris Serial Console ttya Solaris Serial Console ttyb (for lx50, v60x and v65x) ----------------------------------------------------- 選擇 Solaris 按 Enter ----------------------------------------------------- Select the type of installation you want to perform: 1 Solaris Interactive 2 Custom JumpStart 3 Solaris Interactive Text (Desktop session) 4 Solaris Interactive Text (Console session) 5 Apply driver updates 6 Single user shell ----------------------------------------------------- 按 1 Keyboard Layout 上下鍵選擇你的鍵盤 按X選取 然後按F2繼續 等待文字訊息 然後按 Enter 進入圖形介面... 進入圖形介面 再按 Enter 進入語言選擇 選擇語言 1-10 按 Enter 1.網路連接性 選擇 連接網路 2.DHCP 選擇 是 (為省略安裝後設定麻煩 這裡選是) 3.啟動IPv6 選擇 否 4.啟用 Kerberors 選擇 否 5.名稱服務 選擇 無 6.NFSv4 網域名稱 選擇使用由系統衍生的 NFSv4 網域 7.時區址定方式 選擇地理的洲/國家/地區 亞洲 ->台灣 8.Root 使用者密碼 自訂密碼 9.Oracle Solaris 自動註冊 自訂 10.確認資訊 按確認 安裝選項 1.軟體安裝後重啟 / 自動退出CD/DVD 都選 是 2.指定媒體 選CD/DVD 3.授權 選接受 4.安裝類型 選預設安裝 安裝完成後退出光碟 避免重複安裝. |
|||||||
![]() |
![]() |
*停權中*
加入日期: Jan 2011
文章: 29
|
系統更新
下列指令 # ..... 代表以終端機輸入指令 輸入終端機指令只需輸入 # 後面的文字 * 設定路徑環境變數 將系統shell更改為bash # which bash # usermod -s /usr/bin/bash root 建立系統 .profile文件 # cp /etc/skel/local.profile /.profile 修改 /.profile 內容 ------------------------------------------------------------------ PATH=/opt/csw/bin:/usr/sfw/bin:/usr/sbin:/usr/bin:/usr/openwin/bin:/usr/dt/bin:/usr/ccs/bin:/etc:. export PS1='\u:\w#' export PATH ------------------------------------------------------------------ 重新開機後 開啟終端機變為 root:/# 如不想一開機就使用Bash 也可以手動輸入 執行wget需要設定變數 # bash # PATH=/opt/csw/bin:/usr/sfw/bin:/usr/sbin:/usr/bin:/usr/openwin/bin:/usr/dt/bin:/usr/ccs/bin:$PATH # export PS1='\u:\w#' # echo $PATH * 安裝 pkgutil # mkdir /Downloads # cd /Downloads # wget http://blastwave.network.com/csw/pkgutil_i386.pkg # pkgadd -d pkgutil_i386.pkg all * 更新 GNU Autoconf 檢查版本是否 2.59 或以上 # which autoconf && autoconf --version | head -2 如不是更新 # pkgutil -i autoconf * 更新 GNU automake 檢查版本是否 1.8.3 或以上 # # which automake && automake --version | head -2 如不是更新 # pkgutil -i automake * 更新 GNU sed 檢查版本是否 4.1.4 或以上 which gsed && gsed --version | head -2 如不是更新 # pkgutil -i gsed * 更新 GNU gcc 檢查版本是否 3.4.6 或以上 # which gcc && gcc --version | head -2 如不是更新 # pkgutil -i gcc * 更新 GNU Make 檢查版本是否 3.80 或以上 # which gmake && gmake --version | head -2 如不是更新 # pkgutil -i gmake * 更新 flex 檢查版本是否 2.5.4 或以上 # which flex && flex --version | head -2 如不是更新 # pkgutil -i flex * 更新 GNU Bison 檢查版本是否 1.875 或以上 # which bison && bison --version | head -2 如不是更新 # pkgutil -i bison * 更新 GNU M4 檢查版本是否 1.4.3 或以上 # which gm4 && gm4 --version | head -2 如不是更新 # pkgutil -i gm4 * 更新 Perl 檢查版本是否 5.8 或以上 # which perl && perl -v | head -2 如不是更新 # pkgutil -i perl * 更新 GNU zip 檢查版本是否 1.3.3 或以上 # which gunzip && gunzip -V | head -2 如不是更新 # pkgutil -i gunzip * 更新 GNU tar 檢查版本是否 1.14 或以上 # which gtar && gtar --version | head -2 如不是更新 # pkgutil -i gtar 系統更新的程式 autoconf-2.67 berkeleydb-44.44.20 common-1.8.0 expat-2.0.1 gawk-3.1.8 gdbm-1.8.3 ggettext-0.17 gm4-1.4 isaexec-11.11 libconv-1.13.1 libsigsegv-2.8 ncurses-5.7 perl-5.8.8 stl4-12.0 automake-1.11.1 gsed-4.2.1 gmake-3.82 flex-2.5.35 bison-2.4.3 安裝路徑在 opt/csw |
||
![]() |
![]() |
*停權中*
加入日期: Jan 2011
文章: 29
|
Lib Install
* 安裝必要 Lib # cd /Downloads # wget ftp://ftp.sunfreeware.com/pub/freew...10-x86-local.gz # wget ftp://ftp.sunfreeware.com/pub/freew...10-x86-local.gz # wget ftp://ftp.sunfreeware.com/pub/freew...10-x86-local.gz # gunzip *.gz # pkgadd -d openssl-1.0.0d-sol10-x86-local # pkgadd -d gcc-3.4.6-sol10-x86-local # pkgadd -d gd-2.0.35-sol10-x86-local # ln -s /opt/csw/lib/libncurses.so.5 /usr/local/lib/libncurses.so.5 # ln -s /opt/csw/lib/libiconv.so.2.5.0 /usr/lib/libiconv.so.2 * 安裝 libxml2 # mkdir /usr/slocal # wget ftp://ftp.sunfreeware.com/pub/freew...l2-2.7.8.tar.gz # gunzip -cd libxml2-2.7.8.tar.gz | gtar xvpf - # cd libxml2-2.7.8 # ./configure --prefix=/usr/slocal # gmake # gmake install |
![]() |
![]() |
*停權中*
加入日期: Jan 2011
文章: 29
|
MySql Install
* 移除內建 mysql 4.x # pkginfo | grep -i mysql # pkgrm SUNWmysqlr # pkgrm SUNWmysqlt # pkgrm SUNWmysqlu * 以原始碼編譯安裝 # cd /Downloads # wget ftp://ftp.sunfreeware.com/pub/freew...l-5.0.67.tar.gz # gunzip -cd mysql-5.0.67.tar.gz | gtar xvpf - # cd mysql-5.0.67 # CC=gcc CFLAGS="-O3 -fomit-frame-pointer -DHAVE_CURSES_H" \ > CXX=gcc \ > CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors \ > -fno-exceptions -fno-rtti -DHAVE_CURSES_H" \ > ./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/usr/local/mysql/data --enable-assembler --with-mysqld-ldflags=-all-static --with-charset=utf8 --with-extra-charsets=all # gmake # gmake install * 以套裝程式安裝 # cd /Downloads # wget ftp://ftp.sunfreeware.com/pub/freew...10-x86-local.gz # gunzip mysql-5.0.67-sol10-x86-local.gz # pkgadd -d mysql-5.0.67-sol10-x86-local 複製 hostname 文件 # ln -s /usr/bin/hostname /usr/local/bin/hostname * 配置檔設定 # cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf 修改/etc/my.cnf內容 [mysqld]下面加入 basedir=/usr/local/mysql datadir=/usr/local/mysql/data * 設置權限 # mkdir /usr/local/mysql/data # groupadd mysql # useradd -g mysql mysql # chgrp -R mysql /usr/local/mysql # chown -R root /usr/local/mysql # chown -R mysql /usr/local/mysql/data # chmod -R 770 /usr/local/mysql * 設定 Solaris Server 在啟動和關機時 自動運行和停止MySQL Server # ln /usr/local/mysql/share/mysql/mysql.server /etc/rc3.d/S99mysql # ln /usr/local/mysql/share/mysql/mysql.server /etc/rc0.d/K00mysql # ln /usr/local/mysql/share/mysql/mysql.server /etc/rc1.d/K00mysql # ln /usr/local/mysql/share/mysql/mysql.server /etc/rc2.d/K00mysql # ln /usr/local/mysql/share/mysql/mysql.server /etc/rcS.d/K00mysql * 初始化資料庫 # /usr/local/mysql/bin/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql * 啟動 MySQL # /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --user=mysql & 如無法啟動Mysql 重新啟動系統 再直接進行下一步設定密碼 因為開機時會自動啟動 * 設定 root/mysql 密碼 初次安裝必須設定 # /usr/local/mysql/bin/mysqladmin -u root password 'root使用者密碼' # /usr/local/mysql/bin/mysqladmin -u root -h `hostname` password 'MySql登入密碼' * 測試 MySQL Server # /usr/local/mysql/bin/mysqlshow -p Enter password: 輸入MySQL密碼 * 連接 MySQL # /usr/local/mysql/bin/mysql -u root -p Enter password: 輸入MySQL密碼 顯示資料庫 mysql> show databases; 退出 mysql> quit; [起動] # /usr/local/mysql/bin/mysqld_safe --user=mysql & [停止] # /usr/local/mysql/bin/mysqld_safe shutdown * 原始碼編譯安裝參數 代碼:
./configure --prefix=/usr/local/mysql \ 指定安裝目錄 --sysconfdir=/etc \ 配置文件的路徑 --localstatedir=/usr/local/mysql/data \ 資料庫存放路徑 --enable-assembler \ 使用一些字元函數的組合語言版本 --with-mysqld-ldflags=-all-static \ 以純靜態方式編譯服務端 --with-charset=utf8 \ 添加utf8字元支援 --with-extra-charsets=all |
![]() |
![]() |
*停權中*
加入日期: Jan 2011
文章: 29
|
Apache Setting
* 複製配置檔 # cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf 編輯 /etc/apache2/httpd.conf ServerName 127.0.0.1 ServerAdmin [email protected] 啟動 Apache # svcadm enable apache2 測試 # svcs | grep -i apache2 online 訊息代表連線成功 基本網頁文件位置為 /var/apache2/htdocs |
![]() |
![]() |
*停權中*
加入日期: Jan 2011
文章: 29
|
PHP Install
網路上很多Solaris 安裝PHP的教學 都是5.1.x版本的而且是以原始碼編譯安裝 gmake 很慢 而且幾乎找不到以pkgadd安裝的教學 因為後續要設定權限 其實下載套裝軟體安裝比較方便而且快 PHP 5.2.x 的版本才能支援 phpMyAdmin 3.x.x 的版本 * 以原始碼編譯安裝 # cd /Downloads # wget http://downloads.php.net/ilia/php-5.2.1.tar.gz # gunzip -cd php-5.2.1.tar.gz | gtar xvpf - # cd php-5.2.1 # ./configure --prefix=/usr/local/php --with-apxs2=/usr/apache2/bin/apxs --with-mysql=/usr/local/mysql --enable-dbase --with-libxml-dir=/usr/slocal --with-config-file-path=/usr/local/php/lib --with-gd-dir=/usr/local/bin --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib --enable-mbstring # gmake # gmake install * 複製配置檔 # cp php.ini-dist /usr/local/php/lib/php.ini * 以套裝程式安裝 # cd /Downloads # wget ftp://ftp.sunfreeware.com/pub/freew...10-x86-local.gz # gunzip gd-2.0.35-sol10-x86-local.gz # pkgadd -d gd-2.0.35-sol10-x86-local # ln -s /opt/csw/lib/libiconv.so.2.5.0 /usr/lib/libiconv.so.2 * 複製配置檔 # cp /usr/local/php/doc/php/php.ini-dist /usr/local/php/lib/php.ini * 複製 libphp5.so 到 Apache 模組目錄 # cp /usr/local/apache2/modules/ /usr/apache2/libexec/libphp5.so * 設置權限 # chmod +x /usr/apache2/libexec/libphp5.so # chmod 755 /usr/apache2/libexec/libphp5.so * 編輯 /etc/apache2/httpd.conf 找尋是否有下面這一行 如無則加進去 LoadModule php5_module libexec/libphp5.so 搜尋 DirectoryIndex 加入index.php 最後一行手動加入 AddType application/x-httpd-php .php 完成後重新開機 Apache 與 PHP 都會自動啟動 此文章於 2011-07-18 08:57 PM 被 AN3000 編輯. |
![]() |
![]() |
*停權中*
加入日期: Jan 2011
文章: 29
|
phpMyAdmin Install
* 下載安裝 (版本 3.4.3.1) # cd /var/apache2/htdocs # wget http://ncu.dl.sourceforge.net/proje...anguages.tar.gz # gunzip -cd phpMyAdmin-3.4.3.1-all-languages.tar.gz | gtar xvpf - # mv /var/apache2/htdocs/phpMyAdmin-3.4.3.1-all-languages /var/apache2/htdocs/phpMyAdmin 安裝頁面 http://127.0.0.1/phpMyAdmin/setup/ 安裝好後將 config.inc.php 放到 /var/apache2/htdocs/phpMyAdmin 或者不以安裝頁面安裝 以終端機輸入指令 建立config.inc.php文件 # vi /var/apache2/htdocs/phpMyAdmin/config.inc.php 輸入 i 再將下列內容貼上 <?php $i = 0; /* Server: localhost [1] */ $i++; $cfg['Servers'][$i]['verbose'] = ''; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = ''; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['auth_type'] = 'http'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'mysql密碼'; $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; $cfg['Servers'][$i]['controluser'] = 'root'; $cfg['Servers'][$i]['controlpass'] = 'mysql密碼'; $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; $cfg['Servers'][$i]['relation'] = 'pma_relation'; $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig'; $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; $cfg['Servers'][$i]['history'] = 'pma_history'; $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; $cfg['UploadDir'] = ''; $cfg['SaveDir'] = ''; $cfg['ZipDump'] = false; $cfg['GZipDump'] = false; $cfg['BZipDump'] = false; $cfg['CompressOnFly'] = false; $cfg['blowfish_secret'] = '4d0d7c2344aa59.02217053'; $cfg['DefaultLang'] = 'zh_TW'; $cfg['ServerDefault'] = 1; ?> 然後按鍵盤 Esc 再輸入 :wq 保存退出VI編輯器 phpMyAdmin 的資料表路徑 /var/apache2/htdocs/phpMyAdmin/scripts/create_tables.sql 用 phpMyAdmin 導入即可 此文章於 2011-07-18 08:55 PM 被 AN3000 編輯. |
![]() |
![]() |
*停權中*
加入日期: Jan 2011
文章: 29
|
修正PHP 5.2.1 以套裝程式安裝
# cd /Downloads # wget http://sourceware.mirrors.tds.net/p...10-x86-local.gz # gunzip php-5.2.1-sol10-x86-local.gz # pkgadd -d php-5.2.1-sol10-x86-local # ln -s /opt/csw/lib/libiconv.so.2.5.0 /usr/lib/libiconv.so.2 * 複製配置檔 # cp /usr/local/php/doc/php/php.ini-dist /usr/local/php/lib/php.ini * 複製 libphp5.so 到 Apache 模組目錄 # cp /usr/local/apache2/modules/ /usr/apache2/libexec/libphp5.so * 設置權限 # chmod +x /usr/apache2/libexec/libphp5.so # chmod 755 /usr/apache2/libexec/libphp5.so * 編輯 /etc/apache2/httpd.conf 找尋是否有下面這一行 如無則加進去 LoadModule php5_module libexec/libphp5.so 搜尋 DirectoryIndex 加入index.php 最後一行手動加入 AddType application/x-httpd-php .php 完成後重新開機 Apache 與 PHP 都會自動啟動 |
![]() |
![]() |