943,552 Members | Top Members by Rank

May 5th, 2009
0

assign different web address for different webprojects on my localhost

Expand Post »
Hi
I am using Ubuntu linux 8.10

I have installed Apache, PHP and MySQL on my pc and testing all scripts on my localhost by http://localhost/ .

Currently I am creating directories for each web projects to test on my localhost. So my project can be access by http://localhost/project01/ and so on.
Example
http://localhost/project01 will access /var/www/project01
http://localhost/project02 will access /var/www/project02


There is some problems with server path in coding. When I would use file copy/paste process on my localhost, it requre path from root to work. And the path is different on my localhost and on sever.

So I think to use different domain name for different projects.
Example :
http://project01/ will access /var/www/project01
http://project02/ will access /var/www/project02

... or any other solution will be also welcome, so my localhost files and servers files are perfectly same.

Any guide for this?
Thank you.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
bimaljr is offline Offline
51 posts
since Oct 2006
May 14th, 2009
0

Re: assign different web address for different webprojects on my localhost

if you are okay with the apache name based vhost config (see end of the default httpd.conf for an example)

The name resolution (so your server knows its got other names) is also fairly simple.

You can add the extra names to your /etc/host file. This is generally used to find names for servers before DNS is touched (which is configurable) so you can use the same technique for testing actual domains locally if required.
Reputation Points: 10
Solved Threads: 3
Newbie Poster
Darkflib is offline Offline
11 posts
since May 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Servers and Apache Forum Timeline: Is the Linux Foundation Our NRA?
Next Thread in Linux Servers and Apache Forum Timeline: Looking for Linux: InterOp Las Vegas





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC