Virtualhost configuration
I'm trying to set up my server so that I can have both my sites on it, pointing to different directories.
What is the virtualhost configuration I should set it to?
I tried adding some, but they didn't work.
Do I need a DNS server on here?
Thanks
zollet posted this at 18:42 — 27th June 2002.
He has: 1,016 posts
Joined: May 2002
You don't have to run your own DNS server. You could simply use your registrars (if they offer one) or a free service like mydomain.com
Once the domain is pointing to your server, you need to edit your Apache's configuration file and add a new virtualhost directive. You can find more information about this at http://httpd.apache.org/docs/vhosts/index.html
nike_guy_man posted this at 19:02 — 27th June 2002.
They have: 840 posts
Joined: Sep 2000
I already have DNS
I wanted to know if I needed some sort of DNS to point my domain to my folders.
I'll try that out
nike_guy_man posted this at 19:53 — 27th June 2002.
They have: 840 posts
Joined: Sep 2000
I'm doing something wrong
NameVirtualHost 68.55.169.109
<VirtualHost <a href="http://www.thenga.com" class="bb-url">thenga.com</a>>
ServerName <a href="http://www.thenga.com" class="bb-url">thenga.com</a>
DocumentRoot /web/html/thenga
</VirtualHost>
<VirtualHost <a href="http://www.e-ngl.net" class="bb-url">e-ngl.net</a>>
ServerName <a href="http://www.e-ngl.net" class="bb-url">e-ngl.net</a>
DocumentRoot /web/html/engl
</VirtualHost>
Why doesn't this work? Should I get rid of my regular DocumentRoot and use only the virtualhost?
Thanks
Mark Hensler posted this at 21:13 — 27th June 2002.
He has: 4,048 posts
Joined: Aug 2000
NameVirtualHost <a href="http://www.thenga.com" class="bb-url">thenga.com</a>
NameVirtualHost <a href="http://www.e-ngl.net" class="bb-url">e-ngl.net</a>
<VirtualHost <a href="http://www.thenga.com" class="bb-url">thenga.com</a>>
ServerName <a href="http://www.thenga.com" class="bb-url">thenga.com</a>
DocumentRoot /web/html/thenga
</VirtualHost>
<VirtualHost <a href="http://www.e-ngl.net" class="bb-url">e-ngl.net</a>>
ServerName <a href="http://www.e-ngl.net" class="bb-url">e-ngl.net</a>
DocumentRoot /web/html/engl
</VirtualHost>
Mark Hensler
If there is no answer on Google, then there is no question.
zollet posted this at 21:32 — 27th June 2002.
He has: 1,016 posts
Joined: May 2002
Assuming your IP is 68.55.169.109, you should have..
NameVirtualHost 68.55.169.109
<VirtualHost 68.55.169.109>
DocumentRoot /web/html/thenga
ServerName thenga.com
ServerAlias <a href="http://www.thenga.com" class="bb-url">thenga.com</a>
</VirtualHost>
<VirtualHost 68.55.169.109>
DocumentRoot /web/html/engl
ServerName e-ngl.net
ServerName <a href="http://www.e-ngl.net" class="bb-url">e-ngl.net</a>
</VirtualHost>
nike_guy_man posted this at 21:36 — 27th June 2002.
They have: 840 posts
Joined: Sep 2000
Tried them both, Mark's and Zollet's... neither worked.
Could there be something else in my httpd.conf file that is messing this up? the other DocumentRoot in it?
Just an idea though
Mark Hensler posted this at 22:57 — 27th June 2002.
He has: 4,048 posts
Joined: Aug 2000
BindAddress *
zollet posted this at 23:33 — 27th June 2002.
He has: 1,016 posts
Joined: May 2002
Yeah, make sure you have the BindAddress line. I just noticed a small error in what I poseted before..
ServerName e-ngl.net
ServerName e-ngl.net
..should be..
ServerName e-ngl.net
ServerAlias e-ngl.net
This is to that your domains work with and without www.
nike_guy_man posted this at 23:45 — 27th June 2002.
They have: 840 posts
Joined: Sep 2000
Could I also do it with the www or do have to not?
nike_guy_man posted this at 23:55 — 27th June 2002.
They have: 840 posts
Joined: Sep 2000
Still not working
Both point to /var/www/thenga
Why is one over the other?
Mark Hensler posted this at 00:16 — 28th June 2002.
He has: 4,048 posts
Joined: Aug 2000
try this..
# ports to listen to
Listen 80
# IPs to listen to
BindAddress *
#...
NameVirtualHost *
<VirtualHost *>
DocumentRoot /web/html/thenga
ServerAdmin [email protected]
ServerName www.thenga.com
</VirtualHost>
<VirtualHost *>
DocumentRoot /web/html/engl
ServerAdmin [email protected]
ServerName www.e-ngl.net
</VirtualHost>
Mark Hensler
If there is no answer on Google, then there is no question.
nike_guy_man posted this at 20:12 — 28th June 2002.
They have: 840 posts
Joined: Sep 2000
OK!
That worked fine for configuration... but it tells me that apachectl is an invalid command... is that a Mandrake thing?
Mark Hensler posted this at 08:15 — 29th June 2002.
He has: 4,048 posts
Joined: Aug 2000
No, I guess it's a unix thing.
It should be located ~/apache/bin/apachectl
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.