Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if port 54007 is free before running web-server #9

Closed
GoogleCodeExporter opened this issue Aug 28, 2015 · 13 comments
Closed

Check if port 54007 is free before running web-server #9

GoogleCodeExporter opened this issue Aug 28, 2015 · 13 comments

Comments

@GoogleCodeExporter
Copy link

The default port for running php web-server is 54007, but
this port might already be occupied by another application
or by our application when running multiple instances. 
Therefore we should check if this port is free and if not
then generate a random port in the range 49152–65535, try
drawing for at least 100 tries until you find a free port.

How to check if port is free? Need to google it.

Original issue reported on code.google.com by [email protected] on 13 Jan 2013 at 5:13

@GoogleCodeExporter
Copy link
Author

I've just run multiple instances of phpdesktop and seems that
there is no problem running multiple php web-servers on the
same port. Why is that possible?

Original comment by [email protected] on 13 Jan 2013 at 5:22

@GoogleCodeExporter
Copy link
Author

Mongoose seems to be fine when running multiple instances of an
application with each instance starting web-server on the same port.

Original comment by [email protected] on 19 Jan 2013 at 6:04

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

See this topic on mongoose-users forum:
"How to check if port is free?"
https://groups.google.com/d/topic/mongoose-users/vBJ0bZHmOv8/discussion

Original comment by [email protected] on 2 Feb 2013 at 3:28

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Check also if "remote-debugging-port" is free. If not, generate some random 
port for that too.

Original comment by [email protected] on 24 Jan 2014 at 5:10

@GoogleCodeExporter
Copy link
Author

When launching a second application that has the same listening port set, then 
the content from the first application that started a webserver on that port, 
will be served. So this is some serious issue. If there are two different 
applications and we display application 1 content in application 2, then this 
is really bad.

Original comment by [email protected] on 25 Jan 2014 at 10:08

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Each instance of the same application should run on a different port, otherwise 
the --cgi-environment argument used to launch a second application instance, 
will not take effect as it is the first webserver that will be serving content.

Original comment by [email protected] on 25 Jan 2014 at 10:19

@GoogleCodeExporter
Copy link
Author

After a minor modification to mongoose sources, it now accepts port "0", 
thereby OS assigns a random free port. Now I need a way to get know the port 
that was assigned. Created a topic about that on mongoose-users group:

https://groups.google.com/d/topic/mongoose-users/spyD60wLcGE/discussion

Original comment by [email protected] on 25 Jan 2014 at 1:04

@GoogleCodeExporter
Copy link
Author

Fixed in revision 8091beb8d108. When port is set to 0 in settings.json, OS will 
assign a random free port.

Original comment by [email protected] on 25 Jan 2014 at 3:44

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Chrome 31.4 and MSIE 1.12 released.

Original comment by [email protected] on 26 Jan 2014 at 1:25

@GoogleCodeExporter
Copy link
Author

Project will move to Github. Find this issue at the new address (soon): 
https://github.com/cztomczak/phpdesktop/issues/9

Original comment by [email protected] on 24 Aug 2015 at 3:13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant