logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: virtualhost-based fcgi hhvm implementation
Author
IceReaper



Joined: 27 May 2014
Posts: 1

PostPosted: Tue 27 May '14 13:03    Post subject: virtualhost-based fcgi hhvm implementation Reply with quote

OS: Ubuntu 14.04 64bit
Apache: 2.4.7 from Ubuntu Repository
HHVM: 3.0.1 from HHVM Repository

OLD:
Code:

I am trying to get a solid webserver running which will host my future customer-projects. I decided to use HHVM over PHP for several reason so this is what i came up with:

First of all - i have not changed any configuration in apache and hhvm.
The important part is, that even if any client-website is hacked, it should not be possible for the hacker to access files outside of the vhost docroot.
HHVM is started globaly at default with permission to read from /.
As i want to avoid generating a new port for every customer, i want to use unix sockets for connection.

So each of my apache virtualhosts should do the following:
- listen on one hostname (plus optional aliases)
- start its own hhvm instance with its own unix socket and pid
- add some kind of open_basedir parameter for this hhvm instance to chroot it to the web-folder.
- send all requests of .php or .hh files to the hhvm instance
(so in theory the same as simple virtualhosts with open_basedir set it php)

I tried using hhvm sandboxes (did not do anything at all). I tried using mod_fcgid, mod_fastcgi, mod_proxy_fcgi. However nothing worked out. Got a bunch of 404, 403, Internal Server Errors.. Would be a real bunch to post them all.
Also it might be important to note: i do not want to create unix-users for every vhost. Everything should run under www-data group and user.
So my question is: Can anyone help me or maybe even post a working virtualhost which does exactly this?

Thanks for any help i might get, even if it are just some snippets, as i am willing to continue digging into this till it works.



New:
Okay, i nearly got it. All i need to do is to start the fastcgi server correctly from within the virtualhost.
This is my working virtualhost: http://pastebin.com/3SuZM4CM
This is my working ssh start command: http://pastebin.com/CWLCixz6

So if anyone can show me how to implement the start command into the virtualhost, so it gets automaticaly started / stopped with apache, this whole thing is done! Smile
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 05 Aug '14 16:09    Post subject: Reply with quote

You want to start apache on system start? or your ssh start command?
Back to top


Reply to topic   Topic: virtualhost-based fcgi hhvm implementation View previous topic :: View next topic
Post new topic   Forum Index -> Apache