Hosting a webserver from home?

Discussion in 'Web Hosting' started by bigrollerdave, Jul 27, 2006.

  1. #1
    Okay I had some crazy Idea to just buy a server and host it from home. I know one down side might be downtime due to power outages and what not, but do you think this should even be done? I have a 10mb connection and the server would be prob a dual 3.0 xeon with 2-4gb of ram what kind of speeds could I expect from that? Lets just say the site would be your average forum site pretty mysql hungry and pretty active 2-3k uniques a day. Im just making that site up but would the site appear to be slow or would it run smoothly?
     
    bigrollerdave, Jul 27, 2006 IP
  2. mxlabs

    mxlabs Peon

    Messages:
    327
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    could be easily done on that kind of hardware. I serve up to 500 uniques per day on my 1.2Ghz Athlon.
    Before you buy the hardware you should check if your connection is stable enough. Small downtimes really add up fast when running a web host.
    As for power outages... uninterruptible power supply? But then again, I guess it depends a lot on the quality of your electricity network. We barely have any outages here in Europe for example.
     
    mxlabs, Jul 27, 2006 IP
  3. MattUK

    MattUK Notable Member

    Messages:
    6,950
    Likes Received:
    377
    Best Answers:
    0
    Trophy Points:
    275
    #3
    It's possible, though are you experienced in server management? If not the it's a non starter. Also you'll probably need a quicker line than a 10mb connection.
     
    MattUK, Jul 27, 2006 IP
  4. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Yeah I know a ton about servers and webservers I know it can be done I was just wondering if it would be too slow with the 10mb connection. Some hosts I've seen though only use a 10mb connection. Also I think I can signup for a business account and get a faster connection.
     
    bigrollerdave, Jul 27, 2006 IP
  5. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #5
    My connection is always on and it's stable really stable. Our power goes out once or twice a year due to bad storms but that's it really.
     
    bigrollerdave, Jul 27, 2006 IP
  6. Coolalex

    Coolalex Banned

    Messages:
    2,691
    Likes Received:
    160
    Best Answers:
    0
    Trophy Points:
    0
    #6
    as long as you have a battery you should be fine then.
     
    Coolalex, Jul 27, 2006 IP
  7. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #7
    I'm just worried about speed would it lag on the 10mb connection?
     
    bigrollerdave, Jul 27, 2006 IP
  8. mxlabs

    mxlabs Peon

    Messages:
    327
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    depends on your site. If you want to host downloads, it will lag of course. If it's just serving html and the occasional image, it could work out I guess. I never hosted something off a throttled line so I don't know for sure.

    If you are currently serving the same site off another server, you can install a bandwith cap on that server to match a 10mbit line and try that first.
     
    mxlabs, Jul 27, 2006 IP
  9. bigrollerdave

    bigrollerdave Well-Known Member

    Messages:
    2,112
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    140
    #9
    How would I go about doing that?
     
    bigrollerdave, Jul 28, 2006 IP
  10. wheel

    wheel Peon

    Messages:
    477
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #10
    You'll be fine. A 10mb connection is orders of magnitude more than you'll need. In fact you'd likely be more than fine with a .5mb connection. All of my hosting and server needs (outside of when I crawl for my search engines) use up less than 1mb - and I'm seeing millions of pages a month.

    I had a site go to 50-100+ visits per second and IIRC it cracked 6mbs. That's what I'm talking about :).

    If you remember the days of T1 lines, well a T1 line is only about 1.5mbs. In short, most people grossly overestimate what they need for webhosting. A home connection these days via DSL or cable is oodles more than even most hosting companies need.
     
    wheel, Jul 28, 2006 IP
  11. GeorgeB.

    GeorgeB. Notable Member

    Messages:
    5,695
    Likes Received:
    288
    Best Answers:
    0
    Trophy Points:
    280
    #11
    I host 2 myspace sites from my home. and of course my blog www.georgeboone.com

    I have them on a simple P4 Dell Poweredge 400SC with a gig of RAM.

    And a charter 2meg connection.

    I save absolutely ridiculous amounts of hosting bandwidth doing this. The downside is I can't play Halo online anymore because it lags :(

    But it's definitely worth it. Charter has been pretty reliable (that reminds me your ISP must not have a clause that says you can't have servers on your connection)

    Another plus is it's really cool to be able to work on files on my local system and not have to FTP them to a host :)
     
    GeorgeB., Jul 28, 2006 IP
  12. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Your 10MB connection means nothing if it's only 128KB up. When you are hosting you need a massive Upstream bandwidth, not downstream.
     
    T0PS3O, Jul 28, 2006 IP
  13. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,200
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #13
    Is that entirely true? Could you like by your own server and outsource server management?
     
    dcristo, Jul 28, 2006 IP
  14. mxlabs

    mxlabs Peon

    Messages:
    327
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #14
    that does not have to be by the way. you can use a traffic shaping script like wondershaper.
    Before using the script, I had pings up to 800ms when the server was busy, now I have rock stable 40ms no matter what :)

    
    #!/bin/bash 
    
    # Wonder Shaper
    # please read the README before filling out these values 
    #
    # Set the following values to somewhat less than your actual download
    # and uplink speed. In kilobits. Also set the device that is to be shaped.
    DOWNLINK=5500
    UPLINK=480
    DEV=ppp0
    
    # low priority OUTGOING traffic - you can leave this blank if you want
    # low priority source netmasks
    NOPRIOHOSTSRC='192.168.1.20'
    
    # low priority destination netmasks
    NOPRIOHOSTDST=
    
    # low priority source ports
    NOPRIOPORTSRC='7 20 25 80 3724 8080 3724 64925'
    
    # low priority destination ports
    NOPRIOPORTDST='7 6881 25 110 80 8080 64925'
    
    # Now remove the following two lines :-)
    
    
    #########################################################
    
    if [ "$1" = "status" ]
    then
    	tc -s qdisc ls dev $DEV
    	tc -s class ls dev $DEV
    	exit
    fi
    
    
    # clean existing down- and uplink qdiscs, hide errors
    tc qdisc del dev $DEV root    2> /dev/null > /dev/null
    tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
    
    if [ "$1" = "stop" ] 
    then 
    	exit
    fi
    
    ###### uplink
    
    # install root CBQ
    
    tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 10mbit 
    
    # shape everything at $UPLINK speed - this prevents huge queues in your
    # DSL modem which destroy latency:
    # main class
    
    tc class add dev $DEV parent 1: classid 1:1 cbq rate ${UPLINK}kbit \
    allot 1500 prio 5 bounded isolated 
    
    # high prio class 1:10:
    
    tc class add dev $DEV parent 1:1 classid 1:10 cbq rate ${UPLINK}kbit \
       allot 1600 prio 1 avpkt 1000
    
    # bulk and default class 1:20 - gets slightly less traffic, 
    #  and a lower priority:
    
    tc class add dev $DEV parent 1:1 classid 1:20 cbq rate $[9*$UPLINK/10]kbit \
       allot 1600 prio 2 avpkt 1000
    
    # 'traffic we hate'
    
    tc class add dev $DEV parent 1:1 classid 1:30 cbq rate $[8*$UPLINK/10]kbit \
       allot 1600 prio 2 avpkt 1000
    
    # all get Stochastic Fairness:
    tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
    tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
    tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
    
    # start filters
    # TOS Minimum Delay (ssh, NOT scp) in 1:10:
    tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
          match ip tos 0x10 0xff  flowid 1:10
    
    # ICMP (ip protocol 1) in the interactive class 1:10 so we 
    # can do measurements & impress our friends:
    tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 \
            match ip protocol 1 0xff flowid 1:10
    
    # prioritize small packets (<64 bytes)
    
    tc filter add dev $DEV parent 1: protocol ip prio 12 u32 \
       match ip protocol 6 0xff \
       match u8 0x05 0x0f at 0 \
       match u16 0x0000 0xffc0 at 2 \
       flowid 1:10
    
    
    # some traffic however suffers a worse fate
    for a in $NOPRIOPORTDST
    do
    	tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \
    	   match ip dport $a 0xffff flowid 1:30
    done
    
    for a in $NOPRIOPORTSRC
    do
     	tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \
    	   match ip sport $a 0xffff flowid 1:30
    done
    
    for a in $NOPRIOHOSTSRC
    do
     	tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
    	   match ip src $a flowid 1:30
    done
    
    for a in $NOPRIOHOSTDST
    do
     	tc filter add dev $DEV parent 1: protocol ip prio 17 u32 \
    	   match ip dst $a flowid 1:30
    done
    
    # rest is 'non-interactive' ie 'bulk' and ends up in 1:20
    
    tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \
       match ip dst 0.0.0.0/0 flowid 1:20
    
    
    ########## downlink #############
    # slow downloads down to somewhat less than the real speed  to prevent 
    # queuing at our ISP. Tune to see how high you can set it.
    # ISPs tend to have *huge* queues to make sure big downloads are fast
    #
    # attach ingress policer:
    
    tc qdisc add dev $DEV handle ffff: ingress
    
    # filter *everything* to it (0.0.0.0/0), drop everything that's
    # coming in too fast:
    
    tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
       0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
    
    Code (markup):
     
    mxlabs, Jul 28, 2006 IP
  15. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #15
    You can download Linux Fedora or Ubuntu Server, put in the disk, tick the server option and your LAMP server up and running in under half an hour.

    For hobby sites, it's fine (there are likely to be security holes if you're not a sysadmin legend so I wouldn't use it for high profile stuff - forum should be fine). I'm about to host my own blog at home as a Linux learning experiment.
     
    T0PS3O, Jul 28, 2006 IP
  16. MattUK

    MattUK Notable Member

    Messages:
    6,950
    Likes Received:
    377
    Best Answers:
    0
    Trophy Points:
    275
    #16
    Yeah you could do, but if youre going to go down that road you may as well have colocation
     
    MattUK, Jul 28, 2006 IP
  17. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #17
    And remember that besides a server, you'll need a firewall and a back-up device as well. Electricity isn't free unfortunately.
     
    T0PS3O, Jul 28, 2006 IP
  18. GeorgeB.

    GeorgeB. Notable Member

    Messages:
    5,695
    Likes Received:
    288
    Best Answers:
    0
    Trophy Points:
    280
    #18
    I'm on a Windows Server. :(

    I got a spare license from work that I'm "borrowing for testing purposes" for Windows 2003 Enterprise Server

    I found a good post on lifehacker that might help me here though so thanks for getting me thinking :)

     
    GeorgeB., Jul 28, 2006 IP
  19. GeorgeB.

    GeorgeB. Notable Member

    Messages:
    5,695
    Likes Received:
    288
    Best Answers:
    0
    Trophy Points:
    280
    #19
    Yeah if you know what you're doing linux iptables are easy to configure for good security. Whatever router you have will also have a built in firewall and of course you should only forward the ports you need forwarded to your server.

    UPS systems are pretty cheap on eBay and they can buy you a couple of hours but if your power is ever out for a full day there's not much you can do :) I've been doing this for years and I've never had a single day where my sites were down all day. I very rarely have outages.

    Also, DONT FORGET ABOUT DNS!

    I use www.dnspark.net. It's FREE but my myspace sites get so much traffic I had to fork over $9.95 for extra queries. They give you something like half a million queries free every month but if you pay $9.95 for one year you get 5 million queries per month.
     
    GeorgeB., Jul 28, 2006 IP
  20. mxlabs

    mxlabs Peon

    Messages:
    327
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #20
    ewww, Windows. ;)

    he doesn't really need external nameservers. could as well run BIND or some windows equivalent.
    I do
    ns1.mydomain.com A <my IP>
    ns2.mydomain.com A <my IP>
    mydomain.com NS ns1.mydomain.com
    mydomain.com NS ns2.mydomain.com

    it's not quite RFC compliant because it's only a single IP but if you are hosting from home, it's likely that nobody can access your server anyway if your DNS server does not answer ;)

    if you insist on an external DNS, free alternatives are
    zoneedit.com
    afraid.org
     
    mxlabs, Jul 28, 2006 IP