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

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

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 操作系统的支持。

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
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 用户:
#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

Post to Twitter

相关文章

You can leave a response, or trackback from your own site.

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word