Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7454011
  • 博文数量: 1760
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16267
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1760)

文章存档

2024年(6)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2009-07-09 10:36:41

1) Preliminary note
I'm using a Ubuntu 8.10 server system installed according to steps 1-3, 5, 7 and 8 described in that howto: . I also use the expression "serveripaddress" for server's ip address. You should replace it with your own. You should take every step of this howto logged in as root.
 
2) Install MySQL
You need a database server to run PHP scripts that use MySQL to manage data stored in user's databases. You can install it (and the client) by entering:
apt-get install mysql-server-5.0 mysql-client
 
3) Set MySQL's root user password
Before using MySQL a password should be set for the root user. You will be prompted for it after the server gets installed.
Remember that without setting root's password everyone can access every database on your MySQL server.
 
4) Install PHP
PHP is a scripting language used to run scripts that can do lots of different things on the server side. You can install it like this:
apt-get install php5-cgi
PHP has an interface to MySQL server that can be installed by entering the following:
apt-get install php5-mysql
 
5) Install some needed packages
We will compile Cherokee from sources so we'll need a C++ compiler and some other usefull packages:
apt-get install cpp gcc g++ make
 
6) Download, compile and install Cherokee web server
Download Cherokee to /tmp:
cd /tmp
wget
When I wrote this text Cherokee 0.11.0b2449 was the latest snapshot version which means it's in beta state so there still might be some errors. You could download and use a stable version from instead as well.
Unpack the downloaded archive:
tar -zxvf cherokee-latest-svn.tar.gz
and enter the new directory:
cd cherokee-0.11.0b2449
Now it has to be configured the way we need. This is the recommended way:
./configure --localstatedir=/var
--prefix=/usr
--sysconfdir=/etc
--with-wwwroot=/var/www
Compile Cherokee:
make
and install it:
make install
An error like "configure:error:no acceptable c compiler found in $path" most likely means that there is no C compiler installed or it's not in the system path. You should then make sure to install everything described in step 5 and everything will work fine.
7) Starting up Cherokee
Copy the startup script to /etc/init.d/ (don't leave cherokee-0.11.0b2449 directory yet) and edit it:
cp contrib/cherokee /etc/init.d/cherokee
nano /etc/init.d/cherokee
and change two paths in lines starting with
DEAMON=
and
CONF=
like this:
 
DAEMON=/usr/sbin/cherokee
CONF=/etc/cherokee/cherokee.confPress CTRL+X and Y to write and close the file.
Give appropriate access permissions to the script:
chmod 755 /etc/init.d/cherokee
Check if Cherokee can start by entering:
/etc/init.d/cherokee start
Make startup links in different runlevels:
update-rc.d cherokee defaults
Everything should work correctly by now. You can test php and its modules by making a file named for example info.php and putting it in document_root of the server. It should contain
Next open this file in a web browser:
Just to be sure you can reboot and see if Cherokee is started automatically.
 
8) Configure the server
This is what makes Cherokee special. There are a number of ways of configuring it. It can be done in a traditional way by editing configuration files but in this case it is not recommended. It can also be done using a web interface called cherokee-admin. This part gave me a little headache when I tried to make it work on Debian Etch. However there were no problems with it on Ubuntu. By default cherokee-admin is accessible only from the server. After you start it by hand it will generate a one time password, show it to you and bind on localhost on port 9090. To access it you would have to open in a browser working on the server. Since installing a graphical interface on a server is also not recommended (you can use a text browser but that wouldn't make the configuration easy) you have to find a way to reach cherokee-admin from a remote client. Here's how you can do it (pick your favorite): (be sure to also check whether there are any firewall rules blocking port 9090 and/or is it free)
 
Making an SSH tunnel
This will make a tunnel that will forward port 9090 to a client computer. In effect you should be able to connect to the cherokee-admin web interface by browsing to: . All you have to do is open a terminal and connect to the server using SSH:
ssh
After logging in start cherokee-admin:
cherokee-admin
You will see some general info about the application, username and one time password that will be used to log into the web interface. Write it down or just copy. Now open a new terminal window and connect to the server again like so:
ssh -L 9090:127.0.0.1:9090
and enter your password. Now the tunnel is active and you can open in a browser.
Sometimes Firefox 3 may complain that the port is not standard and not used for browsing web sites and it will refuse to connect (it happens in some cases). That is strictly Firefox's fault. If everything goes well cherokee-admin should ask you for that username and one time password you've copied earlier. Then the web interface should open.
Notes:
-the tunnel will remain active until you close the connection initiated by SSH -L ......; the connection can be closed by the server in case of no activity; it doesn't matter that you will use cherokee-admin, you should also keep the connection alive by typing for example: ls from time to time (it doesn't matter what, just do something); that depends on your SSH server settings.
-if you are using Putty on Windows as a client you can still make SSH tunnels; take a look here to find out how: .
 
Binding cherokee-admin to all interfaces
The other way of dealing with configuration of Cherokee is unbinding cherokee-admin from localhost:9090 and connecting to it directly. To do it connect to the server by ssh:
ssh
and enter:
cherokee-admin -b
Then open your browser and connect to:
cherokee-admin should then ask for username and one time password. After finishing the configuration, save it and restart Cherokee. You should also end cherokee-admin process for security reasons. Here are some screenshots of cherokee-admin in action:
 
 
9) Links:
- Ubuntu:
- Cherokee:
 
阅读(962) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~