douqiao5543
2016-04-21 15:26
浏览 159
已采纳

Node.js应用程序的服务器配置

I am trying to move an application off of PHP and onto Node.js. The PHP application uses an Apache server and has a tileservices.conf file that is necessary for the app to work. How would I move over the configuration in this file to a Node application?

Alias /tiles /sandbox/TileServices/www/TileStreamer.php
Alias /thumbs /sandbox/TileServices/www/ThumbStreamer.php
Alias /MosaicTest /sandbox/TileServices/www/MosaicTest

RewriteEngine on
RewriteRule ^/1.0.0/([a-zA-Z0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)\.[a-zA-Z]*$ /sandbox/TileServices/tiles/tc/cache_server.php?z=$2&c=$3&r=$4&cache=$1
RewriteRule ^/nwomtest/1.0.0/(.+)/(.+)/(.+)/(.+)\.[a-zA-Z]*$ /sandbox/TileServices/www/tc/cache_server_new.php?z=$2&c=$3&r=$4&cache=$1
RewriteRule ^/nocache/nwomtest/1.0.0/(.+)/(.+)/(.+)/(.+)$ /sandbox/TileServices/www/tc/cache_server_new.php?z=$2&c=$3&r=$4&cache=$1&do_not_cache=nocache
RewriteRule ^/nocache/nwomtest/1.0.0/(.+)/(.+)/(.+)/(.+)\.[a-zA-Z]*$ /sandbox/TileServices/www/tc/cache_server_new.php?z=$2&c=$3&r=$4&cache=$1&do_not_cache=nocache

RewriteRule ^/oms/1.0.0/(.+)/(.+)/(.+)/(.+)\.[a-zA-Z]*$ /sandbox/TileServices/www/MosaicRequestHandler.php?z=$2&c=$3&r=$4&library=$1&filestyle=strip
RewriteRule ^/omb/1.0.0/(.+)/(.+)/(.+)/(.+)\.[a-zA-Z]*$ /sandbox/TileServices/www/MosaicRequestHandler.php?z=$2&c=$3&r=$4&library=$1&filestyle=block
RewriteRule ^/ms/1.0.0/(.+)/(.+)/(.+)/(.+)/(.+)\.[a-zA-Z]*$ /sandbox/TileServices/www/Mosaic/Mosaic.php?z=$3&c=$4&r=$5&resource=$1&tkid=$2&filestyle=strip
RewriteRule ^/mb/1.0.0/(.+)/(.+)/(.+)/(.+)/(.+)\.[a-zA-Z]*$ /sandbox/TileServices/www/Mosaic/Mosaic.php?z=$3&c=$4&r=$5&resource=$1&tkid=$2&filestyle=block

<Directory "/sandbox/TileServices/www">
    AllowOverride None
    Options -Indexes
    Require all granted

    <IfModule speling>
        CheckSpelling on
    </IfModule>

    SetEnv MOUNT_PREFIX "/mnt/autofs"
</Directory>

<Directory "/sandbox/TileServices/www/tiles/MosaicTest">
    Require all denied
    Allow from 10.0.0.0/8
    Allow from 172.16.0.0/12
    Allow from 192.168.0.0/16
    Allow from 206.90.52.6/32
</Directory>

图片转代码服务由CSDN问答提供 功能建议

我正在尝试将应用程序从PHP移到Node.js上。 PHP应用程序使用Apache服务器并具有应用程序运行所必需的 tileservices.conf </ code>文件。 如何将此文件中的配置移动到Node应用程序?</ p>

  Alias / tiles /sandbox/TileServices/www/TileStreamer.php
Alias / thumbs / sandbox / TileServices  /www/ThumbStreamer.php
Alias / MosaicTest / sandbox / TileServices / www / MosaicTest 
 
RewriteEngine on 
RewriteRule ^ / 1.0.0 /([a-zA-Z0-9] *)/([0-9]  *)/([0-9] *)/([0-9] *)\。[a-zA-Z] * $ /sandbox/TileServices/tiles/tc/cache_server.php?z=$2&c  = $ 3&amp; r = $ 4&amp; cache = $ 1 
RewriteRule ^ / nwomtest / 1.0.0 /(.+)/(.+)/(.+)/(.+) \。[a-zA-Z]  * $ /sandbox/TileServices/www/tc/cache_server_new.php?z=$2&c=$3&r=$4&cache=$1
RewriteRule ^ / nocache / nwomtest / 1.0.0 /(.+)/  (。+)/(。+)/(。+)$ /sandbox/TileServices/www/tc/cache_server_new.php?z=$2&c=$3&r=$4&cache=$1&do_not_cache=  nocache 
RewriteRule ^ / nocache / nwomtest / 1.0.0 /(. +)/(。+)/(。+)/(。+)\。[a-zA-Z] * $ / sandbox / TileServices / www /  tc / cache_server_new.php?z = $ 2&amp; c = $ 3&amp; r = $ 4&amp; cache = $ 1&amp; do_not_cache = nocache 
 
RewriteRule ^ / oms / 1.0.0 /(.+)/(++)  /(.+)/(.+)\.[a-zA-Z]*  $ /sandbox/TileServices/www/MosaicRequestHandler.php?z=$2&c=$3&r=$4&library=$1&filestyle=strip
RewriteRule ^ / omb / 1.0.0 /(.+)/  (。+)/(。+)/(。+)\。[a-zA-Z] * $ /sandbox/TileServices/www/MosaicRequestHandler.php?z=$2&c=$3&r=$4&  ; library = $ 1&amp; filestyle = block 
RewriteRule ^ / ms / 1.0.0 /(.+)/(.+)/(.+)/(../)/(.+) \。[a-zA-  Z] * $ /sandbox/TileServices/www/Mosaic/Mosaic.php?z=$3&c=$4&r=$5&resource=$1&tkid=$2&filestyle=strip
RewriteRule ^ / mb  /1.0.0/(.+)/(.+)/(.+)/(.+)/(++),.-a-zA-Z]*$ / sandbox / TileServices / www / Mosaic / Mosaic  .php?z = $ 3&amp; c = $ 4&amp; r = $ 5&amp; resource = $ 1&amp; tkid = $ 2&amp; filestyle = block 
 
&lt; Directory“/ sandbox / TileServices / www”&gt; 
 AllowOverride 无
选项-Indexes 
要求全部授予
 
&lt; IfModule speling&gt; 
 CheckSpelling on 
&lt; / IfModule&gt; 
 
 SetEnv MOUNT_PREFIX“/ mnt / autofs”
&lt; / Directory&gt; \  n 
&lt; Directory“/ sandbox / TileServices / www / tiles / MosaicTest”&gt; 
要求所有被拒绝
允许来自10。  0.0.0 / 8 
允许来自172.16.0.0/12
允许来自192.68.52.6/16.n允许来自206.90.52.6/32
</Directory>
</ DIV>

1条回答 默认 最新

相关推荐 更多相似问题