首页
/ Cherokee Web Server 技术文档

Cherokee Web Server 技术文档

2024-12-20 13:17:19作者:虞亚竹Luna

1. 安装指南

1.1 从源码编译安装

1.1.1 从GitHub仓库编译

  1. 安装依赖工具:

    • 对于Debian/Ubuntu系统:
      sudo apt-get install autoconf automake libtool libtool-bin python2 libssl-dev
      
    • 对于RedHat/CentOS/Fedora系统:
      sudo yum install autoconf automake libtool
      
    • 对于ArchLinux系统:
      sudo pacman -Sy autoconf automake libtool
      
  2. 从GitHub克隆代码:

    git clone http://github.com/cherokee/webserver.git
    
  3. 进入源码目录并运行autogen.sh

    cd webserver
    ./autogen.sh --with-python2=/usr/bin/python2 [options]
    make
    sudo make install
    

1.1.2 从tar.gz文件编译

  1. 下载并解压源码包:

    wget http://www.cherokee-project.com/download/trunk/cherokee-latest-snapshot.tar.gz
    tar xf cherokee-latest-snapshot.tar.gz
    cd cherokee-latest-snapshot
    
  2. 配置并编译:

    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
    make
    sudo make install
    

2. 项目使用说明

2.1 启动与停止服务器

安装完成后,可以通过以下命令启动和停止Cherokee Web Server:

  • 启动服务器:
    sudo cherokee-admin
    
  • 停止服务器:
    sudo cherokee-admin -q
    

2.2 配置管理

Cherokee提供了一个名为Cherokee-Admin的Web界面,用于配置和管理服务器。启动cherokee-admin后,可以通过浏览器访问http://localhost:9090进行配置。

3. 项目API使用文档

Cherokee Web Server支持多种Web技术,如FastCGI、SCGI、PHP、uWSGI、SSI、CGI等。以下是一些常用的API配置示例:

3.1 FastCGI配置

Cherokee-Admin界面中,选择相应的虚拟服务器,然后在Handler选项中选择FastCGI,并配置FastCGI的执行路径和参数。

3.2 PHP配置

Cherokee-Admin界面中,选择相应的虚拟服务器,然后在Handler选项中选择PHP,并配置PHP的执行路径和参数。

4. 项目安装方式

Cherokee Web Server可以通过以下两种方式安装:

  1. 从源码编译安装:如上文所述,通过GitHub仓库或tar.gz文件进行编译安装。
  2. 通过包管理器安装:某些Linux发行版可能提供了Cherokee的预编译包,可以通过包管理器直接安装。例如:
    • 对于Debian/Ubuntu系统:
      sudo apt-get install cherokee
      
    • 对于RedHat/CentOS/Fedora系统:
      sudo yum install cherokee
      

通过以上步骤,您可以顺利安装并使用Cherokee Web Server。

登录后查看全文
热门项目推荐