對這文章發表回應
發表限制: 非會員 可以發表
發表者: 冷日 發表時間: 2004/10/12 16:57:40
冷日在小企鵝上已經混了好一陣子了...
近日開始整理各式文件 , 希望能帶給大家一些幫助...
這次呢 , 就從最簡單也最常見的Apache+Mysql+PHP開始吧!
0.
先決條件是大家要先下載所需安裝的原始檔
MySQL : http://dev.mysql.com/downloads/
PHP : http://www.php.net/downloads.php
APACHE : http://httpd.apache.org/download.cgi
1.
安裝MySQL
>cd /usr/local
將mysql-3.22.32.tar.gz解壓縮
>tar zvxf mysql-3.22.32.tar.gz
進入目錄mysql-3.22.32
>cd /usr/local/mysql-3.22.32
下config指令
>./configure '--prefix=/usr/local/mysql' '--with-charset=big5' '--localstatedir=/var/mysqldb/'
>make && make install
到此若沒error出現,應算安裝完成,但開始所有動作之前,請記得以下動作
>scripts/mysql_install_db
(讓系統產生一些必要的table,若您的系統曾安裝過MySQL則此動作可免)
安裝apache
>cd /usr/local
將apache_1.3.20.tar.gz解壓縮
>tar zvxf apache_1.3.20.tar.gz
進入目錄apache_1.3.12
>cd /usr/local/apache_1.3.20
下config指令
>./configure '--prefix=/usr/local/apache' '--sysconfdir=/etc/httpd/conf' '--htdocsdir=/home/httpd/html' '--iconsdir=/home/httpd/icons' '--cgidir=/home/httpd/cgi-bin' '--activate-module=src/modules/php3/libphp3.a' '--enable-module=all'
>make && make install
安裝php3
>cd /usr/local
將php-3.0.15.tar.gz解壓縮
>tar zvxf php-3.0.15.tar.gz
進入目錄php-3.0.15
>cd /usr/local/php-3.0.15
下config指令
>./configure '--enable-trans-sid' '--enable-sysvsem' '--enable-sysvshm' '--with-ftp' '--with-mysql=/usr/local/mysql' '--with-apache=/usr/local/apache_1.3.20' '--with-config-file-path=/etc/httpd' '--enable-safe-mode' '--with-exec-dir=/usr/bin' '--with-system-regex' '--enable-magic-quotes' '--enable-track-vars' '--with-zlib' '--with-gdbm' '--enable-debugger' '--disable-debug' '--with-db2'
>make && make install
安裝到此請確定/usr/libexec目錄下libphp3.so檔案有存在,且都沒有error出現,安裝到此為止。
此時剩下一些設定部分
修改/etc/httpd/conf/httpd.conf檔,有兩個部分必須修改:
(視Apache版本與Linux版本不同,可能存在不同目錄)
A. DirectoryIndex index.html index.php
(加入index.php3)
B. 在srm.conf中(新版apache也在httpd.conf)
確定含有
AddType application/x-httpd-php3 .php
AddType application/x-httpd-php3-source .phps
(將這兩行的remark拿掉,並確定副檔名為php)
啟動與停止MySQL
在啟動MySQL之前,請先將mysql.server檔的權限做更動。
>/bin/chmod 0700 /usr/local/mysql/share/mysql/mysql.server
若要啟動MySQL
>/usr/local/mysql/share/mysql/mysql.server start
若要停掉MySQL
>/usr/local/mysql/share/mysql/mysql.server shutdown
希望在Linux啟動時自動載入MySQL,要在您的/etc/rc.d/rc.local檔案中加入一行:/usr/local/mysql/share/mysql/mysql.server start
PS : make && make install 表示先作make的動作再做make install的動作,而&&表示make成功後再執行makr install !
近日開始整理各式文件 , 希望能帶給大家一些幫助...
這次呢 , 就從最簡單也最常見的Apache+Mysql+PHP開始吧!
0.
先決條件是大家要先下載所需安裝的原始檔
MySQL : http://dev.mysql.com/downloads/
PHP : http://www.php.net/downloads.php
APACHE : http://httpd.apache.org/download.cgi
1.
安裝MySQL
>cd /usr/local
將mysql-3.22.32.tar.gz解壓縮
>tar zvxf mysql-3.22.32.tar.gz
進入目錄mysql-3.22.32
>cd /usr/local/mysql-3.22.32
下config指令
>./configure '--prefix=/usr/local/mysql' '--with-charset=big5' '--localstatedir=/var/mysqldb/'
>make && make install
到此若沒error出現,應算安裝完成,但開始所有動作之前,請記得以下動作
>scripts/mysql_install_db
(讓系統產生一些必要的table,若您的系統曾安裝過MySQL則此動作可免)
安裝apache
>cd /usr/local
將apache_1.3.20.tar.gz解壓縮
>tar zvxf apache_1.3.20.tar.gz
進入目錄apache_1.3.12
>cd /usr/local/apache_1.3.20
下config指令
>./configure '--prefix=/usr/local/apache' '--sysconfdir=/etc/httpd/conf' '--htdocsdir=/home/httpd/html' '--iconsdir=/home/httpd/icons' '--cgidir=/home/httpd/cgi-bin' '--activate-module=src/modules/php3/libphp3.a' '--enable-module=all'
>make && make install
安裝php3
>cd /usr/local
將php-3.0.15.tar.gz解壓縮
>tar zvxf php-3.0.15.tar.gz
進入目錄php-3.0.15
>cd /usr/local/php-3.0.15
下config指令
>./configure '--enable-trans-sid' '--enable-sysvsem' '--enable-sysvshm' '--with-ftp' '--with-mysql=/usr/local/mysql' '--with-apache=/usr/local/apache_1.3.20' '--with-config-file-path=/etc/httpd' '--enable-safe-mode' '--with-exec-dir=/usr/bin' '--with-system-regex' '--enable-magic-quotes' '--enable-track-vars' '--with-zlib' '--with-gdbm' '--enable-debugger' '--disable-debug' '--with-db2'
>make && make install
安裝到此請確定/usr/libexec目錄下libphp3.so檔案有存在,且都沒有error出現,安裝到此為止。
此時剩下一些設定部分
修改/etc/httpd/conf/httpd.conf檔,有兩個部分必須修改:
(視Apache版本與Linux版本不同,可能存在不同目錄)
A. DirectoryIndex index.html index.php
(加入index.php3)
B. 在srm.conf中(新版apache也在httpd.conf)
確定含有
AddType application/x-httpd-php3 .php
AddType application/x-httpd-php3-source .phps
(將這兩行的remark拿掉,並確定副檔名為php)
啟動與停止MySQL
在啟動MySQL之前,請先將mysql.server檔的權限做更動。
>/bin/chmod 0700 /usr/local/mysql/share/mysql/mysql.server
若要啟動MySQL
>/usr/local/mysql/share/mysql/mysql.server start
若要停掉MySQL
>/usr/local/mysql/share/mysql/mysql.server shutdown
希望在Linux啟動時自動載入MySQL,要在您的/etc/rc.d/rc.local檔案中加入一行:/usr/local/mysql/share/mysql/mysql.server start
PS : make && make install 表示先作make的動作再做make install的動作,而&&表示make成功後再執行makr install !