You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mehmet Fatih AKBULUT <mf...@gmail.com> on 2006/01/06 01:34:33 UTC

[users@httpd] Virtual Hosts help needed?

hi all,
i am a newbie on such subjects :)
but i want to ask something to you:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName debian
ServerAlias localhost
DocumentRoot /var/www/
</VirtualHost>

<VirtualHost *:80>
ServerName debian1
ServerAlias localhost1
DocumentRoot /var/wwwwww/
</VirtualHost>

these are my virtual host definitions and all i want to do is this :

i have two folders under /var/ which are /www and /wwwwww
and i want apache to show files under /www when 'http://localhost' is typed
on browser.
and to show files under /wwwwww when 'http://localhost1' is typed on
browser.

for 'http://localhost' everything is ok. but when i type 'http://localhost1'
get the error below :

An error occurred while loading http://localhost1/
Unknown host localhost1 ...

how i can achieve ?

Re: [users@httpd] Virtual Hosts help needed?

Posted by Mehmet Fatih AKBULUT <mf...@gmail.com>.
thanks G. Lams,
did it and now can use both hosts on my pc.
regards,
bye.

Re: [users@httpd] Virtual Hosts help needed?

Posted by Steffen Ronalter <st...@ronalter.de>.
Hi Mehmet!

You just have to create additional entries in your /etc/hosts file.
Actually it looks like:

127.0.0.1 localhost

if you add the following line, then you can reach your apache at 
"localhost1", too:

127.0.0.1 localhost1

The same can be done with every name that you would have for your local 
machine.

(in explanation to the following:)

G.Lams@itcilo.org wrote:

>>its too complicated then i thought :)
>>its my personal computer at home. dont know much about dns or apache :)
>>just trying to learn on my own.
>>i wondered how virtual hosts work. i mean how one can posses more 
>>than one domain one one disk :) 
>>    
>>
>
>If you want to use only on your computer, you could define the two hosts 
>in the hosts file of your computer (C:\windows\system32\drivers\etc\hosts 
>on windows, /etc on linux).
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosts help needed?

Posted by G....@itcilo.org.
> its too complicated then i thought :)
> its my personal computer at home. dont know much about dns or apache :)
> just trying to learn on my own.
> i wondered how virtual hosts work. i mean how one can posses more 
> than one domain one one disk :) 

If you want to use only on your computer, you could define the two hosts 
in the hosts file of your computer (C:\windows\system32\drivers\etc\hosts 
on windows, /etc on linux).

Regards,

Gaƫl

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosts help needed?

Posted by Mehmet Fatih AKBULUT <mf...@gmail.com>.
lol,
its too complicated then i thought :)
its my personal computer at home. dont know much about dns or apache :)
just trying to learn on my own.
i wondered how virtual hosts work. i mean how one can posses more than one
domain one one disk :)
as your reply means, i have to work a lot to learn such things ;)
regards,
bye.

ps: http://debian [my hostname or http://127.0.0.1] works fine, but debian1
is just something i defined in httpd.conf :) so i had better learn the usage
of bind or something like bind too :'(.
damn its too hard to progress :)

Re: [users@httpd] Virtual Hosts help needed?

Posted by David Salisbury <sa...@globe.gov>.
Opps.. hit the send button early.

Actually, what happens when you use the debian and debian1 names?  Do they work?

Personally, I don't know what the ServerAlias directives do?  You probably don't need them.

-Dave



----- Original Message ----- 
From: "Mehmet Fatih AKBULUT" <mf...@gmail.com>
To: <us...@httpd.apache.org>
Sent: Thursday, January 05, 2006 5:34 PM
Subject: [users@httpd] Virtual Hosts help needed?


hi all,
i am a newbie on such subjects :)
but i want to ask something to you:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName debian
ServerAlias localhost
DocumentRoot /var/www/
</VirtualHost>

<VirtualHost *:80>
ServerName debian1
ServerAlias localhost1
DocumentRoot /var/wwwwww/
</VirtualHost>

these are my virtual host definitions and all i want to do is this :

i have two folders under /var/ which are /www and /wwwwww
and i want apache to show files under /www when 'http://localhost' is typed
on browser.
and to show files under /wwwwww when 'http://localhost1' is typed on
browser.

for 'http://localhost' everything is ok. but when i type 'http://localhost1'
get the error below :

An error occurred while loading http://localhost1/
Unknown host localhost1 ...

how i can achieve ?



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Virtual Hosts help needed?

Posted by David Salisbury <sa...@globe.gov>.
I'm going to guess that you're just making up the name localhost1.

You will actually need a dns entry to your computer.  You might want to
talk to your system's administrator.

If you can't "ping" the name, apache wont be able to do anything with it.


----- Original Message ----- 
From: "Mehmet Fatih AKBULUT" <mf...@gmail.com>
To: <us...@httpd.apache.org>
Sent: Thursday, January 05, 2006 5:34 PM
Subject: [users@httpd] Virtual Hosts help needed?


hi all,
i am a newbie on such subjects :)
but i want to ask something to you:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName debian
ServerAlias localhost
DocumentRoot /var/www/
</VirtualHost>

<VirtualHost *:80>
ServerName debian1
ServerAlias localhost1
DocumentRoot /var/wwwwww/
</VirtualHost>

these are my virtual host definitions and all i want to do is this :

i have two folders under /var/ which are /www and /wwwwww
and i want apache to show files under /www when 'http://localhost' is typed
on browser.
and to show files under /wwwwww when 'http://localhost1' is typed on
browser.

for 'http://localhost' everything is ok. but when i type 'http://localhost1'
get the error below :

An error occurred while loading http://localhost1/
Unknown host localhost1 ...

how i can achieve ?



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org