How to run together: PSGI and PHP?
I have Perl/PSGI application (running under pure perl Starman server). Now, for some reason need run one PHP application too ;(, so (probably) need Apache2. Questions:
- really need Apache for PHP? or exists some other solution?
- How to setup reverse proxy, so when someone will go to http: //mysite/myapp/something, will be proxied to Starman where my PSGI "myapp" living? and
- http: //mysite/phpapp/anything - will go to php app...
- I can setup the Starman server for listening on another port, e.g. 8080, but want access both applications at port:80 - so need reverse proxy.
Plus:
the server is behind my home NAT router. Internal server has address: 192.168.1.10, from the outside, ofc, the router have correct internet address. I have redirected all traffic
routerIP:80 -> 192.168.1.10:80
- What is best way achieve access to both applications: PSGI + PHP from the both side (internet + "intranet") at the port:80?
- Need setup some virtual hosts? Or exists some really simple solution?
- some links to helpful guidelines shoudl help a lot too..
Ps: I don't need optimize performance, the server is only for home/demo/testing purpose.
EDIT: Now, in another similar situation I checked CPAN again and based on @rawhide's answer I found the Plack::App::PHPCGI module. Works great - it is really cool testing php apps under plackup... ;)
You can execute it as CGI (fork+exec) either using
Plack::App::CGIBin
or using WrapCGI directlyIf rawhide.php has no shebang, you'd use
/usr/bin/php /path/to/rawhide.php