频道直达 - 专题 - 新闻 - 基础 - 高级 - 安装 - 技巧 - 数据库 - 手册 - PHP - Linux - Java - MySQL - Apache - 麻辣堂 - 狼盟 - Rails社群 - 搜索 - 下载 - 开源 - 论坛

用 Sun 的 AMP 组合(Cool Stack) 搭建自己的 Blog 服务器

来源:www.phpres.com 作者:Angelover 出处:www.phpres.com 2008-5-7 07:55:45 进入讨论组
关 键 词: 自己 服务器 搭建 组合 安装 MySQL mysql PHP 如果 engine

对于那些和我一样,喜欢马上自己动手的人来说,甚至不需要知道它到底是干什么的,最想知道的就是下载地址了。

Sun 的 Cool Stack 组合可以从下面的连接下载:
http://cooltools.sunsource.net/coolstack/

 


Cool Stack 是 经过 Sun 优化以后的一套开放源代码软件组合,最新版本 1.1 包含

* CSKamp. 加入了 Apache2, MySQL5 和 PHP5
* CSKmysql. 如果需要运行 64 位的 MySQL,请安装本包
* CSKperl. 包含了很多 Perl 的扩展
* CSKphplibsBundle. 如果需要 PHP 其他扩展的话,就要安装该包
* CSKmemcached. memcached, 分布式对象缓冲系统
* CSKruby. 包含 ruby, rubygems and rails.
* CSKsquid. 包含 Squid Web Proxy Cache.
* CSKtomcat. 包含 Apache Tomcat

本文将通过介绍安装 WordPress 2.0 的过程以对 Cool Stack 有比较详细的了解。

本文介绍的软件需要 Solaris 10 操作系统的支持。[PHP开发资源网 = 全球最大的PHP中文社群 = PHPer的网上家园]

1、下载:
# mkdir /var/tmp/CoolStack
# cd /var/tmp/CoolStack
# ftp ftp.sunfreeware.com
user:ftp
password:youremail@yourcompany.com
cd /pub/freeware/CSK/
bin
get CSKamp_x86.pkg.bz2
get CSKmysql_x86.pkg.bz2
bye

2、安装:
# bunzip2 CSKamp_x86.pkg.bz2 CSKmysql_x86.pkg.bz2
# pkgadd -d CSKamp_x86.pkg.bz2
# pkgadd -d CSKmysql_x86.pkg

3、配置 Apache
# vi /opt/coolstack/apache2/conf/httpd.conf

修改运行 Web Server 的用户名和组
修改 ServerName
修改 ServerAdmin
修改 DirectoryIndex 为
DirectoryIndex index.html index.php
启动: # /opt/coolstack/apache2/bin/apachectl start
如果启动有错误,查看 ErrorLog:
# tail -100f /opt/coolstack/apache2/logs/error_log

如果原先安装有 Sun 的 Apache 包,建议禁用
# svcadm disable apache2
# svcadm refresh apache2

然后再移除下面的包(选作):
SUNWapchd
SUNWapchu
SUNWapchr
SUNWapch2d
SUNWapch2u
SUNWapch2r
SUNWaclg

4、测试 PHP
在 Web 目录下建立一个 test.php
<?php
phpinfo()?
?>
本文假设 Web Server Name 为 freelamp.com,
在浏览器输入: http://freelamp.com/test.php 应该会显示 PHP 的编译参数等。

5、配置 MySQL
用 # isainfo -b 检查服务器是否 64 位
如果是64 则 MySQL 目录为 /opt/coolstack/mysql,32的话则为: /opt/coolstack/mysql_32bit

添加 mysql 用户:[PHP开发资源网 = 全球最大的PHP中文社群 = PHPer的网上家园]
#groupadd mysql;useradd -g mysql mysql

安装初始数据库:
# $MYSQL_DIR/bin/mysql_install_db
# chown -R mysql $MYSQL_DIR/var
启动:
# $MYSQL_DIR/bin/mysqld_safe &

如果启动失败,请检查 $MYSQL_DIR/var 目录下的 `hostname`.err 文件
# tail -100f `hostname`.err

6、下载并安装 WordPress
下载:
# cd /var/tmp
# wget http://wordpress.org/latest.tar.gz

解压:
# cd /opt/coolstack/apache2/htdocs
# gzcat /var/tmp/latest.tar.gz|tar xf -

建立配置文件:
# cd wordpress
# mv wp-config-sample.php wp-config.php
# vi wp-config.php
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'wordpress'); // Your MySQL username
define('DB_PASSWORD', 'wordpress'); // ...and password

建立数据库:
进入 MySQL 命令行:
# /opt/coolstack/mysql/bin/mysql -uroot
mysql> create database wordpress
mysql> grant all on wordpress.* to wordpress@localhost identified by 'wordpress';

进入 Web 界面配置:
http://freelamp.com/wordpress/
如果数据库配置没有错误的话,系统会提示进入 install.php 安装数据,
安装成功后,记录 admin 的密码登录即可管理自己的 Blog 了。

Sun 的这套 Cool Stack 最为抢眼的应该是经过优化后的 MySQL 64 位版本。美中不足的是

Apache 提供的不是 worker 模块,而是老的 prefork.c 模块。
PHP 没有提供 Zend Optimizer

 

附录:

A. 检查数据库程序的版本(32 还是 64):

bash-3.00# file bin/mysqld
bin/mysqld: ELF 64-bit LSB executable AMD64 Version 1, dynamically linked, not stripped, no debugging information available
bash-3.00# file ../mysql_32bit/bin/mysqld
../mysql_32bit/bin/mysqld: ELF 32-bit LSB executable 80386 Version 1, dynamically linked, not stripped, no debugging information available


B.查看数据库支持的引擎:

mysql> show engines;
+------------+---------+----------------------------------------------------------------+
| Engine | Support | Comment |
+------------+---------+----------------------------------------------------------------+
| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables |
| InnoDB | YES | Supports transactions, row-level locking, and foreign keys |
| BerkeleyDB | NO | Supports transactions and page-level locking |
| BLACKHOLE | NO | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE | NO | Example storage engine |
| ARCHIVE | YES | Archive storage engine |
| CSV | NO | CSV storage engine |
| ndbcluster | NO | Clustered, fault-tolerant, memory-based tables |
| FEDERATED | NO | Federated MySQL storage engine |
| MRG_MYISAM | YES | Collection of identical MyISAM tables |
| ISAM | NO | Obsolete storage engine |
+------------+---------+----------------------------------------------------------------+


C.查看 Apache 编译的模块:

bash-3.00# /opt/coolstack/apache2/bin/httpd -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c

本文也发表于 http://samp.nalai.net/57600

更多有关 Solaris 上的 AMP 文章,见于:

http://samp.nalai.net/

欢迎进入PHP开发资源论坛讨论。
收藏此文】【 】【打印】【关闭
相关文章
图文推荐
论 坛 资 源
PHP开发资源网奋斗目标
阅读排行:
热门技术文档
最新图文档
本站编辑推荐:(本站开通Delphi4PHP专区,欢迎进入论坛交流!)
编缉最近更新文章
网站赞助商
搜索您感兴趣的内容
 
   网站首页 -  网站地图 -  网站合作 -  手册中心 -  通用网址 -  网站论坛 -  网站投稿 -  友情链接 -  帮助中心
版权所有:PHP开发资源网 © 2003-2008 通用网址:PHP资源网 合作媒体: 赛迪网IT技术
互联网违法和不良信息举报中心 | 不良信息举报信箱