LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 02-20-2009, 08:15 AM   #1
nthillaiarasu
Member
 
Registered: Nov 2007
Posts: 39

Rep: Reputation: 15
multiple virtual host configuration in apache


How to give mulitple virtual host in apache.

I want to access all my sites with ip 192.168.1.125

For ex :if i want to access dpm.net it should have the ip 192.168.1.230 with port 80 & for persur.net it should have the same ip 192.168.1.230 with port 80

After restarting the apache servers.I am unable to run both the applications in a single time.

For that i gave

Include /etc/apache2/sites-enabled/[^.#]* in apache2.conf.

But still its not working.Please help me
 
Old 02-20-2009, 04:28 PM   #2
raconteur
Member
 
Registered: Dec 2007
Location: Slightly left of center
Distribution: slackware
Posts: 276
Blog Entries: 2

Rep: Reputation: 43
Place each domain's pages in separate directories in your DocumentRoot and modify httpd.conf to add VirtualHost sections:

For example:

Code:
<VirtualHost *:80>
     ServerName dpm.net
     DocumentRoot /var/www/htdocs/dpm
</VirtualHost>

<VirtualHost *:80>
     ServerName persur.net
     DocumentRoot /var/www/htdocs/per
</VirtualHost>
 
Old 02-20-2009, 05:10 PM   #3
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 120Reputation: 120
If I read your IPs correctly, you are trying to hand off to a different server?

If so, here's one way from the apache docs that works nicely
Code:
Using Virtual_host and mod_proxy together

The following example allows a front-end machine to proxy a virtual host through to a server
running on another machine. In the example, a virtual host of the same name is configured on
a machine at 192.168.111.2. The ProxyPreserveHost On directive is used so that the desired
hostname is passed through, in case we are proxying multiple hostnames to a single machine.

<VirtualHost *:*>
ProxyPreserveHost On
ProxyPass / http://192.168.111.2/
ProxyPassReverse / http://192.168.111.2/
ServerName hostname.example.com
</VirtualHost>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apache virtual host help? paddyjoy Linux - Server 4 09-19-2006 05:49 AM
apache and virtual host voip_tech_2004 Red Hat 1 04-12-2006 11:36 AM
Apache 2.0 Virtual Host? w0lfeyes Linux - Networking 1 05-03-2004 03:09 PM
Apache Virtual Host Configuration Crashed_Again Linux - Networking 1 12-18-2002 01:20 AM
apache virtual host mimi Linux - General 1 04-06-2002 05:11 AM


All times are GMT -5. The time now is 09:02 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration