ok, no problem then, this is really easy.
you can store you website files anywhere on your server using this method. you do not have to place them in your wamp\www folder. what i do is crete a folder called users in my c:\wamp\www folder, and store my sites there. that way all the websites are stored in one main folder. if you follow my instructions below, we are going to be setting up 3 websites. so, open up your c:\wamp\www\users folder and create a new folder with the name of your first website. for this example I am using website1. now open up that new folder you created and create two folders there, one called logs, the other public_html. the logs folder is where we will instruct apache to store all error and access logs for this website. the public_html folder is here you will put all your website files (html, php, css, images, etc). here is now the file structure should look:
c:\wamp\www\users\website1
c:\wamp\www\users\website1\logs
c:\wamp\www\users\website1\public_html
now repeat those steps to setup your other two sites when you are done, that file structure should look like
c:\wamp\www\users\website2
c:\wamp\www\users\website2\logs
c:\wamp\www\users\website2\public_html
c:\wamp\www\users\website3
c:\wamp\www\users\website3\logs
c:\wamp\www\users\website3\public_html
for the next step you will need to know your ip address. if you dont know it, use myipaddress.com.
now open up your httpd.conf file in notepad. find
Listen 80
below it add:
Listen 81
Listen 8080
now search for this:
#NameVirtualHost *:80
change it to this:
NameVirtualHost your.ip.address.here:80
NameVirtualHost your.ip.address.here:81
NameVirtualHost your.ip.address.here:8080
<VirtualHost your.ip.address.here:80>
ServerName localhost
DocumentRoot c:\wamp\www\users\website1\public_html
ErrorLog c:\wamp\www\users\website1\logs\error.log
CustomLog c:\wamp\www\users\website1\logs\access.log common
<Directory c:\wamp\www\users\website1\public_html>
Options Indexes FollowSymLinks Includes
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
</VirtualHost>
<VirtualHost your.ip.address.here:81>
ServerName localhost
DocumentRoot c:\wamp\www\users\website2\public_html
ErrorLog c:\wamp\www\users\website2\logs\error.log
CustomLog c:\wamp\www\users\website2\logs\access.log common
<Directory c:\wamp\www\users\website2\public_html>
Options Indexes FollowSymLinks Includes
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
</VirtualHost>
<VirtualHost your.ip.address.here:8080>
ServerName localhost
DocumentRoot c:\wamp\www\users\website3\public_html
ErrorLog c:\wamp\www\users\website3\logs\error.log
CustomLog c:\wamp\www\users\website3\logs\access.log common
<Directory c:\wamp\www\users\website3\public_html>
Options Indexes FollowSymLinks Includes
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Directory>
</VirtualHost>
ok, so now when you access your website with your browser, [
localhost] will access website1. [
localhost] will access website2. [
localhost] will access website3
for security reasons, the way I have set this up is fof your websites to be only accessible by you. if however you wish to allow others to access your websites like a few friends or coworkers, you can change a setting to allow them to allow certain people then add their ip address to the allow list. for example, change
Order deny,allow
Deny from all
Allow from 127.0.0.1
to
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from friends.ip.address.here
for your friends to be able to access your website, they will need your ip address. when they access [
your.ip.address.here], they see site 1. when they access [
your.ip.address.here], they see website2. if they access [
your.ip.address.here] they see website3.
for each person you want to allow, add their ip address to the allow list. you can also allow anyone to access your websites (although for security reasons i advise you do not do this since wamp is not designed to be used as a production server) by changing this
Order deny,allow
Deny from all
Allow from 127.0.0.1
to this:
Order Allow,Deny
Allow from all
Post Edited (09-26-06 00:02)
CyberSpatium----------------------WAMP Forum Admin
Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.