I run a local server on my pc for managing and testing my websites. But presently I have 3 websites, so now I've to access them like * http://localhost/mydomain1/ * http://localhost/mydomain2/ * http://localhost/mydomain3/ Is there some software that allows me to install my different sites on different ports so that I can access my different sites with different ports like * http://localhost:1/ * http://localhost:2/ * http://localhost:3/ Also is it possible to access my site like * http://mysite1/ * http://mysite2/ * http://mysite3/ (See the missing extension) Any help will be much appreciated. Thanks for looking at the thread.
I use Xampp that runs as localhost on port 80 www.apachefriends.org Then I installed Abbys Webserver on port 8000 www.aprelium.com This way typing http://localhost:80, I get Xammp directory and typing http://localhost:8000, I get Abbys directory Occassionally I need a thrid server that installs itself in port 8080, www.badblue.com, though this is for file sharing The trick for automatic port assignment is keep running your default server while installing the second and third, although you can assign ports manually through their consoles. NOTE, you can also install Microsoft IIS as your third server that way
Is it necessary that I should install 3 webservers? Can I do it with one server? I mean like how the share hosting servers do it.
I have 3 different servers running due to different scripting/services provided but you can install a single one and either aliasing your directories or creating virtual hosts, just edit your httpd.conf file. For this purpose Xampp is your best option, in example <VirtualHost *:80> ServerAdmin webmaster@mydomain1 DocumentRoot /htdocs/mydomain1 ServerName mydomain1 ErrorLog logs/mydomain1 </VirtualHost> <VirtualHost *:8000> ServerAdmin webmaster@mydomain2 DocumentRoot /htdocs/mydomain2 ServerName mydomain2 ErrorLog logs/mydomain2 </VirtualHost> etc. etc. Code (markup):
Thanks a lot, I've started downloading Xampp. But, can I do the same with my current installation of Apache?
Yes, if you already have Apache installed then look for the httpd.conf file and edit it manually, then restart your server and you will be able to access your domains that way. If you need further reference setting up your virtual hosts check this out: http://httpd.apache.org/docs/1.3/vhosts http://www.onlamp.com/pub/a/apache/2003/07/24/vhosts.html
Now the local sites are working fine on my computer. Thanks a lot for you help. BTW, here is a little more detailed page on setting up multiple local sites. Hope someone may find this useful http://www.heritage-tech.net/336/setting-up-multiple-apache-local-web-sites-on-your-computer/