I would like to make my dev sites have port numbers. I thought I would just start at a certain number and increment by 1 every new site. The question is what number should I start with? I have know there are reserved ports at various numbers. Are there a range of numbers that can be assumed safe to use?
2 Answers
Wikipedia has an exhaustive list of well-known ports. You should probably pick something 1024 or greater that isn't already in use.
user983223 you can use ports bigger then 1024. Using virtual hosts is a better approach to building a good web development server. If you need more information on setting up virtual hosts let me know your OS and web server details, that way I will be able to help you.
-
3Running different sites on different ports makes it easier to restrict access to those sites with a firewall. This is probably an important consideration when running dev and prod sites on the same physical box.– MDMarraOct 27, 2012 at 23:39
-
1@MDMarra True, but Virtualhosts can be configured to listen only on local IP so they are not accessible from internet or on a local IP in a different subnet only accessible to the dev. So you can restrict the access this way easily too.– laurentOct 27, 2012 at 23:54
-
A better way to restrict access to a develpment website is by using .htaccess authentication, have you ever thought about it? have a look pagematic.com/faq/htaccess.htm (a random tutorial found on google)– HexOct 27, 2012 at 23:58
-
2Thanks for the link, but I'm familiar with .htaccess. Many people are more comfortable relying on firewall rules than software access control. An even better approach is to use both. Security is best handled in layers.– MDMarraOct 28, 2012 at 0:01
-
as @laurent said: the answer to your question is to set-up different ports for different websites using virtual hosts. If you dont know how, let me know– HexOct 28, 2012 at 0:04