Welcome to the Linux Foundation Forum!

Setting up an Apache web server

Hello all, I'm new to the community and have a few questions to ask.

Well first off I'll let you know what I'm trying to accomplish. I would like to set up an Apache web server to run run multiple sites off it. I currently have a domain that is being hosted by godaddy.com but I would like to set up a server so I can start learning how to do all the work myself.

I'm wouldn't say I'm a complete beginner with Linux because I've played around with it here and there so I know most of the basics.

I'm wondering what Distro I should go with. If there are any good beginners guides you could recommend. Is it possible to just drop the domain that I'm using now with godaddy and use my current IP? or should I just continue using the current domain I have now?

Another thing in the future I plan on using this same computer to run as a server, is it possible to have it running as a server as well as a web server and if I do that should I set up the server side first, then the web server?

I'll be setting it up on one of my home desktops that aren't use all hardware is current and up today

Thank you in advance. Any help is very much appreciated and once again thank you very much for any and all replies. I'm ready to learn :silly:

To follow the path: look to the master; follow the master, walk with the master, see through the master, become the master.

Comments

  • I haven't used GoDaddy, but I guess it does have a DNS Administration page where you can set the IP of your servers. Change that to point to the IP where you machine is hosted.

    If you are planning to configure a home server for this use, you may need to enable Port Forwarding on your Router(depending on your internet connection type).

    As for a distro of choice for server, any distro will suffice, but I would recommend you install something light, without X, Multimedia, etc. My Personal Choice for this is Slackware, but you can even go with Debian, CENTOS or Fedora.

    Configuring multiple subsites in your domain is a matter of setting virtualhosts in Apache. This is very wasy to acheive and you will have one example already listed in the configuration file to begin with. Note that you may also need to point the subdomains from the DNS Page to point to your IP. I acheive this by setting one subdomain to point to IP and one * to CNAME to the main subdomain.

    Hope this helps.
  • kryptikos
    kryptikos Posts: 61
    I agree with Sam. You won't really run into any difficulty. You can set your IP address with your registrar (go daddy) to point to your web server. Depending on your ISP policy for IP lease values you might want to explore setting up a static IP with your provider (that's your internet service not go daddy). Everything else you just configure in your virtual hosts.

    I found this link to a guy who uses go daddy and set up his Apache server to do something very similar. Hope it helps...

    http://palma-seo.com/dedicated-server-pacificrack.com-dns-apache-configuration

    Good luck!

    Cheers - Kryptikos
  • Wicked
    Wicked Posts: 24
    Yes this info very useful to me. I'll be getting the computer today to set up so I guess I'll just dive in and see if I swim. I've been doing some reaeach and I found out about and app that basically makes sure your dynamic ip us always current and up to date. That was one of the main things that confused me I wasn't sure when you set up a server if you used your ip from your computer or the one from go daddy.

    Is it possible to run a webserver/home server on one box? I

    Another thing what do you guys think about ubuntu server?
  • In my case, I use the connection of my home ISP(BSkyB). It usually doesnot disconnect unless the router is rebooted or someone has been using Torrents for too long. SO the IP remains stable.

    However I have a cron running that emails me the present IP to my gmail account every half an hour. Thus I can keep a tap on the changedf IP and change it accordingly in my DNS.

    However, i guess using serices like www.no-ip.com will be better in the long run.

    Ubuntu Server is good distro for server use as well and should be easier to setup.
  • kryptikos
    kryptikos Posts: 61
    Using Ubuntu server is fine. It is based on Debian and Debian is rock solid.

    Yes, you can use your server for multiple purposes. You can serve up a webserver and use it for whatever other things you'd like (i.e. email server).

    Just remember your webserver is public facing so it will be advertised to the world. You need to think about security too...run at a minimum a firewall between your router and your server, or be sure to configure iptables on the server.

    Cheers -
  • Wicked
    Wicked Posts: 24
    Thank you a lot guys I will also be setting up the security on it kryptikos. Or atleast trying to... I got a book on Linux security so we'll see how that works it was free so I'm not excepting much, yet hoping for the most at the same time.

    Beer in hand, my journey begins. It's time to enter the dark side. Wish me luck:woohoo:
  • No worries Wicked....let us know how it goes (or if you need more help) :)

    If you are running a GUI such as GNOME or KDE and you want a graphical firewall tool (sometimes helps while you are getting your feet wet) you can run Firestarter (http://www.fs-security.com/ or Guarddog (http://www.simonzone.com/software/guarddog/.

    Good luck!

    Cheers - Kryptikos
  • Wicked
    Wicked Posts: 24
    ok. I'm lost in this terminal. I think ive tried just about everything that I possibly can to try and get this working. I mean i know its partially working.

    Ok here it is. Apache2 is up and running i can ping it internally i can veiw my site internally everything internal is working fine. Now i set up my DNS( i think its right ) but obviously it isn't because I can do anything from out of the network. when i try to access my webpage from an outs source its a no go *Page can not be displayed*

    Im not really sure what im doing wrong. I've port forwarded 80 on my router set up everything inside of godaddy yet i keep getting page not displayed.

    Ok i'll give a list of all the files that i've modified if it helps any. Im not really sure where im going wrong. I've been reading reading reading most all say the same things maybe its just something im missing cause im new...

    Or could it be because the NS on godaddy is different from the NS that im using on my server?

    Ok so here are the names and the files that i have configured so far. Im so lost:dry: I managed to do all this through Terminal though so i guess i can give myself a pat on the back for that. Im getting weak tho i just might have to install gui, maybe it'll help me. I just thought i'd come see what you guys have to say or if you could point me in the right direction.

    Name.conf.local

    //
    // Do any local configuration here
    //

    // Consider adding the 1918 zones here, if they are not used in your
    // organization
    //include "/etc/bind/zones.rfc1918";

    #This is the zone defintion. Replace example.com with your domain name.


    zone "heero.com" {
    type master;
    file "/etc/bind/zones/heero.com.db";
    };

    #This is the zone definition for reverse DNS. Replace 0.168.192 with your networ#k adress in reverse notation- e.g my network address is 192.168.0

    zone "107.1.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/rev.107.1.168.192.in-addr.arp";
    };


    Named.conf.options

    options {
    directory "/var/cache/bind";

    // If there is a firewall between you and nameservers you want
    // to talk to, you may need to fix the firewall to allow multiple
    // ports to talk. See http://www.kb.cert.org/vuls/id/800113

    // If your ISP provided one or more IP addresses for stable
    // nameservers, you probably want to use them as forwarders.
    // Uncomment the following block, and insert the addresses replacing
    // the all-0's placeholder.

    forwarders {
    192.168.1.107;
    };

    auth-nxdomain no; # conform to RFC1035
    listen-on-v6 { any; };
    };

    Named.conf

    // This is the primary configuration file for the BIND DNS server named.
    //
    // Please read /usr/share/doc/bind9/README.Debian.gz for information on the
    // structure of BIND configuration files in Debian, *BEFORE* you customize
    // this configuration file.
    //
    // If you are just adding zones, please do that in /etc/bind/named.conf.local

    include "/etc/bind/named.conf.options";

    // prime the server with knowledge of the root servers
    zone "." {
    type hint;
    file "/etc/bind/db.root";
    };

    // be authoritative for the localhost forward and reverse zones, and for
    // broadcast zones as per RFC 1912

    zone "localhost" {
    type master;
    file "/etc/bind/db.local";
    };

    zone "127.in-addr.arpa" {
    type master;
    file "/etc/bind/db.127";
    };

    zone "0.in-addr.arpa" {
    type master;
    file "/etc/bind/db.0";
    };

    zone "255.in-addr.arpa" {
    type master;
    file "/etc/bind/db.255";
    };

    #zone " www.heero.com" {
    # type master;
    # notify no;
    # allow-query { any; };
    # file "my-site.zone";
    #};

    include "/etc/bind/named.conf.local";


    heero.com.db

    #Replace example.com with your domain name. do not forget the . after the domain#name! also, replace ns1 with the name of your DNS serve

    heero.com. IN SOA synergy.heero.com. admin.heero.com. (

    #Do not modify the following lines!

    2007031001
    28800
    3600
    604800
    38400
    )

    #Replace the follwing line as necessary:
    #ns2 = DNS server name
    #mail = mail server name
    #example.com = domain name

    heero.com. IN NS synergy.heero.com.

    #Replace the IP address with the right IP addresses

    www IN A 192.168.1.107
    ns1 IN A 192.168.1.107


    Rev.107.1.168.192.in-addr.arpa

    #Replace example.com with your domain name, ns2 with your DNS server name.
    #The number before IN PTR example.com is the machine address of the DNS server.
    #in my case, it's 1, as my IP address is 192.168.0.1

    address is 192.168.1.107
    @ IN SOA synergy.heero.com. admin.heero.com. (
    2007031001
    28800
    604800
    604800
    86400
    )
    IN NS synergy.heero.com.
    107 IN PTR heero.com
  • What is the set up in your router? Everything you reference in your conf file is using a private IP address (the 192.168). That's why it works perfectly locally (internally). What address are you pointing your go daddy DNS to point to?
  • Wicked
    Wicked Posts: 24
    Hey K,

    well in my router I have port 80 forwarded to the .107. I'm using an older router linksys and it's now very detailed like a few Dlinks ive seen. That's all I've done in the router, oh wait I also port triggered 80 aswell for the same ip.

    As far as godaddy this is how it looks

    Nameservers
    Nameservers:  (Last Update 8/1/2009)
    Xxxx.DOMAINCONTROL.COM
    Xxxx.DOMAINCONTROL.COM

    Manage
    Total DNS
    Total DNS: (Available)
    ARecord @ 192.168.1.107

    CNAME mobilemail Xxxx.prod.mesa1.secureserver.net
    CNAME pda Xxxx.mesa1.secureserver.net
    MX @ Xxxx.secureserver.net
    MX @ Xxxx.secureserver.net

    Total DNS Control
    TLD Specific
    Not Applicable

    now I was thinking to day while at work. Do I need to replace the godaddy nameservers with the ones I put for my nameservers in my conf files?

    I dont know if this is a stupid question or not but I'm going to ask. How do I eliminate godaddy all together? I would like to use just my webserver to do everything and just use the domain name that I own through godaddy? Would I have to switch everything around and no longer use my internal ip and instead use the ip if my FQDN? I've been doing a lot of reading but nothing really shows/or tells you how to get your www.whatever.com to display on the net not just on you LAN. This is where I'm confused. Is there more that needs to be set up?

    Just so you know I'm not looking for hand outs, I know a lot of people come to forums looking for some one to walk them by there hand step by step. I'm just looking for guidens, I have always been into Linux but never took the steps to dive in. Thank you very much
  • Wicked
    Wicked Posts: 24
    Ok I think im getting closer do you know what this could possibly mean.

    I cant access my actual site via WAN or Internet browser. BUT when i ping it or nslookup its connected to my ip address. This was done off of my lan

    Now heres the weird part that im not sure about if this makes a difference.

    When I do a nslookup within my lan these are the results that I get

    Server: cdbs1.cox.net <
    Should that be reading like that?
    Address:68.105.xx.xx<
    This is the DNS of my ISP

    Non-authoritative answer:
    Name: heero550.com <----which is my website
    Address: 68.224.xxx.xxx <
    which is my website
    Aliases: www.heero550.com <----which is website

    This one is off my lan
    Server mateokatie-PC <----Next doors internet :P
    Address: 192.168.2.1

    Non-authoritative answer:
    Name: heero550.com <---- website
    Address: 68.224.xx.xx <---- IP
    Address: www.heero550.com <---Website

    so I can ping it and nslookup and it returns with my IP address yet i cant get my IT WORKS! to show over the web..:blink: aiyoh.
  • No worries...it's always a pleasure to help folks who are truly interested in getting their hands dirty and working to understand everything they are doing instead of just showing up and asking for someone to do it for them.

    You're A record is incorrect. That is a private IP address which is illegal to route in the public address range.
    Manage
    Total DNS
    Total DNS: (Available)
    ARecord @ 192.168.1.107

    Since you have port forwarding on your router that will pass it to your webserver you should be good to go if you set up your router's IP address in the A record field instead of the 192.168 address. So you should have something that looks like:
    Manage
    Total DNS
    Total DNS: (Available)
    ARecord @ <router's IP..ie. 69.132.x.x>

    You should be able to get inside the router and see what IP was assigned by your ISP since it is dynamic. Use that for your Total DNS. It will hit the router and that traffic should be redirected.

    Let me know what happens and we can keep pushing to get it resolved for you.
  • Wicked
    Wicked Posts: 24
    Ok so I set everything up to my routers IP but still nothing. I thought this was kind of funny tho, I could access the site on all the other computers in the house except the actual webserver:S I'm going to do some reading and start over from scratch.

    I have a question tho before i start more research.

    Ok the godaddy account that im registered with has the total dns right, so in all my conf files would i be using their NS or should i just set up my linux box to do all the DNS it's self? Honestly i would like to do away with godaddy all together and just keep my domain name without using anything else from them.

    Because this is what im thinking and im not sure if its correct or not, but im thinking that there is a DNS issue some where and im not new to linux to figure it out. I mean if everything works fine internally even after setting up my site to have an A record of my external IP, then maybe i dont have the DNS set up properly on my box? idunno. back to the books because im just confusing myself now. :S


    Would you happen to have any good reading you could pass my way? Thanks for all the support Kryptikos.
  • Wicked
    Wicked Posts: 24
    I think i figured it out. after beating my head against the wall wonding why everything single thing i try doesnt work, now i start pointing fingers and the first to blame is my ISP. after doing a little research i found that COX blocks port 80. so now i guess ill have to try and figure out a way around that. its late 7 hours of hacking away on this black screen im beat....
  • ISPs have the tendency to be very annoying and not inform you what the block. That is a big reason I avoid Comcast like the plague (I know you have COX...a few friends of mine have their service and have not had the nicest of things to say. I've never used them myself).

    To answer your question, yes, if you want your server to be the authoritative DNS you would set your box up and the public facing IP as the NS.

    It's good to hear that you are determined and making progress. A few good reference points that I have used before are:

    http://www.aboutdebian.com/dns.htm

    http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch18_:_Configuring_DNS

    http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch19_:_Dynamic_DNS

    http://www.howtoforge.com/traditional_dns_howto

Categories

Upcoming Training