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>
  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
2,456 Recognized Expert Moderator Top Contributor
Try this:

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

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

In your conf file use this:
Expand|Select|Wrap|Line Numbers
  1. NameVirtualHost *:80
  2. <virtualhost>
  3. ServerName website1.xxx
  4. ServerAlias www.website1.xxx
  5. DocumentRoot c:/wamp/www/Folder1
  6. </virtualhost>
  8. <virtualhost>
  9. ServerName website3.zzz
  10. ServerAlias www2.website3.zzz
  11. DocumentRoot c:/wamp/www/Folder2
  12. </virtualhost>
note: is the ip to most pc's local hosts
Jun 2 '10 #2
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?

Jun 2 '10 #3
2,456 Recognized Expert Moderator Top Contributor
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>
  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>
  14. <virtualhost>
  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
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
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

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, WebSite2. 3. I want to Create a new ASP.NET Web Application using Visual Studio.Net 2003 at...
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>
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.
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.
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
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?
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...
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
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...
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...
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,...
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...
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,...
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...
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...
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...
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
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.