473,883 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I host multiple websites on a WAMP server?

3 New Member
I am new with Apache and I want to try this:

On a server (IP xx.xx.xx.xx) I would like to host multiple websites (www.website1.xxx, www.website2.yyy, www2.website3.z zz).

I have assigned www.website1.xxx and www2.website3.z zz the IP xx.xx.xx.xx.

In the www folder of the server I have Folder1 (for website1) and Folder2 (for website3).

Now, the problem is that no mather what adress you try to acces, the result is index from Folder1.
The code is as follows:

Expand|Select|Wrap|Line Numbers
  1. <virtualhost *:80>
  2. ServerName website1.xxx
  3. ServerAlias www.website1.xxx
  4. DocumentRoot c:/wamp/www/Folder1
  5. </virtualhost>
  6.  
  7. <virtualhost *:80>
  8. ServerName website3.zzz
  9. ServerAlias www2.website3.zzz
  10. DocumentRoot c:/wamp/www/Folder2
  11. </virtualhost>
I use WAMPSERVER on Win XP with Apache 2.2.11

Thank you!
Jun 2 '10 #1
5 6924
Niheel
2,456 Recognized Expert Moderator Top Contributor
Try this:

Go to your Hosts file:
"C:\windows\sys tem32\drivers\e tc"

Add this:
127.0.0.1 website1.xxx
127.0.0.1 website3.zzz
127.0.0.1 www.website1.xxx
127.0.0.1 www.website3.zzz

In your conf file use this:
Expand|Select|Wrap|Line Numbers
  1. NameVirtualHost *:80
  2. <virtualhost 127.0.0.1>
  3. ServerName website1.xxx
  4. ServerAlias www.website1.xxx
  5. DocumentRoot c:/wamp/www/Folder1
  6. </virtualhost>
  7.  
  8. <virtualhost 127.0.0.1>
  9. ServerName website3.zzz
  10. ServerAlias www2.website3.zzz
  11. DocumentRoot c:/wamp/www/Folder2
  12. </virtualhost>
note: 127.0.0.1 is the ip to most pc's local hosts
Jun 2 '10 #2
kufu
3 New Member
Is taking me to the root of www (c:/wamp/www/) for both adresses...

Why must make the modifications in the Hosts file?

Thanks!
Jun 2 '10 #3
Niheel
2,456 Recognized Expert Moderator Top Contributor
@kufu
It's the only way those domains will propogate to your local host. Make sure that those folders exist and that there are valid index.html files in there.

Try this: (added .htacces support and DirectoryIndex so it points to index.html file)
Expand|Select|Wrap|Line Numbers
  1. NameVirtualHost *:80
  2. <virtualhost 127.0.0.1>
  3. ServerName website1.xxx
  4. ServerAlias www.website1.xxx
  5. DocumentRoot "c:/wamp/www/Folder1"
  6. <Directory "c:/wamp/www/Folder1">
  7. allow from all
  8. order allow,deny
  9. AllowOverride All
  10. </Directory>
  11. DirectoryIndex index.html index.php
  12. </virtualhost>
  13.  
  14. <virtualhost 127.0.0.1>
  15. ServerName website3.zzz
  16. ServerAlias www2.website3.zzz
  17. DocumentRoot "c:/wamp/www/Folder2"
  18. <Directory "c:/wamp/www/Folder2">
  19. allow from all
  20. order allow,deny
  21. AllowOverride All
  22. </Directory>
  23. DirectoryIndex index.html index.php
  24. </virtualhost>
Jun 2 '10 #4
Niheel
2,456 Recognized Expert Moderator Top Contributor
Also, don't forget to restart all services on your wamp server after making changes! Important step.
Jun 2 '10 #5
kufu
3 New Member
No change...

But... if I try to access the addresses from local machine, I get only Folder1. If accessed from internet, I get /www index.

EDIT: after each change I restart the Apache server...
Jun 2 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2133
by: Kieran Kelly | last post by:
Is it possible to create a new Web Application Project using Visual Studio.Net 2003 on Windows 2003 Server but no in the Default Web Site. 1. I have created a new Web Site in IIS called WebSite2 and setting WebSite2 as the host header name. 2. I can browse to this web site using IE http://WebSite2 buy placing a an entry in my host file, 127.0.0.1 WebSite2. 3. I want to Create a new ASP.NET Web Application using Visual Studio.Net 2003 at...
5
3218
by: Jim Carlock | last post by:
I've set up the following using an Alias in Apache... Alias /phpdocs/ "C:/Apache/htdocs/common/docs/php/" <Directory "C:/Apache/htdocs/common/docs/php"> Options Indexes FollowSymlinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
0
1515
by: Ben K | last post by:
Is it possible to setup multiple SQL Server "listeners" like Oracle's so that I can have N X M mapping between LISTENERs and DB INSTANCEs? What I want is to partition access to one database, say "FinancialDB", through one port; but access to another database, say "HumanResourceDB", through another port. This way, I can setup a firewall locking down different client machines accessing the two databases.
0
1487
by: CNN_news | last post by:
I would like to run multiple instances of TYPO3 (a cms written in PHP) on a single server. You can run multiple websites in two methods: multisite or multiple instances. In multiple instance, each instance uses the same source files but has its own database and private file storage area.
1
1969
by: xoinki | last post by:
hi, I want to install multiple MySQL server instaces in my Fedora machine. I already have a 4.1.x instance running.. Now i want to install 5.2.x ALONG with that. if this installation causes automatic upgradation? I dont want this to happen. what are the steps I need to install another instance? plz help, Xoinki
3
1716
by: javelin | last post by:
Does anyone have any suggestions for synchronizing multiple websites? We have a dev server, a testing server, and a live server. Now, we have 3 developers, and we are having trouble tracking which files on which server are the latest. I know it should be obvious, but this is a bit complicated, as many of you may have experienced. Any suggestions for software and/or methods/techniques for file management?
0
2255
by: kishorealla | last post by:
Hello I need to create a web bot/crawler/spider that would go into different web sites and collect data for us and store in a database. The crawler needs to 'READ' the options on a website (either from drop-downs, radio-buttons or check-boxesand) to create some input itself OR use some generic pre-defined words (that we provide it with). For example, a webpage might be structure with a text field and some drop-downs. Typically, if the user...
4
2367
by: questionit | last post by:
Hi how can i write a javascript that will open multiple websites together. when the jaascript file is created and saved on the hard drive. when i double-click on it, it should open different websites that i type in the javascript code ? Thanks Qi
3
4539
by: teddarr | last post by:
I have a Windows Server 2003. I am trying to run multiple websites on the server. I have 3 different websites I'd like to run. Currently the default website is working but no others. All the domains have an a record pointing to the network router. The router is conficured correctly to send all website requests to my server. One the server and for each website I went to the IIS manager on the Websites tab and have the IP address set...
0
2453
by: teddarr | last post by:
I have a Windows Server 2003. I am trying to run multiple websites on the server. I am using host headers to run the websites on only one ip address. Before anyone says this is an iis issue and in the wrong forum, Please note that I have tested all the host header settings with a simple hello world html file and everything works great. I get a runtime error that tells me to change custom errors to "Off". The main problem is that custom...
0
9781
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10836
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10407
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9564
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7960
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4606
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4210
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3230
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.