drise 2010-06-26
Cherokee 是一个非常快速,灵活和易于配置的Web Server.它支持现今普遍的技术:FastCGI, SCGI, PHP, CGI, TLS and SSL 加密连接, virtual hosts, authentication, on the fly encoding, load balancing, Apache compatible log files, and much more. 本教程演示如何安装 Cherokee 在Ubuntu 10.04 服务器上PHP5(through FastCGI) and MySQL 的问题.
Cherokee可以通过配置一个基于Web的控制面板,我们可以开始如下:
cherokee-admin -b
(默认 cherokee-admin 登录 127.0.0.1 (localhost))
root@server1:~# cherokee-admin -b
Login:
User: admin
One-time Password: gU7dYa7zq31yjC6pWeb 连接:
URL: http://localhost:9090/[12/05/2010 17:42:12.448] (error) rrd_tools.c:114 - Could not find the rrdtool binary.
Cherokee Web Server 0.99.39 (Feb 2 2010): Listening on port ALL:9090, TLS
disabled, IPv6 disabled, using epoll, 4096 fds system limit, max. 2041
connections, caching I/O, single thread
http://192.168.0.100:9090/:
这是如何在网络界面:
停止 cherokee-admin, 按CTRL+C中断.
在Cherokee上安装php5可以跑FastCGI, Ubuntu FastCGI-enabled PHP5 安装包进行安装:
aptitude install php5-cgi
修改 /etc/php5/cgi/php.ini 和添加 cgi.fix_pathinfo = 1
vi /etc/php5/cgi/php.ini
[...] cgi.fix_pathinfo = 1 |
重启 Cherokee:
/etc/init.d/cherokee restart
PHP 默认没有启动在 Cherokee . 要启用它, 重新启动 Cherokee’s web-based 控制面板…
cherokee-admin -b
… 登录 (http://192.168.0.100:9090/).
查看 Virtual Servers, 选择默认的虚拟主机:
单击向导按钮:
Under Wizards > Languages,单击运行向导旁边的连结PHP图标:
PHP的现在应该列在行为标签. Make sure you mark its checkbox in the Final column:
通过点击链接在目标的PHP专栏,你可以改变,如果你喜欢默认的PHP设定(这是没有必要,默认设置应该是在大多数情况 cases).对FastCGI 设置选项卡上的处理程序:
在你离开控制面板, 必需重新启动Cherokee 才能更生效 effect. 这样做, 选择Graceful在重新启动控制面板,并点击左边栏保存在保存的变化:
vi /var/www/info.php
<?php phpinfo(); ?> |
在地址输入 (e.g. http://192.168.0.100/info.php):
知道 PHP5 在工作, and it’s working through FastCGI, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5. MySQL is not listed there which means we don’t have MySQL support in PHP5 yet.
To get MySQL support in PHP, we can install the php5-mysql package. It’s a good idea to install some other PHP5 modules as well as you might need them for your applications. You can search for available PHP5 modules like this:
aptitude search php5
Pick the ones you need and install them like this:
aptitude install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json
Now restart Cherokee:
/etc/init.d/cherokee restart
Now reload http://192.168.0.100/info.php in your browser and scroll down to the modules section again. You should now find lots of new modules there, including the MySQL module: