魅力博客

魅力Linux|魅力空间|魅力博客|学习Linux|ubuntu日记|电脑教程|手机软件

红旗Linux下搭建网站服务器详细方法



在红旗Linux6.0SP1下安装httpd-2.2.8+php-5.2.5+PostgreSQL-8.3.1+drupal-6.2搭建你的超级稳定的开源网站


本人自学Linux有一年多时间了,刚开始只是抱着一面学习LINUX,然后搭建自已的一个小型linux下WEB服务器网站,期间也用过 UBUNTU6.06、UBUNTU6.061、UBUNTU6.10、UBUNTU7.04、UBUNTU7.10、UBUNTU8.04,到过 UBUNTU的http://forum.ubuntu.org.cn感觉那里的学习开源开发的环境真的不错,在这我感谢那里的每一位,但是后来由于生活和工作、学习的种种矛盾,不能去ubuntu的中文论坛学习了,再后来由于红旗这个响亮的名字把我带到了红旗LINUX5.0-Desktop、红旗 LINUX6.0-Desktop、红旗LINUX6.0SP1-Desktop,感觉心态好的就是红旗LINUX*.*-Desktop安装后在没有联网的情况下也能很稳定快速地运行。闲话少说,让我们切入正题:如何在红旗Linux6.0SP1下安装httpd-2.2.8+php-5.2.5+ PostgreSQL-8.3.1+drupal-6.2搭建你的超级稳定的开源网站? 

1.安装红旗Linux6.0SP1

        到红旗主站http://www.redflag-linux.com下载redflag-6-sp1.iso、redflag-6- tool-sp1.iso,只要下载一张vcd的系统盘sys.iso和同版本型号一张vcd的工具盘Tools.iso,用Alcohol 120%把sys.iso,Tools.iso装载镜像文件记录成安装光盘,安装过程和安装其它发行版本的LINUX没有什么不同,这里就不细说了。

2.安装apache2

      到http://httpd.apache.org主页下载httpd-2.2.8.tar.gz(apache2的源文件)

以Apache使用php有两种方式:作为动态模块,其在运行状态时可以载入到web服务器,

或者作为静态模块,其可直接编译到web服务器代码中。对于文本,我们着重于第一种方式。为了能让Apache2.0模块使php动态载入,Apache服务器必须以动态共享对象(DSO,Dynamic Shared Object)编译。

可以通过传递 --enable-so 参数到 Apache 2

tar -jxvf httpd-2.2.8.tar.bz2

cd httpd-2.2.8

./configure --prefix=/usr/local/apache2 --enable-so make && make install

//切记要支持Zend Optimizer不可加 --with-mpm=worker选项

这一过程将会设置,编译,以及将服务器安装到/usr/local/下。

在shell-konsole里启动apache守护进程:

/usr/local/apache2/bin/apachectl start (开启 start 关闭 stop 重启 restart)

打开浏览器,输入http://localhost 就能看到一个apache的欢迎页面了(It works!),这表示我们已经成功的安装了apache2 。


3.编译安装PHP5

      为了让php5能有各种功能更好的支持库要编译安装以下这些软件

# libiconv-1.11.tar.gz

# freetype-2.3.5.tar.gz

# libpng-1.2.20.tar.gz

# libxml2-2.6.30.tar.gz

# jpegsrc.v6b.tar.gz

# libmcrypt-2.5.8.tar.gz

# mcrypt-2.6.6.tar.gz

# mhash-0.9.9.tar.gz


gd-2.0.35.tar.gz

# memcache-2.2.1.tar.gz


(1).下载libiconv-1.11.tar.gz

ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.11.tar.gz

tar zxvf libiconv-1.11.tar.gz

cd libiconv-1.11/

./configure --prefix=/usr/local/libiconv

make

make install

(2).下载freetype-2.3.5.tar.gz

下载地址:http://download.savannah.gnu.org/releases/freetype/

安装 freetype

tar -zxvf freetype-2.2.1.tar.gz

cd freetype-2.2.1

./configure --prefix=/usr/local/freetype2

make

make install

(3).下载libpng-1.2.20.tar.gz

下载地址:http://www.libpng.org/download/

安装:libpng

tar zxvf libpng-1.2.20.tar.gz

cd libpng-1.2.20/

./configure --prefix=/usr/local/libpng

make

make install

(4).下载jpegsrc.v6b.tar.gz

下载地址:ftp://ftp.uu.net/graphics/jpeg

安装:jpeg6

建立目录

mkdir /usr/local/jpeg6

mkdir /usr/local/jpeg6/bin

mkdir /usr/local/jpeg6/lib

mkdir /usr/local/jpeg6/include

mkdir /usr/local/jpeg6/man

mkdir /usr/local/jpeg6/man/man1

tar -zxvf jpegsrc.v6b.tar.gz

cd jpeg-6b

./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-static

make

make install

注意:这里./configure一定要带--enable-shared参数,不然,不会生成共享库

(5).下载:gd-2.0.35.tar.gz

下载地址:http://www.libgd.org/Downloads

安装 gd

tar -zxvf gd-2.0.35.tar.gz

cd gd-2.0.35

./configure --prefix=/usr/local/gd --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local/freetype2 --with-jpeg-dir=/usr/local/jpeg6

make && make install

(6).下载libxml2-2.6.19.tar.gz

下载地址:http://xmlsoft.org/download/

安装 libxml2

tar zxvf libxml2-2.6.30.tar.gz

cd libxml2-2.6.30/

./configure --prefix=/usr/local/libxml2

make

install

(7).下载libmcrypt-2.5.8.tar.gz

下载地址:http://sourceforge.net

安装:

tar zxvf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8/

./configure --prefix=/usr/local/libmcrypt

make

make install

/sbin/ldconfig

cd libltdl/

./configure --enable-ltdl-install

make

make install

(8).下载mhash-0.9.9.tar.gz

下载地址:http://mhash.sourceforge.net

tar zxvf mhash-0.9.9.tar.gz

cd mhash-0.9.9/

./configure --prefix=/usr/local/mhash

make

make install


cp /usr/local/lib/libmcrypt.* /usr/lib

ln -s /usr/local/mhash/libmhash.so.2 /usr/lib/libmhash.so.2

(9).下载:mcrypt-2.6.6.tar.gz

下载地址:http://sourceforge.net

tar zxvf mcrypt-2.6.6.tar.gz

cd mcrypt-2.6.6/

./configure --prefix=/usr/local/mcrypt

make

make install

(10)安装postgresql-8.3.1

下载地址:http://www.postgresql.org/download/.

编译安装:

tar -zxvf postgresql-8.3.1.tar.gz

cd postgresql-8.3.1

./configure ----prefix=/opt/pgsql

make

make install

安装后配置:

A. mkdir /opt/pgsql/log

touch /opt/pgsql/log/pgsql.log

chown -R postgres:postgres /opt/pgsql/data

chown -R postgres:postgres /opt/pgsql/log

chown -R postgres:postgres /opt/pgsql/log/pgsql.log

B. 配置环境

(1)创建用户 postgres

# groupadd postgres

# useradd -g postgres postgres


(2)用户postgres的环境变量

# su - postgres

$ vi .bash_profile


PGDATA=$HOME/data

export PATH=$PATH:/opt/pgsql/bin

PGDATA= /opt/pgsql/data

export PGDATA

export LD_LIBRARYPATH=$LD_LIBRARYPATH: /opt/pgsql/lib

export MANPATH=$MANPATH:=/opt/pgsql/man/man1

bash-3.1$ initdb -D /opt/pgsql/data

我用了pg_ctl -D /opt/pgsql/data -l /opt/pgsql/log/pgsql.log start 能启动postgresql(pg_ctl -D /opt/pgsql/data -l /opt/pgsql/log/pgsql.log stop)停止postgresql

查看命令,然后我们执行进程察看命令查看服务是否已经启动:

ps -A | grep postgres

看到:

2482 pts/1 00:00:01 postgres

2484 ? 00:00:04 postgres

2485 ? 00:00:02 postgres

2486 ? 00:00:01 postgres

2487 ? 00:00:03 postgres

证明成功了

createdb mydb;


(11)下载: php-5.2.5.tar.gz

下载地址:http://www.php.net/download/

安装PHP5:

tar zxvf php-5.2.5.tar.gz

cd php-5.2.5

'./configure' '--prefix=/usr/local/php5' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--with-pgsql' '--with-gd' '--with-jpeg-dir=/usr/local/jpeg6' '--with-zlib' '--with-png-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/freetype2' '--with-iconv' '--enable-mbstring' '--with-gettext' '--enable-sockets' '--enable-force-cgi-redirect' '--enable-ftp' '--with-config-file-path=/etc' '--with-libxml-dir=/usr/local/libxml2'

make

make install

(期间make php时有近10分钟)

cp php.ini-dist /usr/local/php5/etc/php.ini

整合apache2和php5

apache 配置文件及目录是:

/usr/local/apache2/conf/httpd.conf

apache 默认存放主页的位置是:

/usr/local/apache2/htdocs

以下是配置文件里面的信息:(有的地方要做修改)

ServerRoot "/usr/local/apache2"

这是指定apache程序所在的目录,比如日志文件、配置文件等目录。

DocumentRoot "/usr/local/apache2/htdocs"

这个是存放网页的目录


这一句应该和DocumentRoot的目录保持一致。

找到 DirectoryIndex index.html

改为 DirectoryIndex index.html index.html.var index.htm index.php

找到 AddType application/x-gzip .gz .tgz

加 AddType application/x-httpd-php .php (注意空格)

AddType application/x-httpd-php-source .phps

添加 AddDefaultCharset utf8 使apache默认支持utf8字符集

保存配置文件就重启apache 的守护进程。

/usr/local/apache2/bin/apachectl restart


注意: 

每次更改配置文件。要重启服务。

对存放网页的目录执行:命令chmod 755 目录名 或者 chmod -R 755 目录名


编辑php.ini文件,找到

;default_charset="iso-8859-1"

增加一行:default_charset="utf8"


以上步骤都执行完后。在/usr/local/apache2/htdocs/里编辑文件进行测试。

phpinfo.php

里面的内容:

<?php

phpinfo();

?>

在浏览器地址栏中输入:

http://localhost/phpinfo.php

出现php说明页面说明安装成功。

(12)编译安装PHP5扩展模块memcache-2.2.1

下载:memcache-2.2.1.tgz

下载地址:http://www.monkey.org/~provos/libevent/

tar -zxvf memcache-2.2.1.tgz

cd memcache-2.2.1

/usr/local/php5/bin/phpize

./configure --with-php-config=/usr/local/php5/bin/php-config

make

make install


修改php.ini文件

  手工修改:查找/usr/local/php5/etc/php.ini中的extension_dir = "./"

  修改为extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/"

  并在此行后增加以下几行,然后保存:

  extension = "memcache.so"

  extension = "gd.so"

(13)安装phpPgAdmin

下载:phpPgAdmin-4.2.0.tar.gz

下载地址:http://sourceforge.net/projects/phppgadmin/

安装:

tar -zxvf phpPgAdmin-4.2.0.tar.gz

按照金步国教授的翻译注译修改phppgadmin-4.2.0的config.inc.php

<?php


/**

* 这里是 phpPgAdmin 的配置中心。用户需要根据自己的实际情况修改这里的设置。

*

* $Id: config.inc.php-dist,v 1.53 2007/04/18 14:08:48 mr-russ Exp $

*/


// 一个示例服务器。你可以建立任意多个这样的服务器,索引从零开始递增。


// 显示在登陆屏幕上的服务器名字

$conf['servers'][0]['desc'] = 'PostgreSQL';


// 服务器的主机名或IP地址。对于 UNIX domain socket 请使用 '' 。

// 对于本地 TCP/IP 链接请使用 'localhost' 。

$conf['servers'][0]['host'] = '';


// 服务器的数据库链接端口(5432 是 PostgreSQL 的默认端口)

$conf['servers'][0]['port'] = 5432;


// SSL 链接选项: disable(禁止), allow(允许), prefer(首选), require(必须)

$conf['servers'][0]['sslmode'] = 'allow';


// 更改仅在无法连接到 template1 的时候默认链接的数据库。

// 对于 PostgreSQL 8.1 以上版本的服务器,你需要将此处设为 'postgres'

$conf['servers'][0]['defaultdb'] = 'template1';


// 指定数据库转储工具的路径。如果没有转储工具可用,请在将这里设为 '' 。

$conf['servers'][0]['pg_dump_path'] = '/usr/bin/pg_dump';

$conf['servers'][0]['pg_dumpall_path'] = '/usr/bin/pg_dumpall';


// 使用 Slony (www.slony.info) 支持?

$conf['servers'][0]['slony_support'] = false;

// 指定 Slony SQL 脚本的位置(slony1_base.sql 所在目录等等),不要包含结尾斜线

$conf['servers'][0]['slony_sql'] = '/usr/share/pgsql';


// 第二个示例服务器 (PostgreSQL for Windows)

//$conf['servers'][1]['desc'] = 'Test Server';

//$conf['servers'][1]['host'] = '127.0.0.1';

//$conf['servers'][1]['port'] = 5432;

//$conf['servers'][1]['sslmode'] = 'allow';

//$conf['servers'][1]['defaultdb'] = 'template1';

//$conf['servers'][1]['pg_dump_path'] = 'C:\\Program Files\\PostgreSQL\\8.0\\bin\\pg_dump.exe';

//$conf['servers'][1]['pg_dumpall_path'] = 'C:\\Program Files\\PostgreSQL\\8.0\\bin\\pg_dumpall.exe';

//$conf['servers'][1]['slony_support'] = false;

//$conf['servers'][1]['slony_sql'] = 'C:\\Program Files\\PostgreSQL\\8.0\\share';


// 默认语言,比如:'english', 'chinese-sim-utf8', 'chinese-tr' ,参看 lang/ 目录以获取所有可用的语言。

// 如果你设置为 'auto'(默认值),将会根据浏览器的喜好进行选择。

$conf['default_lang'] = 'auto';


// 自动完成使用 ajax 技术在插入字段上交互的列出外键选项。

// 当前它只能在单字段外键上工作。你可以通过下列设置控制其行为:

// 'default on' 默认启用自动完成功能

// 'default off' 允许使用自动完成功能,但默认不启用

// 'disable' 完全禁止此功能

$conf['autocomplete'] = 'default on';


// 是否使用安全登陆?

// 如果此处设为 true ,那么不使用密码登陆,将会被 phpPgAdmin 拒绝。

// 同样,使用(pgsql, postgres, root, administrator)用户之一登陆,也会被拒绝。

// 仅在你明白如何更改 pg_hba.conf 以强制使用密码保护本地链接的情况下,才能将此处设为 false 。

$conf['extra_login_security'] = true;


// 是否仅仅显示登录用户所拥有的数据库?

// 注意:这仅仅是简单的在列表中隐藏其他数据库而已,

// 它并不能阻止用户使用其它方法访问其它数据库(比如运行'SELECT * FROM pg_database')

$conf['owned_only'] = false;


// 是否显示对象的注释?

// 数据库的注释是非常有用的,但是它们确实会占用不少界面空间。

$conf['show_comments'] = true;


// 是否显示"高级"对象?

// 将此设为 true 将显示 types, operators conversions, languages, casts

// 这些对象很少需要管理,并且常常会将界面搞的乱七八糟。

$conf['show_advanced'] = false;


// 是否显示"系统"对象?

$conf['show_system'] = false;


// 是否显示 reports 特性?

// 为了使该特性能正常工作,你必须按照 INSTALL 文件的指导安装 reports 数据库。

$conf['show_reports'] = true;


// 用于 reports 的数据库和表

$conf['reports_db'] = 'phppgadmin';

$conf['reports_schema'] = 'public';

$conf['reports_table'] = 'ppa_reports';


// 是否仅仅显示登陆用户所拥有的 reports ?

// 注意:它并不能阻止用户使用其它方法访问其它 reports 数据库。

$conf['owned_reports_only'] = false;


// 允许用户设置的密码的最小长度

$conf['min_password_length'] = 1;


// 左侧框架的像素宽度(对象浏览器)

$conf['left_width'] = 200;


// 使用哪种界面风格?

$conf['theme'] = 'default';


// 是否在浏览表的时候显示 OID ?

$conf['show_oids'] = false;


// 浏览记录集合的时候每页显示的最大行数

$conf['max_rows'] = 30;


// 浏览时默认每个字段显示的最大字符数

$conf['max_chars'] = 50;


// 是否发送 XHTML 头?

$conf['use_xhtml_strict'] = false;


// PostgreSQL 文档的基准 URL

// 如果存在'%s'将会被 PostgreSQL 版本号所代替(7, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3)

$conf['help_base'] = 'http://www.postgresql.org/docs/%s/interactive/';


/*****************************************

* !!请千万不要修改本行之后的内容!! *

*****************************************/


$conf['version'] = 19;

?>


然后:cp phpPgAdmin-4.2.0 /usr/local/apache2/htdocs/

在 ;Dynamic Extensions 下加:extension=pgsql.so注意保存

这样你就可以在WEB浏览器图型界面里管理你的PostgreSQL数据库了

(14).下载drupal-6.2.tar.gz

(a).下载地址:http://drupal.org/files/projects/drupal-6.2.tar.gz

(b).tar -zxvf drupal-6.2.tar.gz

(c).这样会建立一个新的drupal-6.2/目录包括所有的Drupal文件和目录。把这个目录包括的这些文件移动到网站服务器文件的根目录下面或者是你的公开的HTML目录下面:

mv drupal-6.2/* drupal-6.2/.htaccess /usr/local/apache2/htdocs

(d).如果你想把默认的英语接口翻译到不同的语言,我们这里有好消息。你可以在刚开始用其他的语言安装和使用Drupal.打开这个页面http: //drupal.org/project/translations and download the package,选取一个被释放的你需要的语言包,看是否可以使用在这个Drupal版本上 .内容解压缩到与drupal相同的解压目录下。

(e).在sites/default目录下drupal具有default.settings.php文件。安装程序将在相同的目录下创建一个此文件的复制文件,并且包括你在安装过程中提供的细节内容。 用命令通过sites/default 目录给Web服务器写入特权(从安装目录) :

chmod o+w sites/default

(f).修改default.settings.php下如下所示:<?php

// $Id: default.settings.php,v 1.8 2007/12/20 09:35:10 goba Exp $


/**

* @file

* Drupal site-specific configuration file.

*

* IMPORTANT NOTE:

* This file may have been set to read-only by the Drupal installation

* program. If you make changes to this file, be sure to protect it again

* after making your modifications. Failure to remove write permissions

* to this file is a security risk.

*

* The configuration file to be loaded is based upon the rules below.

*

* The configuration directory will be discovered by stripping the

* website's hostname from left to right and pathname from right to

* left. The first configuration file found will be used and any

* others will be ignored. If no other configuration file is found

* then the default configuration file at 'sites/default' will be used.

*

* For example, for a fictitious site installed at

* http://www.drupal.org/mysite/test/, the 'settings.php'

* is searched in the following directories:

*

* 1. sites/www.drupal.org.mysite.test

* 2. sites/drupal.org.mysite.test

* 3. sites/org.mysite.test

*

* 4. sites/www.drupal.org.mysite

* 5. sites/drupal.org.mysite

* 6. sites/org.mysite

*

* 7. sites/www.drupal.org

* 8. sites/drupal.org

* 9. sites/org

*

* 10. sites/default

*

* If you are installing on a non-standard port number, prefix the

* hostname with that number. For example,

* http://www.drupal.org:8080/mysite/test/ could be loaded from

* sites/8080.www.drupal.org.mysite.test/.

*/


/**

* Database settings:

*

* Note that the $db_url variable gets parsed using PHP's built-in

* URL parser (i.e. using the "parse_url()" function) so make sure

* not to confuse the parser. If your username, password

* or database name contain characters used to delineate

* $db_url parts, you can escape them via URI hex encodings:

*

* : = %3a / = %2f @ = %40

* + = %2b ( = %28 ) = %29

* ? = %3f = = %3d & = %26

*

* To specify multiple connections to be used in your site (i.e. for

* complex custom modules) you can also specify an associative array

* of $db_url variables with the 'default' element used until otherwise

* requested.

*

* You can optionally set prefixes for some or all database table names

* by using the $db_prefix setting. If a prefix is specified, the table

* name will be prepended with its value. Be sure to use valid database

* characters only, usually alphanumeric and underscore. If no prefixes

* are desired, leave it as an empty string ''.

*

* To have all database names prefixed, set $db_prefix as a string:

*

* $db_prefix = 'main_';

*

* To provide prefixes for specific tables, set $db_prefix as an array.

* The array's keys are the table names and the values are the prefixes.

* The 'default' element holds the prefix for any tables not specified

* elsewhere in the array. Example:

*

* $db_prefix = array(

* 'default' => 'main_',

* 'users' => 'shared_',

* 'sessions' => 'shared_',

* 'role' => 'shared_',

* 'authmap' => 'shared_',

* 'sequences' => 'shared_',

* );

*

* Database URL format:

* $db_url = 'mysql://username:password@localhost/databasename';

* $db_url = 'mysqli://username:password@localhost/databasename';

* $db_url = 'pgsql://username:password@localhost/databasename';

*/

$db_url = 'pgsql://username:123456@localhost/databasename';

$db_prefix = '';


/**

* Access control for update.php script

*

* If you are updating your Drupal installation using the update.php script

* being not logged in as administrator, you will need to modify the access

* check statement below. Change the FALSE to a TRUE to disable the access

* check. After finishing the upgrade, be sure to open this file again

* and change the TRUE back to a FALSE!

*/

$update_free_access = FALSE;


/**

* Base URL (optional).

*

* If you are experiencing issues with different site domains,

* uncomment the Base URL statement below (remove the leading hash sign)

* and fill in the URL to your Drupal installation.

*

* You might also want to force users to use a given domain.

* See the .htaccess file for more information.

*

* Examples:

* $base_url = 'http://www.example.com';

* $base_url = 'http://www.example.com:8888';

* $base_url = 'http://www.example.com/drupal';

* $base_url = 'https://www.example.com:8888/drupal';

*

* It is not allowed to have a trailing slash; Drupal will add it

* for you.

*/

# $base_url = 'http://www.example.com'; // NO trailing slash!


/**

* PHP settings:

*

* To see what PHP settings are possible, including whether they can

* be set at runtime (ie., when ini_set() occurs), read the PHP

* documentation at http://www.php.net/manual/en/ini.php#ini.list

* and take a look at the .htaccess file to see which non-runtime

* settings are used there. Settings defined here should not be

* duplicated there so as to avoid conflict issues.

*/

ini_set('arg_separator.output', '&');

ini_set('magic_quotes_runtime', 0);

ini_set('magic_quotes_sybase', 0);

ini_set('session.cache_expire', 200000);

ini_set('session.cache_limiter', 'none');

ini_set('session.cookie_lifetime', 2000000);

ini_set('session.gc_maxlifetime', 200000);

ini_set('session.save_handler', 'user');

ini_set('session.use_only_cookies', 1);

ini_set('session.use_trans_sid', 0);

ini_set('url_rewriter.tags', '');


/**

* Drupal automatically generates a unique session cookie name for each site

* based on on its full domain name. If you have multiple domains pointing at

* the same Drupal site, you can either redirect them all to a single domain

* (see comment in .htaccess), or uncomment the line below and specify their

* shared base domain. Doing so assures that users remain logged in as they

* cross between your various domains.

*/

# $cookie_domain = 'example.com';


/**

* Variable overrides:

*

* To override specific entries in the 'variable' table for this site,

* set them here. You usually don't need to use this feature. This is

* useful in a configuration file for a vhost or directory, rather than

* the default settings.php. Any configuration setting from the 'variable'

* table can be given a new value. Note that any values you provide in

* these variable overrides will not be modifiable from the Drupal

* administration interface.

*

* Remove the leading hash signs to enable.

*/

# $conf = array(

# 'site_name' => 'My Drupal site',

# 'theme_default' => 'minnelli',

# 'anonymous' => 'Visitor',

/**

* A custom theme can be set for the off-line page. This applies when the site

* is explicitly set to off-line mode through the administration page or when

* the database is inactive due to an error. It can be set through the

* 'maintenance_theme' key. The template file should also be copied into the

* theme. It is located inside 'modules/system/maintenance-page.tpl.php'.

* Note: This setting does not apply to installation and update pages.

*/

# 'maintenance_theme' => 'minnelli',

/**

* reverse_proxy accepts a boolean value.

*

* Enable this setting to determine the correct IP address of the remote

* client by examining information stored in the X-Forwarded-For headers.

* X-Forwarded-For headers are a standard mechanism for identifying client

* systems connecting through a reverse proxy server, such as Squid or

* Pound. Reverse proxy servers are often used to enhance the performance

* of heavily visited sites and may also provide other site caching,

* security or encryption benefits. If this Drupal installation operates

* behind a reverse proxy, this setting should be enabled so that correct

* IP address information is captured in Drupal's session management,

* logging, statistics and access management systems; if you are unsure

* about this setting, do not have a reverse proxy, or Drupal operates in

* a shared hosting environment, this setting should be set to disabled.

*/

# 'reverse_proxy' => TRUE,

/**

* reverse_proxy accepts an array of IP addresses.

*

* Each element of this array is the IP address of any of your reverse

* proxies. Filling this array Drupal will trust the information stored

* in the X-Forwarded-For headers only if Remote IP address is one of

* these, that is the request reaches the web server from one of your

* reverse proxies. Otherwise, the client could directly connect to

* your web server spoofing the X-Forwarded-For headers.

*/

# 'reverse_proxy_addresses' => array('a.b.c.d', ...),

# );


/**

* String overrides:

*

* To override specific strings on your site with or without enabling locale

* module, add an entry to this list. This functionality allows you to change

* a small number of your site's default English language interface strings.

*

* Remove the leading hash signs to enable.

*/

# $conf['locale_custom_strings_en'] = array(

# 'forum' => 'Discussion board',

# '@count min' => '@count minutes',

# );


关键是第93行$db_url = 'pgsql://username:123456@localhost/databasename';要跟据你的实际情况修改。保存后,在PostgreSQl数据库里

(g). CREATE DATABASE USER

createuser --pwprompt --encrypted --no-adduser --no-createdb username

(h).CREATE THE DRUPAL DATABASE

createdb --encoding=UNICODE --owner=username databasename

(i).最后得重启apache2,postgresql,firefox浏览器

/usr/local/apache2/bin/apachectl restart

/opt/pgsql/bin/pg_ctl -D /opt/pgsql/data -l /opt/pgsql/log/pgsql.log start

(j).在firefox浏览器输入: http://localhost/drupal安照提示顺利完成安装,这里就不一一细说drupal的使用或怎么写你的Blog了。

(k).drupal-6.2 drupal进入管理时太慢了。

解决办法:


在管理>>>网站建置>>>去掉Update status前面的启用选项,再储存设定,网站就明显快速了许多。如:


Drupal 6.2

GD 程式庫 bundled (2.0.34 compatible)

PHP 5.2.5

PHP register globals 停用

PHP 記憶體限制 128M

PostgreSQL 資料庫 8.3.1

Unicode 程式庫 PHP Mbstring Extension

cron維護作業 上一次執行是在 20 分鐘 以前

你可以手動執行 cron。

存取 update.php 已保護

更新通知 未啟用

未啟用更新通知。?娏医ㄗh你在模組管理裡啟用更新狀態模組,才能跟得上新版本的發行。更多資請參考更新狀態說明文件。

檔案系統 可寫入(公開的 下載模式)

網站伺服器 Apache/2.2.8 (Unix) PHP/5.2.5

設定檔案 已保護

資料庫更新 最新的

以上只是一些向前人学习的一点总结,给予整理防我忘怀,又加深记忆,凡文中所涉及技术的内容,保留原著作者的版权,如有侵犯到你的利益,我会在知道的第一时间改正并删除,还敬请原谅。

原文地址:http://www.linux-ren.org/modules/newbb/viewtopic.php?topic_id=7000



返回顶部

发表评论:

Powered By Z-BlogPHP 1.7.3


知识共享许可协议
本作品采用知识共享署名 3.0 中国大陆许可协议进行许可。
网站备案号粤ICP备15104741号-1