Mobile app version of vmapp.org
Login or Join
Angie530

: Making www.foo.com go to srv5.bar.net/~foo What I need accomplished is when a person out there in internet-land types in www.foo.com they are actually getting served content from srv5.bar.net/~foo

@Angie530

Posted in: #Apache #Dns

What I need accomplished is when a person out there in internet-land types in foo.com they are actually getting served content from srv5.bar.net/~foo

I have root access to both the nameserver ( bind9 ) and the webserver ( apache2 ).

( Yes, I do indeed use sudo rather than running as root )

I already know how to enable the UserDir module to make /home/foo/public_html into srv5.bar.net/~foo which is exactly what I want.

I can also config the A name in dns so that foo.com is by bar.net

I don't know how to make the connection of foo.com -> srv5.bar.net/~foo/ I don't even know what this is called to be honest. I don't want to use what I understand to be a cloak that simply puts what I want inside a frame that fills the window.

Just in case it's required, I'm on debian.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Angie530

2 Comments

Sorted by latest first Latest Oldest Best

 

@Pope3001725

I must apologize for having to ask this question. In my despair, I was able to find the answer... and it was indeed very simple. I wasn't able to close the question sooner though.

Create A name in dns pointing foo.com to bar.net

The magic is taken care of with apache.

Because each server has one public IP assigned to it... I need to use name-based virtual host in apache The info on this for anybody else who is as confused as I was can find it at

This allows one server to handle multiple websites.

10% popularity Vote Up Vote Down


 

@Chiappetta492

It's not possible to make the DNS redirect to an specific directory.
You have two options.

a. create a redirection from foo.com to srv5.bar.net/~foo using index.html

<meta http-equiv="refresh" content="0;URL='http://srv5.bar.net/~foo'">


b. you can setup apache to make /home/foo/public_html be the DocumentRoot for foo.com

Default document root for apache2 is /var/www.If you want to change
the default document root you need to edit the
/etc/apache2/sites-available/default file and look for this line
"DocumentRoot /var/www/" here you can change where ever you want to
change.For example if you want to change /home/foo/public_html the above line
looks like this "DocumentRoot /home/foo/public_html".

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme