引用 | 編輯
f1eric
2005-07-23 15:57 |
樓主
▼ |
||
x0
【類型】其他【版本】通 用 安裝MYSQL 如果是Linux用戶,先確定是否已安裝MySQL RPM,如果有,請將它移除: Shell# rpm -qa|grep mysql Shell# rpm -e mysql套件名稱 註:若有資料庫請先將它備份 取回來的軟體通常是壓縮檔,先以root身份將軟體解壓 Shell# cd /root Shell# gunzip < mysql-3.23.36.tar.gz | tar xvf - ( Shell# tar -zxvf mysql-3.23.36.tar.gz) 設定安裝組態 Shell# cd mysql-3.23.36 Shell# ./configure --prefix=/usr/local/mysql -with-charset=big5 (如果有其他設定方面的問題可輸入configure --help顯示設定說明。) 編譯及安裝 Shell# make Shell# make install 建立MySQL初始化Table Shell# scripts/mysql_install_db 說明:建立MySQL Grant Table,第一次安裝MySQL都必須執行這個指令 複製my.cnf (my.cnf為mysql daemon起動設定檔) Shell# cp support-files/my-medium.cnf /etc/my.cnf 建立mysql群組以及使用者,並以mysql的身份起動server Shell# groupadd mysql Shell# useradd mysql -g mysql shell# chown -R root /usr/local/mysql Shell# chown -R mysql /usr/local/mysql/var Shell# chgrp -R mysql /usr/local/mysql Shell# /usr/local/mysql/bin/safe_mysqld --user=mysql & 測試MySQL Server是不是有正常運作 Shell# /usr/local/mysql/bin/mysqladmin version Shell# /usr/local/mysql/bin/mysqladmin variables 8. 開機自動執行MySQL Server :修改 /etc/rc.d/rc.local,加入 /bin/sh -c 'cd /usr/local/mysql ; ./bin/safe_mysqld --user=mysql &' ============================ 安裝APACHE+PHP 安裝延伸軟體(若要PHP能使用GD、Freetype等函式庫,須先它們將編譯或安裝好) 一、GD(原始檔編譯安裝) # tar -zxvf gd.1.3.tar.gz # cd gd.1.3 # make 二、Freetype(用rpm安裝之) # rpm -ivh freetype-2.0.1.CLE.rpm # rpm -ivh freetype-devel-2.0.1.CLE.rpm 注意:若系統已有上述RPM檔,可先將它們移除 如果是Linux用戶,先查看是否有安裝Apache 或PHP RPM,如果有,請將它們移除 Shell# rpm -qa|grep apache Shell# rpm -e apache套件名稱 Shell# rpm -qa|grep php Shell# rpm -e php套件名稱 注意:若系統有正在運作的APACHE SERVER,請先將httpd.conf備份起來 2.先將軟體解壓縮 Shell# cd /root Shell# gunzip < php-4.0.5.tar.gz | tar xvf - Shell# gunzip < apache_1.3.19.tar.gz | tar xvf - 3. 設定apache安裝目錄 Shell# cd apache_1.3.19 Shell# ./configure --prefix=/home/www 4. 設定PHP安裝選項 Shell# cd ../php-4.0.5 Shell# ./configure \ --with-apache=../apache_1.3.19 \ --with-mysql=/usr/local/mysql \ --with-openssl --with-gd=../gd1.3 --with-ttf \ ------------------------------------------------ ◎ 選項--with-apache=../apache_1.3.19表示apache原始目錄 ◎ --with-mysql=/usr/local/mysql表示使用mysql ◎ --with-gd=../gd1.3表示使用gd函式庫(gd1.3為gd安裝目錄) ◎ --with-openssl支援OpenSSL(需有openssl套件) ◎ --with-ttf支援freetype 5. 編譯及安裝PHP Shell# make Shell# make install 6. 編譯Apache Shell# cd ../apache_1.3.19 Shell# ./configure --activate-module=src/modules/php4/libphp4.a Shell# make Shell# make install 7. 複製PHP設定檔 Shell# cp /root/php-4.0.5/php.ini.dist /usr/local/lib/php.ini 8. 修改Apache設定檔httpd.conf,加入或修改下列設定: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps 9. 重新啟動Apache Shell# /home/www/bin/apachectl restart 10. 測試 在WWW的網頁目錄下,寫一測試檔 test.php,內容為 <?php phpinfo() ? > 如可顯示php的環境內容表示 php的安裝成功了 x1
|
引用 | 編輯
lulumi168
2005-07-24 14:43 |
1樓
▲ ▼ |
聽說用Liunx架站比Windows穩...
但很像Linux架站相對的也比Windows難... 畢竟還是用Windows的多.... 希望這個教學對我有用^^" (趕快去灌Linux,來架站嚕 ) x0 |