LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-01-2004, 12:48 AM   #1
patrickclay
Member
 
Registered: May 2004
Location: San Antonio
Distribution: Slackware, Gentoo
Posts: 35

Rep: Reputation: 15
Starting a webserver using Apache


Hi. I recently bought a domain name through godaddy.com and I want to use my computer as a web server using Apache. I can start up apache just fine and I get my apache test page when I type "http://localhost" into my browser. What I don't understand, though, is how that relates to my recently purchased domain name. What's the missing link? When I type my domain name's address, how does it get to my computer? That's what I seem to be lacking...

This is probably the most basic question, but one has to start somewhere and I'm very new to this!


Thanks for your help!
 
Old 08-01-2004, 12:53 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Basically, translating names to IP addresses is the job of the Domain Name Service or DNS. When you go to your domain control panel page on your registrar, there will be a place for you to enter two DNS servers for your domain (each domain needs two authoratative servers in case one goes down). You probably don't want to run your own DNS unless you have two boxes with static IPs and the time to learn how DNS works in and out. If your Web server has a static IP address you can use one of the many free DNS services like www.zoneedit.com -- if it's a dynamic IP, a la most resedential DSL connections, you can get a dynamic DNS service like www.dyndns.org to handle things (their name servers will automagically update your IP address when it changes).
 
Old 08-01-2004, 12:54 AM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
is this what you're looking for??

https://www.godaddy.com/gdshop/faq/f...pic=Forwarding
 
Old 08-01-2004, 11:27 AM   #4
patrickclay
Member
 
Registered: May 2004
Location: San Antonio
Distribution: Slackware, Gentoo
Posts: 35

Original Poster
Rep: Reputation: 15
AH... I'm slowly starting to understand. Thanks, www.dyndns.com was definately the step in the right direction for me.

At dyndns.com, I registered two hosts: patrickclay.homelinux.com and patrickclay2.homelinux.com.
Both are pointed to my own IP address. I have the Apache server running and all in dandy in that capacity.

Yet again I come back to the same dilemma: How does my godaddy.com domain get in on this? Do I just have to forward my domain to point to one of the dyndns hosts I created or is there something else I can do?

Thanks for you patience!
 
Old 08-02-2004, 05:46 AM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
Quote:
Originally posted by patrickclay
How does my godaddy.com domain get in on this? Do I just have to forward my domain to point to one of the dyndns hosts I created or is there something else I can do?
if what you want is to use the domain you bought at godaddy.com with your dynamic home ip address, then you're gonna have to transfer the domain to something like no-ip or dyndns, as godaddy doesn't seem to provide that service...

http://www.no-ip.com/services.php/page/transfers

https://www.dyndns.org/services/domains/faq.html#86
 
Old 08-03-2004, 10:33 AM   #6
patrickclay
Member
 
Registered: May 2004
Location: San Antonio
Distribution: Slackware, Gentoo
Posts: 35

Original Poster
Rep: Reputation: 15
Is there any way to bypass my Linksys router? On my router setup page, there's something called port forwarding. Is that what I want?
 
Old 08-03-2004, 10:41 AM   #7
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
Quote:
Originally posted by patrickclay
Is there any way to bypass my Linksys router? On my router setup page, there's something called port forwarding. Is that what I want?
yeah, if you wanna have a web server on a machine on your lan (with an internal ip) and your linksys router is what has the public ip address, then you need to forward port 80 from the linksys to the web server on your lan...
 
Old 08-03-2004, 12:51 PM   #8
patrickclay
Member
 
Registered: May 2004
Location: San Antonio
Distribution: Slackware, Gentoo
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks for all the help!

If you're ever in San Antonio and you need your car washed or something, don't hesitate to ask - I owe you one! :-)
 
Old 08-20-2004, 03:45 PM   #9
maze_fire
LQ Newbie
 
Registered: Feb 2004
Location: B'ham, AL
Distribution: RH9 - Shrike
Posts: 25

Rep: Reputation: 15
Quote:
Originally posted by win32sux
yeah, if you wanna have a web server on a machine on your lan (with an internal ip) and your linksys router is what has the public ip address, then you need to forward port 80 from the linksys to the web server on your lan...
i was searching and this thread was about the closest that i could come to the problem i am having...it's probably something simple i am missing.. but.... :P

okay, i got two rh9 boxes...one is acting as dhcp server/default gateway.. i am using port forwarding with iptables... okay, the second rh9 box is being used as a webserver on lan side...

here's the problem.. when i forward port 80 to the rh9 web server box, i am able to hit the web page from outside lan (the internet) however, it kills http (web browsing capability) for the rest of the pc's on the lan, including if i try browsing the web from the web server, yet still being able to view the web page from internet... is there an iptables argument that i am leaving out or is there another default http port that i can forward form gateway to internal web server besided 80?

i did forward port 8080 and had no problems, but i don't want ppl to have to use http://mywebaddress.com:8080 to hit it...

thx in advance for help!!


maze_fur
 
Old 08-21-2004, 03:05 AM   #10
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
Quote:
Originally posted by maze_fire
when i forward port 80 to the rh9 web server box, i am able to hit the web page from outside lan (the internet) however, it kills http (web browsing capability) for the rest of the pc's on the lan, including if i try browsing the web from the web server, yet still being able to view the web page from internet... is there an iptables argument that i am leaving out or is there another default http port that i can forward form gateway to internal web server besided 80?

i did forward port 8080 and had no problems, but i don't want ppl to have to use http://mywebaddress.com:8080 to hit it...
hello maze_fire... no, you don't need to forward port 8080 to your webserver, that would be just too weird... you don't want people having to specify port numbers in a URL... of course, the web server itself can listen on any port you want, as long as the port you forward is 80... having said that, the issue you are having sounds like it's caused by the rules you are using for doing the forwarding... it sounds like your rules are affecting tcp --dport 80 packets on all interfaces... you only need them to affect incoming tcp --dport 80 packets on the internet interface...

could you post the rules you are using?? maybe even your entire iptables script??

;-)

in this example, the web server is running on port 3210, where it's fed the packets that come into tcp port 80 on the firewall:

Code:
iptables -A FORWARD -p TCP --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p TCP -i $INTERNET_INTERFACE --dport 80 \
-j DNAT --to-destination 192.168.0.2:3210
let me know how it goes... good luck...


Last edited by win32sux; 08-21-2004 at 03:10 AM.
 
Old 08-22-2004, 09:13 PM   #11
maze_fire
LQ Newbie
 
Registered: Feb 2004
Location: B'ham, AL
Distribution: RH9 - Shrike
Posts: 25

Rep: Reputation: 15
i tried the cmds you gave me and it still didn't work....btw, i need to correct what i said earlier... when i said that when i forward port 80 you can access the internal web server, that was a typo....i forgot that when i was testing it out, i still had httpd running on gateway

so anyways, unable to actually get the port forwarding to work just for httpd, but works for other apps, i.e., vnc, teamspeak & remote desktop

okay, here is my iptables script:

iptables -F -t nat

iptables -A POSTROUTING -t nat -o etho -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A PREROUTING -p UDP --dport 8767 -j DNAT --to-destination 10.0.0.100:8767

iptables -t nat -A PREROUTING -p TCP --dport 3389 -j DNAT --to-destination 10.0.0.100:3389


the last two lines are just examples of the successful port forwarding i was able to do...i even set the httpd to listen on like, port 3210 as in your example above, restarted the service, used the iptables cmds as in your example above and still no dice... thx again for help!

 
Old 08-24-2004, 11:44 AM   #12
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
could you post your entire iptables script please??
 
Old 08-24-2004, 11:49 AM   #13
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
also: is port forwarding enabled in your router's firewall?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Apache webserver name karupt Linux - Networking 2 08-02-2004 12:55 AM
Apache Webserver 403 Forbidden Errors (User not in apache group?) Mankind75 Mandriva 4 07-08-2004 06:30 AM
apache webserver nooodles Linux - Networking 8 06-30-2004 02:04 AM
apache webserver problem lomaree Linux - Software 4 05-26-2003 09:17 AM
Apache webserver trusouthrnplaya Linux - Networking 1 03-30-2003 12:34 PM


All times are GMT -5. The time now is 03:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration