Tech Tips

  1. Uncategorized
  2. 64 view

[Perl][Dancer][Apache][Ubuntu12.04LTS]How to set apache to run Dancer via reverse proxy

Contents

Install Dancer

$ perl -MCPAN -e shell
cpan> install Dancer
cpan> quit

Hello World

bin/app.pl

#!/usr/bin/env perl
use Dancer ':syntax';
#use sharss;

get '/' => sub {
   'Hello, World!';
};

dance;

app.psgi

require 'bin/app.pl';

Test

Run.
perl app.psgi
“Hello, World!” will be shown when you access http://localhost:3000/.

Setting reverse proxy

install mod_proxy module

sudo apt-get install libapache2-mod-proxy-html
sudo apt-get install libxml2-dev

Setting conf file

<Location "/test">
    RequestHeader set request-base /var/www/something
    ProxyPass http://localhost:3000
    ProxyPassReverse http://localhost:3000
</Location>
If you add “/” the end of ProxyPass and ProxyPass Reverse, the reverse proxy maybe don’t work.
I stacked a little bit about it.

validation of mod_proxy

sudo a2enmod proxy
sudo a2enmod proxy_http headers
sudo /etc/init.d/apache2 restart

Test

“Hello, World!” will be shown when you access http://localhost/test. That’s all. [[amazon2][4873115671][4844328654]]

Uncategorized recent post

  1. Run Amazon FreeRTOS on M5Stack Core2 for AWS …

  2. Udacity Self-Driving Car Engineer Nanodegree …

  3. Install sbt 1.0.0 and run sample template

  4. Visualization of Neural Network and its Train…

  5. [Machine Learning]Created docker image includ…

関連記事

PAGE TOP