服务器优化:如何加速Tinyows服务器

PostgreSQL/PostGIS数据库的提示和技巧

Apache的提示和技巧

使用快速CGI

  • 检查您的tinyows是否使用fastcgi支持编译:

    [user@host mapserver]$ tinyows --check
    TinyOWS version:   1.2.0
    FCGI support:      Yes
    ...
    

Apache中的快速CGI

  • 在Apache中,激活modfastcgi

    $ sudo apt-get install -y libapache2-mod-fastcgi
    $ sudo a2enmod fastcgi
    
  • Apache Fast CGI配置:

    #in your cgi-bin directive, add the following to run all cgi-bin using FastCGI
    SetHandler fastcgi-script
    
    #in your FastCGI config file (typically something like /etc/apache2/mods-enabled/fastcgi.conf)
    FastCgiServer /usr/lib/cgi-bin/tinyows.fcgi -processes 10
    

MS4W中的快速CGI

  • 请参阅 fastcgi doc in ms4w

  • 添加以下两行:

    DefaultInitEnv TINYOWS_CONFIG_FILE "/ms4w/apps/tinyows/config.xml"
    DefaultInitEnv TINYOWS_SCHEMA_DIR "/ms4w/apps/tinyows/schema/"
    

HTTP Gzip压缩

  • 在Apache中,激活 mod_deflate

  • deflate基本配置(注意,我们包括xml-so-gml和json):

    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/json