欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

Linux下快速搭建Apache/Lighttpd+PHP+MySQL_Linux教程

編輯Tag賺U幣

使用Ubuntu Linux, 編譯過程提示缺啥補啥即可.

Apache:

./configure --prefix=/home/work/httpd --enable-so --enable-rewrite

配置文件:

LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php
# PhpIniDir /home/work/php/php.ini

MYSQL:

 

./configure  --prefix=/home/work/mysql\
 --with-unix-socket-path=/home/work/mysql/tmp/mysql.sock\
 --with-big-tables\
 --with-plugins=innobase

groupadd mysql
useradd  -s /bin/false -g mysql -pmysql mysql
/home/work/mysql/bin/mysql_install_db --user=mysql
cp support-files/my-medium.cnf /home/work/mysql/etc/my.cnf

啟動:

/home/work/mysql/share/mysql/mysql.server start

修改密碼 mysqladmin password ‘xxx’

出錯: Starting MySQL.Manager of pid-file quit without updating fi[FAILED]
解決: 權(quán)限問題, 他媽的MySQL都提示些什么狗屎!

innodb

如果還不支持innodb, 進入mysql命令行執(zhí)行:
install plugin innodb soname ‘ha_innodb.so’;

PHP:

PHP 一定要安裝 APC 模塊, 否則性能會下降不少: http://pecl.php.net/package/APC (編譯PHP模塊的方法)

用Apache

./configure --prefix=/home/work/php --with-config-file-path=/home/work/php\
 --with-mysql=/home/work/mysql\
 --enable-mbstring\
 --with-pdo-mysql=/home/work/mysql\
 --with-apxs2=/home/work/httpd/bin/apxs\
 --with-gettext\
 --enable-soap\
 --with-zlib\
 --with-gd\
 --with-jpeg=/usr/lib

將源碼目錄下的php.ini-dist文件改名為php.ini, 拷貝到/home/work/php目錄下.

用Lighttpd

./configure --prefix=/home/work/litty/php --with-config-file-path=/home/work/litty/php\
 --with-mysql=/home/work/mysql\
 --enable-mbstring\
 --with-pdo-mysql=/home/work/mysql\
 --with-gettext\
 --enable-soap\
 --with-zlib\
 --enable-fastcgi\
 --enable-force-cgi-redirect\
 --with-gd\
 --with-jpeg=/usr/lib

需要安裝libjpeg62_dev

不能同時使用apxs2和fastcgi.

配置Apache虛擬主機

<VirtualHost *:80>
    DocumentRoot "/home/work/htdocs/ideawu.net"
    ServerName ideawu.net
    ServerAlias ideawu.net *.ideawu.net
    ErrorLog "/home/work/logs/ideawu.net-error.log"
    CustomLog "/home/work/logs/ideawu.net-access.log" common

    DirectoryIndex index.php index.html index.htm

    <Directory "/home/work/htdocs/ideawu.net">
        Options FollowSymLinks

        AllowOverride None 

        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

安裝配置Lighttpd(litty)

$HTTP["host"] =~ "(.*\.)?ideawu.net" {
	server.name = "www.ideawu.net"
	server.document-root = "/home/work/htdocs/ideawu.net/"
	server.errorlog = "/home/work/litty/logs/ideawu.net-error.log"
	accesslog.filename = "/home/work/litty/logs/ideawu.net-access.log"
}

fastcgi.server = ( ".php" =>
	(
		(
			"socket" => "/tmp/php-fastcgi.socket",
			"bin-path" => "/home/work/litty/php/bin/php-cgi",
			#"min-procs" => 2, #這個參數(shù)在新版本里已經(jīng)不起作用了.
			"max-prccs" => 16,
			"bin-environment" => (
				"PHP_FCGI_CHILDREN" => "1",
				"PHP_FCGI_MAX_REQUESTS" => "10000"
			),
		)
	)
)

(版本1.4.26), 已經(jīng)集成了spawn-fcgi, 也就是不再單獨生成這個名字的可執(zhí)行文件, min-procs參數(shù)也不再起作用. 啟動的php-cgi進程數(shù)是
max-procs * ( PHP_FCGI_CHILDREN + 1 ), PHP_FCGI_CHILDREN默認=1.

來源:網(wǎng)絡搜集//所屬分類:Linux教程/更新時間:2012-06-21
相關(guān)Linux教程