linux下查看nginx,apache,mysql,php的编译参数

1、nginx编译参数:
#/usr/local/nginx/sbin/nginx -V

2、apache编译参数:
# cat /usr/local/apache/build/config.nice

3、php编译参数:
# /usr/local/php/bin/php -i |grep configure

4、mysql编译参数:
# cat /usr/local/mysql/bin/mysqlbug|grep configure
一、安装Oracle即时客户端程序
打开oracle官方下载页面
http://www.oracle.com/technology/global/cn/software/tech/oci/instantclient/htdocs/linuxsoft.html
下载Oracle即时客户端程序,下载以下4个包(需注册才可以下载)
http://download.oracle.com/otn/linux/instantclient/112010/oracle-instantclient11.2-basic-11.2.0.1.0-1.i386.rpm
http://download.oracle.com/otn/linux/instantclient/112010/oracle-instantclient11.2-jdbc-11.2.0.1.0-1.i386.rpm
http://download.oracle.com/otn/linux/instantclient/112010/oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.i386.rpm
http://download.oracle.com/otn/linux/instantclient/112010/oracle-instantclient11.2-devel-11.2.0.1.0-1.i386.rpm

上传至服务器进行安装。
rpm -ivh *.rpm

二、安装打开php扩展包
打开php官方网页
http://pecl.php.net/package/oci8,比如下载oci8-1.4.1.tgz
wget http://pecl.php.net/get/oci8-1.4.1.tgz
tar zxvf oci8-1.4.1.tgz
cd oci8-1.4.1
比如我的php安装在/web/php
/web/php/bin/phpize
./configure --with-php-config=/web/php/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client/lib
修改php.ini
加上:  extension = "oci8.so"
重启程序.
查看phpinfo.php.
参考:
http://cn.php.net/manual/en/oci8.installation.php

参考:
http://blog.s135.com/post/411/
Tags: , , ,

lighttpd伪静态的配置

[不指定 2010/06/08 07:59 | by xiaoyuwxz ]
伪静态:

一、以下为discuz7.2的伪静态为例
在lighttpd.conf里,查找#### CGI module
在下面加上:

#  $HTTP["host"] =~ "^192.168.0.2$" {
url.rewrite-once = (
"^(.*)/archiver/((fid|tid)-[w-]+.html)$" => "$1/archiver/index.php?$2",
"^(.*)/forum-([0-9]+)-([0-9]+).html$" => "$1/forumdisplay.php?fid=$2&page=$3",
"^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+).html$" => "$1/viewthread.php?tid=$2&extra=page%3D$4&page=$3",
"^(.*)/space-(username|uid)-(.+).html$" => "$1/space.php?$2=$3",
"^(.*)/tag-(.+).html$" => "$1/tag.php?name=$2"
)
#}

重启lighttpd

二、以下为DZX伪静态,不支持子目录

url.rewrite-once = (

"^(.*)/topic-(.+)\.html$" =>

"/portal.php?mod=topic&topic=$2",

"^(.*)/article-([0-9]+)\.html$" =>

"/portal.php?mod=view&aid=$2",

"^(.*)/forum-(\w+)-([0-9]+)\.html$" =>

"/forum.php?mod=forumdisplay&fid=$2&page=$3",

"^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$"  => "/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3",

"^(.*)/group-([0-9]+)-([0-9]+)\.html$" =>

"/forum.php?mod=group&fid=$2&page=$3",

"^(.*)/space-(username|uid)-(.+)\.html$" =>

"/home.php?mod=space&$2=$3",

"^(.*)/([a-z]+)-(.+)\.html$" =>

"/$2.php?rewrite=$3"

)

三、以下为dzx通用目录规则,同时适用于主目录和子目录

url.rewrite-once = (

"^(.*)/topic-(.+)\.html$" =>

"$1/portal.php?mod=topic&topic=$2",

"^(.*)/article-([0-9]+)\.html$" =>

"$1/portal.php?mod=view&aid=$2",

"^(.*)/forum-(\w+)-([0-9]+)\.html$" =>

"$1/forum.php?mod=forumdisplay&fid=$2&page=$3",

"^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$"  =>
"$1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3",

"^(.*)/group-([0-9]+)-([0-9]+)\.html$" =>

"$1/forum.php?mod=group&fid=$2&page=$3",

"^(.*)/space-(username|uid)-(.+)\.html$" =>

"$1/home.php?mod=space&$2=$3",

"^(.*)/([a-z]+)-(.+)\.html$" =>

"$1/$2.php?rewrite=$3"

)

lighttpd虚拟主机的配置

[不指定 2010/06/08 07:58 | by xiaoyuwxz ]
一、常规虚拟主机的配置

1、在lighttpd.conf最后加上如下代码:

$HTTP["host"] == "www.a.com" {
server.name = "www.a.com"
server.document-root = "/home/wwwroot/htdocs/a"
server.errorlog = "/var/log/lighttpd/www.a.com-error.log"
accesslog.filename = "/var/log/lighttpd/www.a.com-access.log"
}


$HTTP["host"] == "www.b.com" {
server.name = "www.b.com"
server.document-root = "/home/wwwroot/htdocs/b"
server.errorlog = "/var/log/lighttpd/www.b.com-error.log"
accesslog.filename = "/var/log/lighttpd/www.b.com-access.log"
}

2、另建lighttpd-vhost.conf,并在lighttpd.conf里调用
在lighttpd.conf最后加上:
include "/etc/lighttpd/lighttpd-vhost.conf"
新建的lighttpd-vhost.conf内容为:

$HTTP["host"] == "www.a.com" {
server.name = "www.a.com"
server.document-root = "/home/wwwroot/htdocs/a"
server.errorlog = "/var/log/lighttpd/www.a.com-error.log"
accesslog.filename = "/var/log/lighttpd/www.a.com-access.log"
}


$HTTP["host"] == "www.b.com" {
server.name = "www.b.com"
server.document-root = "/home/wwwroot/htdocs/b"
server.errorlog = "/var/log/lighttpd/www.b.com-error.log"
accesslog.filename = "/var/log/lighttpd/www.b.com-access.log"
}

我喜欢用这种方法,文件较简洁,虚拟主机配置全部放入单独的lighttpd-vhost.conf文件,这种方法是参考apache虚拟主机而改来的,在nginx下同样适用。

二、简单虚拟主机

简单的虚拟主机需要使用mod_simple_vhost模块.它的特点是简单的就可以绑定域名,但是如果在商业运作当中,这样也是有很大隐患!在这里只需要将这个模块添加到server.modules中,即:

server.modules              = (
...
"mod_simple_vhost",
...
)

一个完整的document root由三个值server-root、hostname、document-root决定
我们可以这样设定:

simple-vhost.server-root         = "/var/www"
simple-vhost.document-root       = "/public_html/"

Sponsored Links
如果按照以上这样设定,那么我们便可以很方便的绑定多个域名到服务器,只需要在/var/www目录添加文件夹,文件夹就输入需要绑定的域名,然后进入文件夹,在里面建立public_html文件夹就可以实现绑定了.那么完整的路径便是

/var/www/www.xmlchina.org/public_html


三、复杂虚拟设置匹配

复杂虚拟设置匹配,在这里同样需要开启模块的支持,即在server.modules中添加mod_evhost即可,方法如上.

复杂虚拟设置匹配,一般可以用作泛域名解析用,它是使用正则进行匹配,如此便可以实现多子域名的绑定.

在lighttpd.conf中便有这一条的解释

# define a pattern for the host url finding
# %% => % sign
# %0 => domain name + tld
# %1 => tld
# %2 => domain name without tld
# %3 => subdomain 1 name
# %4 => subdomain 2 name
#
# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"

那么我们可以按照官方的方法进行设置,下面是我的配置.

$HTTP["host"] =~ "www.xmlchina.org$" {
evhost.path-pattern        = "/var/www/%0/%3"
}

%0 = xmlchina.org
%3 = www
这里文档路径是/var/www/xmlchina.org/www

还可进行二级域名解析,如:

$HTTP["host"] =~ "^(.*).xmlchina.org$" {
evhost.path-pattern        = "/var/www/%0/%3"
}

%0 = xmlchina.org
%3 = 任意第二级域名前缀

复杂虚拟设置匹配可以实现可变目录的绑定,轻松解决多二级域名的解析难题

总结

这里提供的三个方法,各有各的好处.但是就服务器安全角度来说,建议使用第一条.原因嘛!慢慢琢磨啦.

分页: 5/18 第一页 上页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]