Jump to content

Recommended Posts

I am developing a kiosk style product to be used at events.  I have many years of professional experience in desktop application development, but only years of hacking here and there with web development.

The kiosk operator will start up server that has a GUI front end to populate the system with data.  The viewing stations will be web browsers.  The setup/network will be setup and broken down on at the events by my customer.  I am going to distribute a slimmed down copy of Apache and PHP with the software to use as the engine to get the web site to the client machines and running it on a non-standard port as not to conflict with any pre-existing web server on the system, so I have absolute control over Apache and PHP!

In general terms, how would you go about limiting the number of viewing stations that can connect to the apache web server?  My pricing model is going to be based on viewing stations.  The data will originate from the GUI.  Coming from a C/C++ background and having complete control of the web server, I know there are many options!  I am looking for a relatively secure way of controlling how many viewing stations can connect to the server. 

Would you do it via PHP or other means?  If by PHP, how exactly would you do it?  In all my playing with PHP, I have never done much with sessions.  My current thought is that the GUI will save a binary file that PHP can pick up that will have the number of connections to allow.  Then I need to do something with sessions to control that.  Or would I simply be better off using the IP address considering this is a closed intranet?  I don't know, any  suggestions?

Dexter
Link to comment
https://forums.phpfreaks.com/topic/36331-limiting-connections/
Share on other sites

If they all access the server with separate IPs then your PHP app could maintain a list of allowable IPs. E.g: If they have paid for 5 viewing stations then your PHP app should start off with an empty list of five IP addresses. As each viewing station connects, your PHP app would check the IP is not in the list and if there is space left, insert the IP into the list.
On subsequent connections if the requesting IP is not in the list and there are no spare slots then they are obviously accessing with a 6th IP and the connection should be rejected.

I hope that reads ok.
Link to comment
https://forums.phpfreaks.com/topic/36331-limiting-connections/#findComment-172979
Share on other sites

Du, sometimes I simply need to write it out to see the obvious answer;)  For a second there I was concerned about a viewing station dieing and adding a new system, but the answer there is to simply shutdown the server and fire it back up real fast!  No big deal. 
Link to comment
https://forums.phpfreaks.com/topic/36331-limiting-connections/#findComment-173001
Share on other sites

The very last line of my original posting when like this:

"Or would I simply be better off using the IP address considering this is a closed intranet?  I don't know, any  suggestions?"

Correct me if I am mistaken, but is not your reply simply an explanation of how to use the IP address?  If I am correct, then I would have to say, yes I did come up with the answer at the very end of my post.  I could have not bothered anyone with it and simply followed through with the thought process that you put in your initial reply.

Of course this is *NOT* to take away from your post, I do appreciate it. 

Dexter
Link to comment
https://forums.phpfreaks.com/topic/36331-limiting-connections/#findComment-173097
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.