Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Installing WAMP on Shared Drive?

Status
Not open for further replies.

ghost2000

Programmer
Aug 30, 2005
6
GB
Hi,

Unfortuently we cannot afford a server so we've opted to have two computers (computer A and computer B) with a shared drive mapped to a network drive (I think its X via a network router.

I've successfully installed php, mysql and apache onto computer B, and I've made a custom virtual host for phpmyadmin so that it maps properly (ie: it says phpmyadmin.localhost) and this is the way I want to do all client work so it is ready to be ported over to the live server.

So, on computer B WAMP works fine. No problem.

However, I (on computer A) am having real difficulty seeing localhost from computer B. We want to work from the same drive, same WAMP, same windows hosts file/settings... and at some point I want to install tortoise SVN.

Last week somebody mentioned allowing Apache to be accessible via network from Windows Firewall and it worked perfectly.

I can see which is the IP address of my friends machine.

However, I can't see which, in theory should work fine.

I can't see unless my friend is logged in.

I understand that the .conf file has to be set up properly, but I do not know if I am doing it right...

Code:
Quote:
# SNIPNETS FROM HTTP.CONF FILE

ServerType standalone
ServerRoot "D:/Apache"
Listen 80 # IS THIS MEANT TO BE [URL unfurl="true"]http://192.168.15.101:80?[/URL]

#BindAddress * # WHAT DO I PUT HERE?

# Port: The port to which the standalone server listens.
Port 80

ServerName localhost
DocumentRoot "D:/Apache/htdocs"

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

### Section 3: Virtual Hosts

NameVirtualHost 127.0.0.1 # SHOULD I BE NAMING THIS SOMETHING ELSE?

# phpmyadmin
<VirtualHost 127.0.0.1>
DocumentRoot "d:/apache/htdocs/phpmyadmin"
ServerName phpmyadmin.localhost
</VirtualHost>

# SHOULD THE VIRTUAL HOST BE POINTING TO THE IP ADDRESS OF COMPUTER B?

I really am not sure what I am doing...

All I want to do is make Computer A and Computer B look and work from the same versions of WAMP. Is this possible?

Many thanks.
 
You don't have to worry about the BindAddress and port directives because they are both handled by the Listen directive now. If you have just one interface, then you don't need and address with the Listen directive because it listens for all addresses by default. The only time you need to put an address there is if you need to bind to a particular address, say because you have 2 NICs each having their own ip.

Using localhost as an address can create a problem when trying to access the server from another machine because that machine thinks its name is localhost also. When you request localhost, you are given access to the local machine via the loopback device (127.0.0.1). It is better to use the machines hostname for ServerName. When defining a virtual host, use the wildcard instead of the ip address. For example <VirtualHost *>. Mysql should be set to only accept requests from localhost for security reasons. As long as apache is on the same machine there will be no problem. I am talking about the daemons here. The data can be anywhere on the network.



 
Ah, so what you are saying is turn the virtual host to the wildcard and it should do something...

I'll try it later on today... Many thanks for your help.
 
Sorry, but it didn't work.

Using a wildcard works a bit - but not the way I want it.

Ideally I want a virtual host system which I can see/use and my friend can see/use.

Has it got something to do with DNS? We don't have a network administrator and I don't know anybody who is or will help in my situation.

If I try:

Code:
NameVirtualHost 192.168.15.101 # SHOULD I BE NAMING THIS SOMETHING ELSE?

# phpmyadmin
<VirtualHost 192.168.15.101>
DocumentRoot "d:/apache/htdocs/phpmyadmin"
ServerName phpmyadmin.localhost  #<-- how can this be x.localhost when localhost no longer exists?
</VirtualHost>

I even tried binding the address and emptying my windows HOST file..

But I still can't figure out how to make 2 machines look at the same x.localhost pathway.

Is there a way? Is there a website that shows how to do it? I tried reading the apache tutorial but found it is not written in plain, straigh-forward english.

Many thanks.
 
With that configuration, both computers should be able to see If your friend must be logged in, then Apache probably isn't running as a service, or isn't set to auto-start.

If you want to use x.localhost, then you have to be able to resolve x.localhost. If you have no DNS server, then create an entry in both computer's hosts file like this:

192.168.15.101 x.localhost
 
Ah I see...

Yes, you are right -- I can see 192.168.15.101

However, I want to be able to say go to "phpmyadmin.local" or something like that instead of saying go to "192.(etc)/phpmyadmin"

Besides I'd rather have a virtual host because then I have to change all the pathways for images from absolute to relative (or vice versa).

I changed my windows hosts file to look at 192.168.(etc) but it wasn't working properly.

I know a DNS server has to be involved somewhere - doesn't it already come with Windows XP Pro SP2?

I will try your idea now!

Many thanks.
 
No. Your hosts file will take care of resolving the address. After you added your web server you should be able to at least ping x.localhost and get replies from 192.168.15.101.

Getting "phpmyadmin.local" to give you " is something different. First, you must make the hosts entry so that phpmyadmin.local can be resolved. Then, you need a "NameVirtualHost" for phpmyadmin.local which will deliver the url that you want.

If you want to use a "normal", or address-based virtual host, then you'll probably need a secondary IP address on the web server.
 

Computer A Host File:
Code:
   # Computer A Host File
   192.168.15.101    x.localhost

Computer B (my computer) Host file:
Code:
    192.168.15.101    x.localhost

Is that right?
 
I'll try that today, I couldn't try that yesterday because it was late.

Hopefully I, with your help, will be able to crack this problem!

Thanks so far!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top