Last Shout - not visible
You are not authorized to view Shouts.

oZestretch

A GID that simply stuck
 
It is currently Tue Sep 07, 2010 6:28 am

All times are UTC + 9:30 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: networking and localhost setup-xampp-appache-vhosts-tutorial
PostPosted: Tue Apr 01, 2008 10:22 am 
Offline
Site Admin

Joined: Fri Jan 11, 2008 1:51 pm
Posts: 8
I have been searching google for over an hour and a half... could not find the total result i was searching for... one of the forums google sent me too had an admin guru tell me to google what i wanted and not be spoon fed.... was curious why he chose to offer help on forums if his generic answer is 'what did google say' and then to only find out that their web site gets high rank on google... and they say google isnt biased :shock:

anyways, the issue v solution:

i have installed xampp on on one pc on my home network... all set up and working great... enter pc#2 on the network, i wished to have no restrictions on which pc i needed to be on to access both xampp docs, and the sites themselves.

The Docs:
Is a simple matter of making that hard drive, or specific folder structure available across your network. XP navigatte to your folder or HDD.
'My Computer>right click the HDD or if its a folder on the HDD, navigate the HDD untill you come to the folder you want shared and right click it, select 'sharing and security' then click 'if you understand the risk but still want.... blahh blahh' then select the check box 'share this folder on the network' & 'allow network users to change my files'. - Apply

you can now access all your sites from any pc on the network and edit as you wish...

The Sites:
This part wont take too long, but if you have manyyyy pc's you want to have this option... ask google if there is an easier way, otherwise, the following will work, but is gonna take you a while :!:
Part1 - xampp apache setting
lets start with the PC xampp is installed on,
Open 'C:\xampp\apache\conf\extra\httpd-vhosts.conf'
if you have already altered this file, then make the adjustments for IP only.
chances are it looks like this
Code:
NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
  DocumentRoot D:/xampp/htdocs/
  ServerName localhost
</VirtualHost>


i changed mine like this
Code:
NameVirtualHost 127.0.0.1:80
NameVirtualHost 192.168.1.12:80

<VirtualHost xxx.localhost>
  DocumentRoot C:/xampp/htdocs/
  ServerName xxx.localhost
</VirtualHost>

2nd namevirtualhost is the network IP of the xampp pc.

next i have the site settings, use the relative paths for your sites location
Code:
<VirtualHost xxx.ozestretch.com>
  DocumentRoot "C:/WWW/Mine/ozestretch/site/public-html"
  ServerName xxx.ozestretch.com

  CustomLog "C:/WWW/Mine/ozestretch/site/logs/access.log" combined
  ErrorLog "C:/WWW/Mine/ozestretch/site/logs/error.log"

  <Directory "C:/WWW/Mine/ozestretch/site/public-html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

<VirtualHost xxx.site2.com>
  DocumentRoot "C:/WWW/Mine/site2/site/public-html"
  ServerName xxx.site2.com

  CustomLog "C:/WWW/Mine/site2/local-logs/access.log" combined
  ErrorLog "C:/WWW/Mine/site2/local-logs/error.log"

  <Directory "C:/WWW/Mine/site2/site/public-html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

you may have many more of these, i just use the 2 for the example.

Part2 - win hosts setting
staying with the xampp pc for now,
Open 'C:\WINDOWS\system32\drivers\etc\hosts' - use notepad/wordpad
you will probably have something like
Code:
#127.0.0.1   localhost

edit for:
Code:
127.0.0.1   localhost xxx.localhost
192.168.1.12   xxx.localhost

127.0.0.1   xxx.ozestretch.com
127.0.0.1   xxx.site2.com
192.168.1.12   xxx.ozestretch.com
192.168.1.12   xxx.site2.com

remember the 192.168.1.12 i used, should be the network IP of your xampp pc

ok, now stand up and stretch your legs as you make your way to the 2nd pc...
Open 'C:\WINDOWS\system32\drivers\etc\hosts' - use notepad/wordpad
you will probably have something like
Code:
#127.0.0.1   localhost

edit for:
Code:
192.168.1.12   xxx.localhost

192.168.1.12   xxx.ozestretch.com
192.168.1.12   xxx.site2.com

remember the 192.168.1.12 i used, should be the network IP of your xampp pc

if you have more machines, then go do the last step on them too.

to access xampp from the non xampp machine
http://xxx.localhost - can be same url for the xampp machine, but http://localhost will work on the xampp machine also.

access sites:
http://xxx.ozestretch.com
http://xxx.site2.com

hope it goes well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 9:30 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Template made by DEVPPL Flash Games
 
minig theme by Zeuder

MKPortal C1.2 rc1 ©2003-2008 mkportal.it