Host your own website how to

Discussion in 'Linux' started by kghunt, Jan 5, 2009.

  1. kghunt

    kghunt

    Joined:
    Oct 12, 2008
    Messages:
    91
    Likes Received:
    0
    I want sure wether to post this in how to guides as it doesn't really just apply to the aa1. However I did do this on my own aa1 running fedora 10 xcfe first before moving it to another machine and these are my notes I made (with a bit more explanation). Feel free to pick holes (I am sure there are many) but I feel this is a useful guide as this is something I would have like to have done a long time ago but did not have a clue how to go about it.

    enjoy

    Websites are hosted on computers just like yours and mine (albeit alot more powerful with a lot faster internet connections) but essentially the same. How they work is when you type a web address (or domain name) a DNS server translates that address into a ip address and forwards your request to that address. Then the web server loads the website onto your browser. (that's the simple version anyway)

    So to host your own website you need a computer (which you do), a web server, a static IP address and a domain name. Now all of these things generally cost money but this guide shows you how to get around that with free alternatives.

    This guide assumes that you have a nix distro running already. But you need a web server apache is a free web service you can install on most os's and its easy to setup.

    install apache2 (in a terminal)
    #su
    #yum install httpd

    get a website i used a free template already designed for me (google is your friend "free web templates"). Copy the contents of the site to "/var/www/html" (I ran thunar as root to copy the website as the default use will not have write access to /var. fedora may be same in other distros but cannot be certain). Make sure that the site is in the root of /var/www/html and that index.html is there too.

    Now start httpd. Just type httpd in a terminal should do the trick.

    Goto http://localhost

    You should now see your website template load up.

    Now you have to make it visible to the outside world. To do this you will need a domain name and a static ip since they both cost money we will get the next best thing "dynamic DNS" a service whereby your ip is constantly updated to the DNS server these ddns services usually let you register a sub domain for free as well (2 birds one stone).

    Obviously you need to keep the ddns service updated of you current ip address so it knows where you are.
    There are 2 methods.

    Method one
    use your router, alot of dsl and cable modems/routers have a ddns or dynamic DNS setting in them if yours does then great. Sign up for a free account at http://www.dyndns.org and register a hostname. Input your hostname that you registered and your username and password into your routers ddns setup page save it and you should be laughing.

    goto
    http://www.hostname.whateverdomainyouchose.com

    and your page should load... anywhere in the world (as long as you pc is switched on of course)

    method 2
    use an ip updater there ar some under the support pages of dyndns.org. Install one and use your details to start updating.

    For the noobs the easiest way I have found is to use http://www.dnsexit.com as they have a nix client with a setup script to make the process easy. Create an account the same as with dyndns then download and install the rpm. Then run the setup script as root.
    #su
    #cd /usr/sbin/
    #./dnsexit-setup.pl

    The script will run. Input your login details when asked it will fetch your hostname for you. Choose it, set an update cycle finish the script.

    then start the program
    #/etc/init.d/ipUpdate start

    no your ip should be being updated to the dynamic dns site. So when people put in your web address it forwards them to your ip address

    as with method one now go to
    http://www.hostname.whateverdomainyouchose.com
    and your website should be there for the world to enjoy.
     
    kghunt, Jan 5, 2009
    #1
  2. kghunt

    Duck

    Joined:
    Mar 4, 2009
    Messages:
    1
    Likes Received:
    0
    This post is pretty dope, i've been meaning to do this for a while but never really bothered to look up
    how to do it, but now that I have linpus I decided to try it out.
    I've done it without a router before but never with my computer behind my router, I never knew it was so
    easy to configure.

    Wor,ks well, I use the touter method, one thing to note is you have to set up the virtual
    server settings in the router to point to your ip on your local network.

    thanks for the help! :mrgreen:
     
    Duck, Mar 4, 2009
    #2
  3. kghunt

    Scissors

    Joined:
    Feb 17, 2009
    Messages:
    149
    Likes Received:
    0
    Location:
    Lost in Port 8078
    can you show link some urls to any you host?
     
    Scissors, Mar 6, 2009
    #3
  4. kghunt

    kghunt

    Joined:
    Oct 12, 2008
    Messages:
    91
    Likes Received:
    0
    http://kghunt.homelinux.org/ i was hosting this domain on my aa1 by i reloaded now it points to me media centre. Same principle though.
     
    kghunt, Mar 7, 2009
    #4
  5. kghunt

    Ritchi

    Joined:
    Sep 8, 2008
    Messages:
    7
    Likes Received:
    0
    Hi, just found this and am trying it out.
    I have httpd installed and running, but once I submit a form on my index.html it passes me to a source code listing of my program(python). This suggests to me that it's not running? Although I'm new to this so not sure.
     
    Ritchi, Aug 25, 2009
    #5
  6. kghunt

    aa1brown

    Joined:
    Jun 1, 2009
    Messages:
    1
    Likes Received:
    0
    I kinda notice now that this was a thread from a while ago, yet hope to get the contributers advice.

    I basically found website baker portable, a great tool on the usb pen to edit websites offline. I have got this working great in windows,

    yet tried to get it working on the acer laptop with linpus lite. I ran it through wine and got this close,

    http://www.strudal.co.uk/images/website baker portable.png

    The program runs xammp and firefox.exe. I tried to change the browser to another linux browser, iceweasel. yet is there an alternative xammp for linpus that I can put on the usb stick. Would be great to get this working, thanks for any help, the package is here, http://www.websitebaker-portable.com/CMS/en/about-portable-edition.php?lang=EN

    I would like to make this up for linpus and support the guy thats made it, great tool to use.
     
    aa1brown, Oct 3, 2009
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.