|
Home > Archive > Apache Server configuration support > October 2007 > Configuring Virtual host in Apache
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Configuring Virtual host in Apache
|
|
| Sunil Chandrasekharan 2007-10-10, 1:32 am |
| Hello,
Can u please help me set up a virtual host in Apache that
points to two different directories on a single machine.
default machine
/usr/local/apache/htdocs
next directory : /usr/local/sunil/index.html
how can i configure my virtual host in Apache to enable me point to
two different directories or two different folders.
| |
| Kees Nuyt 2007-10-10, 7:40 am |
| On Wed, 10 Oct 2007 05:42:34 -0000, Sunil Chandrasekharan
<sunilsushil@gmail.com> wrote:
>Hello,
>
> Can u please help me set up a virtual host in Apache that
>points to two different directories on a single machine.
>
>default machine
>
>/usr/local/apache/htdocs
>
>next directory : /usr/local/sunil/index.html
>
>
>how can i configure my virtual host in Apache to enable me point to
>two different directories or two different folders.
We can help, but hey, you decided to manage a webserver,
so shouldn't you try by yourself first?
http://httpd.apache.org/docs/2.2/vhosts/ and the pages it
refers to are quite clear and do contain examples.
If you search the history of this group you will find many
more examples.
If it doesn't work, you can come back here with the error
messages you got and concrete questions.
--
( Kees
)
c[_] My software never has bugs. It just develops random features. (#51)
| |
| David McKenzie 2007-10-11, 1:34 am |
| Kees Nuyt wrote:
> On Wed, 10 Oct 2007 05:42:34 -0000, Sunil Chandrasekharan
> <sunilsushil@gmail.com> wrote:
>
>
> We can help, but hey, you decided to manage a webserver,
> so shouldn't you try by yourself first?
>
> http://httpd.apache.org/docs/2.2/vhosts/ and the pages it
> refers to are quite clear and do contain examples.
> If you search the history of this group you will find many
> more examples.
>
> If it doesn't work, you can come back here with the error
> messages you got and concrete questions.
Don't you think after reading the fmanual, he should then Google? Usenet
is not a personalised Google.
Then again, perhaps I missed a memo.
--
DM davidm@cia.com.au
'It would go against respecting principles and truth if you have to
respect and accept anything just because it is the other side's view.'
- Kim Jung Ill
| |
| Kees Nuyt 2007-10-11, 7:35 am |
| On Thu, 11 Oct 2007 16:20:08 +1000, David McKenzie
<davidm@cia.com.au> wrote:
>Kees Nuyt wrote:
[snip]
[vbcol=seagreen]
>
>Don't you think after reading the fmanual, he should then Google? Usenet
>is not a personalised Google.
Yes, you are right. That's why I said: "If you search the
history of this group you will find many more examples."
I meant, search Google groups.
>Then again, perhaps I missed a memo.
I didn't see more articles in this thread. You wrote the
third one ;)
--
( Kees
)
c[_] Building Contractors, not to be confused with homemakers (#90)
| |
| salmalalji@gmail.com 2007-10-23, 7:22 pm |
| On Oct 9, 10:42 pm, Sunil Chandrasekharan <sunilsus...@gmail.com>
wrote:
> Hello,
>
> Can u please help me set up a virtual host in Apache that
> points to two different directories on a single machine.
>
> default machine
>
> /usr/local/apache/htdocs
>
> next directory : /usr/local/sunil/index.html
>
> how can i configure my virtual host in Apache to enable me point to
> two different directories or two different folders.
I also would like to know how its done. I have one IP address but
would like virtual hosts to be able to redirect the traffic to the
correct folder depending on the url. i have read the apache docs, but
the config still doesnt work
NameVirtualHost *:80
<Directory />
Options All -Indexes
</Directory>
<VirtualHost *:80 >
DocumentRoot /var/www/html/example.one.com
ServerName www.example.one.com
ErrorLog logs/error_log
CustomLog logs/access_log combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin salma@wisecrack.ca
DocumentRoot /var/www/html/dev.example.one.com
ServerName dev.example.one.com
ErrorLog logs/dev_error_log
CustomLog logs/dev_access_log combined
</VirtualHost>
| |
| Kees Nuyt 2007-10-24, 7:35 am |
| On Tue, 23 Oct 2007 17:05:57 -0700, salmalalji@gmail.com
wrote:
>On Oct 9, 10:42 pm, Sunil Chandrasekharan <sunilsus...@gmail.com>
>wrote:
That's not a directory.
[vbcol=seagreen]
>
>I also would like to know how its done. I have one IP address but
>would like virtual hosts to be able to redirect the traffic to the
>correct folder depending on the url. i have read the apache docs, but
>the config still doesnt work
>
>NameVirtualHost *:80
><Directory />
> Options All -Indexes
></Directory>
>
><VirtualHost *:80 >
>
> DocumentRoot /var/www/html/example.one.com
> ServerName www.example.one.com
> ErrorLog logs/error_log
> CustomLog logs/access_log combined
></VirtualHost>
>
><VirtualHost *:80>
> ServerAdmin salma@wisecrack.ca
> DocumentRoot /var/www/html/dev.example.one.com
> ServerName dev.example.one.com
> ErrorLog logs/dev_error_log
> CustomLog logs/dev_access_log combined
></VirtualHost>
The config looks ok.
Anything in the logs?
Did you restart apache after the changes?
Does it run? Or does it refuse to start due to other
errors. Running httpd -t will check the correctness of
httpd.conf.
Do the directories actually contain a default document
(e.g. index.html or whatever you defined)?
Do the requests reach your box to begin with?
--
( Kees
)
c[_] Dyslexics of the World, Untie! (#457)
|
|
|
|
|