程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> 其他數據庫知識 >> MSSQL >> linux下apache、mysql、php裝置設置裝備擺設具體筆記

linux下apache、mysql、php裝置設置裝備擺設具體筆記

編輯:MSSQL

linux下apache、mysql、php裝置設置裝備擺設具體筆記。本站提示廣大學習愛好者:(linux下apache、mysql、php裝置設置裝備擺設具體筆記)文章只能為提供參考,不一定能成為您想要的結果。以下是linux下apache、mysql、php裝置設置裝備擺設具體筆記正文


軟件預備:
mysql-5.0.56.tar.gz
http://dev.mysql.com/get/Downloads/

httpd-2.2.12.tar.gz
http://labs.xiaonei.com/apache-mirror/httpd/

php-5.3.0.tar.gz
http://cn.php.net/get/php-5.3.0.tar.gz/from/this/mirror

1、裝置MYSQL


groupadd mysql                               #添加一個MYSQL組
useradd -g mysql mysql                       #添加一個用戶到MYSQL組中
tar zxvf mysql-5.0.56.tar.gz
cd mysql-5.0.56
cat README | less                            #檢查應用文檔
cat INSTALL-SOURCE | less                    #檢查裝置解釋
./configure --help                           #檢查設置裝備擺設贊助
./configure --prefix=/usr/local/mysql5 --enable-thread-safe-client --with-charset=utf8 
                                             #set:設置裝置目次,客戶端支撐線程,設置字體為utf8
                                             #--enable-thread-safe-client 若不開啟,編譯PHP時會碰到成績
make                                         #編譯
make install                                 #裝置
cp support-files/my-medium.cnf /etc/my.cnf   #拷貝默許設置裝備擺設文件
scripts/mysql_install_db --user=mysql        #初始化:必定是解壓編譯後的目次中才有mysql_install_db文件.
cd /usr/local/mysql                          #進入裝置目次
chown -R root  .                             #給mysql5目次付與root權限.
chown -R mysql var                           #給var目次付與mysql權限
chgrp -R mysql .                             #給mysql5目次付與mysql組權限
bin/mysqld_safe --user=mysql &               #啟動MYSQL辦事.
bin/mysql                                    #進入MYSQL操作
mysql> grant all on *.* to root@'192.168.%' identified by 'password';   #設置root可治理的網段及暗碼
mysql> flush privileges;                                                #刷重生效.
ps: 年夜家可以自行修正my.cnf文件來優化MYSQL

2、裝置APACHE


tar zxvf httpd-2.2.12.tar.gz
cd httpd-2.2.12
vi server/mpm/worker/worker.c                #修正源文件銜接數
#define DEFAULT_SERVER_LIMIT 16              #默許子過程數
#define MAX_SERVER_LIMIT 20000               #最年夜子過程數
#define DEFAULT_THREAD_LIMIT 64              #默許鏈接線程數
#define MAX_THREAD_LIMIT 20000               #最年夜鏈接線程數
####以上設置裝備擺設可依據本身的辦事器設置裝備擺設修正默許值的年夜小.
cat README | less                            #檢查應用文檔
cat INSTALL | less                           #檢查裝置解釋
./configure --help                           #檢查設置裝備擺設贊助
./configure \
--prefix=/usr/local/apache2 \
--enable-module='most'                       #裝一些默許經常使用的
--enable-mods-shared="all"                   #全體同享.
--enable-file-cache                          #文件緩存.
--enable-cache                               #緩存
--enable-disk-cache                          #硬盤緩存
--enable-mem-cache                           #內存緩存
--enable-headers                             #http頭掌握模塊
--enable-expires                             #過時頭掌握模塊
--enable-proxy                               #apache署理模塊
--enable-proxy-balancer                      #apache署理平衡模塊
--enable-ssl                                 #HTTPS
--enable-rewrite                             #rewrite
--enable-so                                  #兼容性
--with-mpm=worker
make                                    #編譯
make install                        #裝置

3、裝置PHP擴大LIB庫


gd-2.0.35.tar.gz
jpegsrc.v7.tar.gz
libpng-1.4.0beta73.tar.gz
libxml2-sources-2.7.3.tar.gz
libxslt-1.1.24.tar.gz
zlib-1.2.3.tar.gz                            #直接./configure && make && make install 便可  默許lib目次裝置都在 /usr/local/lib 下.

4、裝置PHP


tar zxvf php-5.3.0.tar.gz
cd php-5.3.0
cat README | less                            #檢查應用文檔
cat INSTALL | less                           #檢查裝置解釋
./configure --help                           #檢查設置裝備擺設贊助
./configure \
--prefix=/usr/local/php5 \
--with-apxs2=/usr/local/apache2/bin/apxs \   #你的APACHE裝置途徑apxs是一個apache裝置設置裝備擺設時生成的一個小小的perl劇本。它可使象resin這類模塊取得apache一切的設置裝備擺設途徑。
--with-mysql=/usr/local/mysql5 \             #MYSQL裝置途徑
--enable-ftp \                               #開啟FTP模塊
--enable-debug \                             #開啟DEBUG
--enable-mbstring \                          #翻開mbstring
--enable-mbregex \                           #正則
--with-gd=/usr/local \                       #gd庫
--with-png-dir=/usr/local/lib \              #png
--with-zlib-dir=/usr/local/lib \             #zlib
--with-jpeg-dir=/usr/local/lib \             #jpeg
--enable-libxml \
--with-libxml-dir=/usr/local/lib \           #libxml擴大
#--with-xsl=/usr/local/lib \                  #xslt擴大
--enable-pdo \
--with-pdo-sqlite \
--with-pdo-mysql=/usr/local/mysql5/bin/mysql_config \         #pdo
--enable-soap \                              #soap辦事擴大
--enable-sockets \                           #sockets擴大
--with-xmlrpc                                #xmlrpc擴大
--with-config-file-path=/etc                 #設置PHP.INI寄存地位
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql5
--enable-ftp --enable-debug --enable-mbstring --enable-mbregex --with-gd=/usr/local
--with-png-dir=/usr/local/lib --with-zlib-dir=/usr/local/lib --with-jpeg-dir=/usr/local/lib
--enable-libxml --with-libxml-dir=/usr/local/lib --enable-pdo --with-pdo-sqlite
--with-pdo-mysql=/usr/local/mysql5/bin/mysql_config --enable-soap
--enable-sockets --with-xmlrp
make
make install

設置裝備擺設APACHE和PHP、MYSQL啟動
主動啟動MYSQL


cp /usr/local/mysql5/share/mysql/mysql.server /etc/init.d/mysqld
ln -s /etc/init.d/mysqld /etc/rc3.d/Kmysqld
ln -s /etc/init.d/mysqld /etc/rc3.d/Smysqld
service mysqld start
/usr/local/apache2/bin/apachectl start

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved