Mysql 安裝(免編譯版)
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
or
shell> bin/mysqld_safe --user=mysql &
mysql安裝2(編譯版)
#
編譯和安裝
apr 1.2 (
可以跳過
)
cd apr-
./configure --prefix=/usr/local/apr-httpd/
make
make install
#
編譯和安裝
apr-util 1.2
(可以跳過)
cd ../apr-util
./configure --prefix=/usr/local/apr-util-httpd/ --with-apr=/usr/local/apr-httpd/
make
make install
安裝apache
./configure --prefix=/usr/local/apache --enable-so
make
make install
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr-httpd/ --with-apr-util=/usr/local/apr-util-httpd/ --enable-so --enable-mods-shared='vhost_alias usertrack userdir unique_id suexec ssl speling rewrite mime mem_cache log_config log_forensic logio info include file_cache filter headers env example expires dir disk_cache dumpio dbd autoindex cache cern_meta authz_host authn_dbd authn_anon actions alias asis'
跳過APR的安裝模式
./configure --prefix=/usr/local/apache --enable-so --enable-mods-shared='vhost_alias usertrack userdir unique_id suexec ssl speling rewrite mime mem_cache log_config log_forensic logio info include file_cache filter headers env example expires dir disk_cache dumpio dbd autoindex cache cern_meta authz_host authn_dbd authn_anon actions alias asis'
mod_vhost_alias
提供大批量虛擬主機(jī)的動態(tài)配置支持
mod_usertrack
使用Session跟蹤用戶(會發(fā)送很多Cookie),以記錄用戶的點(diǎn)擊流
mod_userdir
允許用戶從自己的主目錄中提供頁面(使用"/~username")
mod_unique_id
為每個請求生成唯一的標(biāo)識以便跟蹤
mod_suexec
使用與調(diào)用web服務(wù)器的用戶不同的用戶身份來運(yùn)行CGI和SSI程序
mod_ssl
使用安全套接字層(SSL)和傳輸層安全(TLS)協(xié)議實(shí)現(xiàn)高強(qiáng)度加密傳輸
mod_speling
自動糾正URL中的拼寫錯誤
mod_so
允許運(yùn)行時加載DSO模塊
mod_rewrite
一個基于一定規(guī)則的實(shí)時重寫URL請求的引擎
mod_proxy
提供HTTP/1.1的代理/網(wǎng)關(guān)功能支持
mod_mime
根據(jù)文件擴(kuò)展名決定應(yīng)答的行為(處理器/過濾器)和內(nèi)容(MIME類型/語言/字符集/編碼)
mod_mem_cache
基于內(nèi)存的緩沖管理器
mod_log_config
允許記錄日志和定制日志文件格式
mod_log_forensic
實(shí)現(xiàn)"對比日志",即在請求被處理之前和處理完成之后進(jìn)行兩次記錄
mod_logio
對每個請求的輸入/輸出字節(jié)數(shù)以及HTTP頭進(jìn)行日志記錄
mod_info
生成Apache配置情況的Web頁面
mod_include
實(shí)現(xiàn)服務(wù)端包含文檔(SSI)處理
mod_file_cache
提供文件描述符緩存支持,從而提高Apache性能
mod_filter
根據(jù)上下文實(shí)際情況對輸出過濾器進(jìn)行動態(tài)配置
mod_headers
允許通過配置文件控制任意的HTTP請求和應(yīng)答頭信息
mod_env
允許Apache修改或清除傳送到CGI腳本和SSI頁面的環(huán)境變量
mod_example
一個很簡單的Apache模塊API演示模塊
mod_expires
允許通過配置文件控制HTTP的"Expires:"和"Cache-Control:"頭內(nèi)容
mod_dir
指定目錄索引文件以及為目錄提供"尾斜杠"重定向
mod_disk_cache
基于磁盤的緩沖管理器
mod_dumpio
將所有I/O操作轉(zhuǎn)儲到錯誤日志中
mod_dbd
管理SQL數(shù)據(jù)庫連接,為需要數(shù)據(jù)庫功能的模塊提供支持
mod_autoindex
自動對目錄中的內(nèi)容生成列表,類似于"ls"或"dir"命令
mod_cache
基于URI鍵的內(nèi)容動態(tài)緩沖(內(nèi)存或磁盤)
mod_cern_meta
允許Apache使用CERN httpd元文件,從而可以在發(fā)送文件時對頭進(jìn)行修改
mod_authz_host
供基于主機(jī)名、IP地址、請求特征的訪問控制
mod_authn_dbd
使用SQL數(shù)據(jù)庫為認(rèn)證提供支持
mod_authn_anon
提供匿名用戶認(rèn)證支持
mod_actions
基于媒體類型或請求方法,為執(zhí)行CGI腳本而提供
mod_alias
提供從文件系統(tǒng)的不同部分到文檔樹的映射和URL重定向
mod_asis
發(fā)送自己包含HTTP頭內(nèi)容的文件
gd庫及一些支持庫編譯
A 安裝jpeg
mkdir /usr/local/libjpeg
#jpeg目錄
mkdir /usr/local/libjpeg/jpeg6
mkdir /usr/local/libjpeg/jpeg6/bin
mkdir /usr/local/libjpeg/jpeg6/lib
mkdir /usr/local/libjpeg/jpeg6/include
mkdir /usr/local/libjpeg/jpeg6/man
mkdir /usr/local/libjpeg/jpeg6/man/man1
tar xzvf jpegsrc.v6b.tar.gz
./configure --prefix=/usr/local/libjpeg/jpeg6 --enable-shared --enable-static
make
make install
B安裝zlib
tar xzvf zlib-1.2.2 .tar.gz
cd zlib-1.2.2
#不要用--prefix自定義安裝目錄,影響gd的安裝
./configure
make
make install
C 安裝freetype
tar xzvf freetype-2.1.5 .tar.gz
cd freetype-2.1.5
./configure --prefix=/usr/local/freetype
make
make install
D 安裝libpng
tar xzvf libpng-1.2.5 .tar.gz
#不要用--prefix自定義安裝目錄,影響gd的安裝
cd libpng-1.2.5
cp scripts/makefile.std makefile
make test
make install
E安裝GD
tar xzvf gd-2.0.33 .tar.gz
./configure --prefix=/usr/local/include/gd --with-jpeg=/usr/local/libjpeg/jpeg6 --with-png --with-zlib --with-freetype=/usr/local/freetype
make
make install
php 安裝(加載gd庫)
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --with-config-file-path=/usr/local/php/etc --with-gd=/usr/local/include/gd --enable-gd-native-ttf --enable-gd-jis-conv --with-freetype-dir=/usr/local/freetype/ --with-jpeg-dir=/usr/local/libjpeg/jpeg6/ --with-png-dir --with-zlib --enable-xml --enable-mbstring --with-curl=/usr/local/curl --with-php-config=/usr/local/php/bin/php-config
make
make install
cp php.ini-dist /usr/local/php/etc/php.ini
安裝jdk
./jdk-1_5_0_05-linux-i586.bin(運(yùn)行目錄/usr/local)
ln –s jdk-1_5_05 java
安裝Zend
解壓后執(zhí)行進(jìn)入目錄執(zhí)行
./install.sh
一步一步下來,當(dāng)出現(xiàn):
Enter the location of your php.ini file
的提示時,輸入:/usr/local/php/etc
設(shè)當(dāng)前目錄為任意目錄
j2dk 安裝
./jdk-1_5_0_06-linux-i586.bin
mv jdk
cd /usr/local/
ln -s jdk
tomcat 安裝
tar -zxvf apache-tomcat-
cd apache-tomcat-
mv apache-tomcat-
cd /usr/local/
ln -s apache-tomcat-
vi /usr/local/tomcat/bin/catalina.sh
加入以下代碼
JAVA_HOME=/usr/local/java
mo_jk 安裝
tar -zxvf jakarta-tomcat-connectors-
cd jakarta-tomcat-connectors-
cd jk/native/
jk2
./configure --exec-prefix=/usr/local/mo_jk --with-apxs2=/usr/local/apache/bin/apxs --with-java-home=/usr/local/java
jk
./configure --exec-prefix=/usr/local/mo_jk --with-apxs=/usr/local/apache/bin/apxs --with-java-home=/usr/local/java
cp ../conf/workers.properties /usr/local/apache/conf/
編輯workers.properties
vi /usr/local/apache/conf/workers.properties
修改以下兩行
workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/loca/java
整合apache 和mo_jk、tomcat
vi /usr/local/apache/conf/httpd.conf
添加以下代碼
#Load mod_jk
LoadModule jk_module modules/mod_jk.so
# Configure mod_jk
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /application/* ajp13
vi /usr/local/tomcat/conf/server.xml
添加以下代碼//可以省略
在<Host> </Host>之間
<Context path="" docBase="/home/public/www" debug="0"/>
tomcat虛擬主機(jī)配置
<Host appBase="/home/" name="chiran2"> //指定應(yīng)用目錄
<Context path="" docBase="/home/public/www" debug="0"/> //指定網(wǎng)頁運(yùn)行路徑
<Alias>chiran2.unix59.cn4e.com</Alias>
<Alias>www.chiran.net</Alias>
<Alias>chiran.net</Alias>
</Host>
apache設(shè)置動態(tài)虛擬主機(jī)httpd-vhost
UseCanonicalName off
VirtualDocumentRoot /home/%0/www
//整合php
vi /usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php .php .htm .html
AddType application/x-httpd-php-source .phps (這一行可以不添加)
httpd start --英文界面(與/USR/LOCAL/APACHE/BIN/APACHECTL START顯示的界面不同---中文界面)
注解:/etc/init.d/httpd與/USR/LOCAL/APACHE/BIN/APACHECTL 啟動的httpd.conf不同,httpd啟動的是/etc/httpd/conf/httpd.conf,而APACHECTL 啟動的是/USR/LOCAL/APACHE/conf/httpd.conf)
vi /etc/rc.d/rc.local 加一行 /USR/LOCAL/APACHE/BIN/APACHECTL START
注: cannot restore segment prot after reloc: Permission denied
chcon libphp4.so -t shlib_t
注:client denied by server configuration(apache err_log)
vi /usr/local/apache/httpd.conf
<Directory "/home/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
注:can't locate libapr
注:apache 運(yùn)行出錯 類似如下錯誤:
Failed loading /usr/local/Zend/lib/Optimizer-2_6_2/php-4.4.x/ZendOptimizer.so: /usr/local/Zend/lib/Optimizer-2_6_2/php-4.4.x/ZendOptimizer.so: cannot restore segment prot after reloc: Permission denied
權(quán)限不足,設(shè)為755即可
chmod 755 /usr/local/Zend/lib/Optimizer-2_6_2/php-4.4.x/ZendOptimizer.so
注:如果重新安裝MYSQL要重新編譯PHP,否則會出錯。
File `NONEXISTENT/charsets/?.conf` not found (Errcode: 2)
File `/usr/share/mysql/charsets/?.conf` not found (Errcode: 2)
Character set `#33` is not a compiled character set and is not specified in the `/usr/share/mysql/charsets/Index` file
解決方法:
先確認(rèn)phpinfo()裡的mysql版本,假如版本和您和正在run的不一樣就是有問題了,以本站的例子:本站升級到
聯(lián)系客服