LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-16-2011, 01:20 PM   #1
cathycp27
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Rep: Reputation: 0
setting up centos as a webserver with a domain name purchased


I previously installed centos using DHCP. Now I purchased a domain name and want to set it up as a webserver.
if I choose the static ip address based on the existing DNS server given to me by the domain company, it will ask for the subnet mask, default gateway and i do not have them. Was the company supposed to give them to me?
Did someone has a step by step guide to set up a linux webserver?
 
Old 07-16-2011, 02:17 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
DNS is independent of those other networking parameters. They would usually be delivered by your ISP's DHCP server, and the dhclient on your server host should have applied them accordingly. You can view their present values with /sbin/ifconfig.

--- rod.
 
Old 07-16-2011, 02:22 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
you;ve not said a single thing about your environment, this is a home network? If so then the domain name you purchased has NOTHING to do with your home network whatsoever. you can probably stay using DHCP if it's still working for you, or you can just use the default route etc that you have from DHCP as the static details. Why would you think a domain registrar would give you a subnet mask?? that's just bizarre. Unless you are actually referring to some sort of strange VPS service you have with them, which I doubt is the case.

with your domain name you need to set up the appropriate DNS service that you are using with it to point to an external IP address which you can then forward on into your environment to hit your server of choice.

setting up a webserver - read standard Apache documentation and ask if you have *specific* issues.

The best advice I would give is to take the time to actually appreciate what bits are related to what. As above, your domain name has *NOTHING* to do with the server where your site is. These things are just independently configured to give an end to end result. This will help you a LOT.
 
Old 07-16-2011, 02:44 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I should add that the DHCP server will probably also serve up the IP(s) of any DNS server(s) that your local network can use. Again, the dhclient scripts should have applied these accordingly, and for CentOS installations, you can view the present settings in /etc/resolve.conf. Note that this has nothing to do with any domain name you have purchased; it tells your network where to lookup IPs by name.

Similarly, there is probably a gateway IP supplied by your ISP's DHCP server, and this can be deciphered with the route command.

--- rod.
 
Old 07-16-2011, 03:20 PM   #5
kasl33
Member
 
Registered: Oct 2004
Location: USA
Distribution: Ubuntu-Server, Mac OS X, Arch Linux
Posts: 356

Rep: Reputation: 48
On your server, connect to the internet and run the following two commands:

Code:
ifconfig
route -n
ifconfig will tell you your IP address that you received from the DHCP server, your subnet mask.
route -n will tell you what your gateway's IP address is (gateway being the router that you are connected to).

Hopefully you are connected to a router and not directly to the internet - because when you are connected directly to an ISP, you can't just randomly assign yourself an IP address - they have to assign you one. If you have purchased a static IP address form the ISP, then you can use that. Otherwise, your router will receive a DHCP IP address from the ISP and, since you probably use NAT, you probably have an IP address such as 192.168.1.11 or similar with a subnet mask of 255.255.255.0.

If you do have the 192 address (which is a private address that gets translated by the router into a public address when it passes through), then set your server up with a static ip address on the same network - like this:

IP: 192.168.1.100
Subnet: 255.255.255.0
Gateway: 192.168.1.1 (or 192.168.1.254 - whichever it is)

Next, you have to go into your router and set up port forwarding; traffic heading to your webserver is looking for port 80. So, port 80 gets forwarded to 192.168.1.100

Now, the most annoying part is, if you don't have a static IP address assigned by your ISP, then you will need to use Dynamic DNS. The easiest way to do this is hard to say. For me, I have a Linksys WRT54GS router and I have replaced the Linksys software with DD-WRT. DD-WRT has a DDNS (Dynamic DNS) section in its web interface that allows you to point to a DDNS host with your username and password. I use freedns.afraid.org which is free and easy to set up.

Let me know if I am even in the ballpark as far as the info you are looking for please.
 
Old 07-16-2011, 10:33 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,877
Blog Entries: 18

Rep: Reputation: 3344Reputation: 3344Reputation: 3344Reputation: 3344Reputation: 3344Reputation: 3344Reputation: 3344Reputation: 3344Reputation: 3344Reputation: 3344Reputation: 3344
If this is a home server and you are not paying for a static ip address from your ISP, you could use a service such as no-ip.com or dyndns.com to redirect queries to your ip address.

I used no-ip quite happily for about five years, first just for redirection using their free domain name service (username dot info), then for a domain I registered through them.

I finally moved to a hosting service because my little site outgrew my little server.

You also should check your ISP's policies.

Some ISPs, at least in the US, are quite hostile to self-hosting on a simple home-use account and will seek you out. The one I used to have before I moved had a policy that said, "No web hosting service" but in practicality was quite tolerant as long as you did not cause bandwidth issues or do anything illegal (I was going to take to position that self-hosting was not a "hosting service," if they ever complained, while shutting down if the asked me to). The one I have now actually blocks incoming port 80 (not an insurmountable problem, but a hassle) if you aren't paying for a business account.

It really is a gas to hit a webserver from a public location while knowing it's physically located in your guestroom.
 
Old 07-28-2011, 10:16 PM   #7
cathycp27
LQ Newbie
 
Registered: Jul 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you all for sharing your knowledge
 
  


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
Webserver domain name (www) MeccaOz Linux - Server 4 03-13-2010 04:18 PM
my purchased domain name used by seller rblampain Linux - General 3 01-02-2006 01:33 AM
Creating nameserver to resolve purchased domain to my computer techrolla Linux - Networking 11 07-30-2004 03:49 PM
Webserver for my registered domain singh_ravinder Linux - Networking 1 05-17-2003 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:37 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