LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-04-2004, 11:37 PM   #1
c_mitulescu
Member
 
Registered: Nov 2003
Location: London
Distribution: Ubuntu
Posts: 35

Rep: Reputation: 15
Mandrake 9.2, hosting web page behind router on dynamic ip


Hi, not sure where to start with this... I have an ADSL Router with a dynamic IP address. Behind it sits the LAN. On the LAN I have one server from which I would like to serve web pages. I have configured NAT on the router to forward port 80 to the internal server address. I have also registered a domain name from no-ip.com and running their program on the server to update their DNS with my new IP address. I can now connect to my web server from the Internet by using the domain name.
The problem that I am having is that I have also configured Apache to serve pages from each user's directory, and when somebody tries to access ie: mydomain.com/~user the page is served but the address bar in the browser changes to 127.0.0.1/~user . Is it possible to configure the server somehow so that both the computer and Apache know they are on a domain (ie mydomain.com), so that the address bar in browsers always displays mydomain.com/blah/blah.
 
Old 01-05-2004, 12:16 AM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
You need to use virtual hosts on the apache server
 
Old 01-05-2004, 12:17 AM   #3
hypexr
Member
 
Registered: Oct 2003
Location: USA Fresno Callifornia
Distribution: Gentoo (workstation), ArchLinux (file/mail server), Freebsd (web server), Ubuntu (laptop)
Posts: 115

Rep: Reputation: 16
Hi,
Make sure that you have a line in your httpd.conf file that looks like this
ServerName server.name.com:80
Also check if it exhibits this same behavior when connecting from a computer that is not on your local network.
 
Old 01-05-2004, 05:38 AM   #4
c_mitulescu
Member
 
Registered: Nov 2003
Location: London
Distribution: Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
Thumbs up

I did change the ServerName in the conf file and it now works. Thank you.

I do have virtual hosting enabled. I have another question - If I wanted to set another domain name to point to my /home/username/www directory what would the syntax be. I had a look at the virtual hosting options but not sure how to change them to map a different domain to a user's directory, not to some directory in /var/www/html
 
Old 01-05-2004, 08:31 AM   #5
ugob
Member
 
Registered: Nov 2003
Distribution: RH, Fedora, Debian, Knoppix
Posts: 436

Rep: Reputation: 31
I have an example at work, just send me a reminder at ugob at camo-route dot com and I'll send it to you.

What I used to make it:

http://httpd.apache.org/docs/vhosts/

What I realized:

-When you make one virtual host, the main server seems to be ignored (so you have to make a virtual host directive for each domain.
-VirtualHosts seems to be treated in order in the file.
 
Old 01-05-2004, 06:59 PM   #6
c_mitulescu
Member
 
Registered: Nov 2003
Location: London
Distribution: Ubuntu
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks,
that's the problem I had when configuring virtual hosts. I included another virtual host for the original server and now I can use to domains on different directories.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic IP/web hosting microsoft/linux Linux - Networking 1 09-25-2005 01:54 PM
Help with Web Page Hosting and Apache2 Hambone_20003 Linux - Software 2 08-23-2005 08:31 PM
cannot access config web-page for adsl router tireseas Linux - Networking 6 03-19-2005 04:13 PM
Mandrake 9.2, hosting web page behind router on dynamic ip c_mitulescu Linux - Security 1 01-04-2004 11:38 PM
multiple web page hosting bytebrowser Linux - Networking 4 06-15-2003 03:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration