Help me setup Virtual Hosts, please

Help me setup Virtual Hosts, please

Post by Benjamin Wo » Sat, 22 Dec 2001 03:04:52



Peter..
i haven't done this with Mandrake..but Mandrake is just another
distribution of RedHat, and I've done it under various distros of RH.

assumption: you have a static ip address

go to /etc/httpd/conf
edit httpd.conf (by hand) - real men don't use gui's! :)
look for the entry <VirtualHost>:

Here, you should add a VirtualHost for each site you want to host in the
following format:

<VirtualHost ip.address>
ServerName www.VirtualHost1.com
DocumentRoot /var/www/VirtualHost1
</VirtualHost>

<VirtualHost ip.address>
ServerName www.VirtualHost2.com
DocumentRoot /var/www/VirtualHost2
</VirtualHost>

etc.

now go into /var/www and create a directory for each of the domains.. and
go for it..

(oops.. nearly forgot to tell you to do a service httpd restart)

I couldn't find the doc you referred to, but go and look in the
Apache-Overview-HOWTO

also look in the ISP-Setup-RedHat-HOWTO.

good luck.

b


> After 5 days of trouble with red hat (7.0-7.2) and suse's sorry ftp
> process, I D/L Mandrake 8.1 and got samba and a web server up.

> Now, I would like to run multiple web sites on one machine, I've
> searched the web (google) and apache web site, and as usual, the
> information is far from complete, so instead of 5 more days of trial
> and error, I've come to you experts for help.

> I've been to:

> http://httpd.apache.org/docs/vhosts/name-based.html

> and it kind of helps, but as usual I don't believe they are giving me
> all the necessary information.

> What I would like to know is:

> Which files need to be edited ?

> Can/Should this be done through the GUI (I doubt it) ?

> Has anyone done this with Mandrake 8.1, if yes, can you take me
> through the process ?

> and could some also provide me with:

> Working examples of the files used for Virtual hosting.

> Thank you, oh great experts !

> Peter

 
 
 

Help me setup Virtual Hosts, please

Post by peter pils » Sat, 22 Dec 2001 04:40:19



> After 5 days of trouble with red hat (7.0-7.2) and suse's sorry ftp
> process, I D/L Mandrake 8.1 and got samba and a web server up.

Using Mandrake 8.1 as webserverplatform on multiple server, but it never
stroke my head to actually blame any company that their free ftp-download
doesnt work. I would really appretiate if more people would pay the small
fee for the distribution they are using - especially when using on
comercial servers like you might do.

But I guess you just wanted to hear the answer to your problem ;)
Benjamin explained almost the whole stuff, but I missed one important line
before all this virtual hosts-entries:

NameVirtualHost  IP

hope this helps,
good luck,
peter

--
peter pilsl

http://www.goldfisch.at

 
 
 

Help me setup Virtual Hosts, please

Post by peter pils » Sat, 22 Dec 2001 20:44:46



> Thanks for your reply, I think mandrake uses a Vhosts.conf file, so
> now I'm not sure which to use or edit.

> I tried to do what you have listed and then nothing worked at all.

> Now, I have to access this web server from my local area network, so
> does that change anything ?

> ok, my linux machine ip address is 192.168.0.2, I've also named this
> machine "webserver", so when one types webserver into their browser,
> it goes to /var/www/html/index.html (website 1)

> web site two is called "apache" (it's the apache intro page that come
> with mandrake), I would like this to be website 2.

> How can I have multiple web sites from one machine without a real
> domain name (www.XXXXXXX.com) ?

So you want to have virtual hosting for your private lan ?
I would recommend setting up a nameserver first, where you can 'create'
real domainnames for your lan :
like webserver.local and apache.local
This step is mandatory, cause the computer somehow needs to know who apache
is. Maybe you could also do it very dirty with the hosts-file but I dont
think so.
Be sure not to mess around with your nameserver, ie:
* dont use any top-level-domains like com, org, net, biz ..
* dont let your named listen on your outside interface

you can download a very common nameserver at
http://www.isc.org/products/BIND/

and find a very detailed and helpful instruction under
http://www.linuxdoc.org

then use this domainnames in your http.conf for virtual hosting like
explained in the other postings or as explained very helpful under the
extended documentation at
http://www.apache.org

best,
peter

--
peter pilsl

http://www.goldfisch.at

 
 
 

1. Apache 1.3b2: Default Host and all virtual hosts serve only first virtual hosts pages?

Hello.

Have been running 1.2b8 for a intranet and decided to move upto 1.3b2. I
have several name based virtual hosts that have been working under
1.2b8. After compiling and installing 1.3b2 my virtual hosts do not
work. In fact what happens is that even though DocumentRoot and default
server name is different, eg: www.serverA.net pointing to /www/default,
Apache 1.3b2 will always take me to the first defined virtual host as if
it's locked to it no matter what virtual host I try to browse. What
gives? Please post and E-Mail.

In /etc/hosts for my machines IP address I have

A.B.C.D         www.default.net www.virtA.net www.virtB.net

In ../conf/httpd.conf I have;

<VirtualHost www.virtA.net>

DocumentRoot /usr/local/www/virtA
ServerName www.virtA.net
ErrorLog logs/virtA.error.log
TransferLog logs/virtA.access.log
</VirtualHost>

<VirtualHost www.virtB.net>

DocumentRoot /usr/local/www/virtB
ServerName www.virtB.net
ErrorLog logs/virtB.error.log
TransferLog logs/virtB.access.log
</VirtualHost>

--

2. Dell Latitude PCMCIA Modem help needed

3. Appropriate HTTP Error Code for "No Default Host" in Name-Based Virtual Host Setup

4. logitech mouseman wheel and F1 on the thumb button

5. FrontPage virtual hosting, removal or reset of virtual host

6. ipnat redirects

7. : How to prevent one named virtual host from "seeing" another virtual hosts files ?

8. C-Kermit compile fails

9. Mixing Apache Name Based Virtual Hosts and SSL Virtual Host

10. For Discussion: web virtual hosting vs mail virtual hosting

11. Apache and Virtual Hosts Question!! please help

12. Apache, FrontPage, and Named virtual hosts, Security, please help !

13. Help with virtual hosts setup