Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • stCky: Palidinho is your OpenGL (was it OpenGL?) stuff open source anywhere?
      August 16, 2017, 09:07:22 PM
    • Travas:BUILD THE WALL
      August 15, 2017, 09:28:49 PM
    • Travas: i have ass cancer
      August 15, 2017, 09:23:29 PM
    • stCky: what are the fudge are you tryna ask?
      August 15, 2017, 08:21:35 PM
    • bader: what are the rsps community alive ?
      August 15, 2017, 05:46:16 PM
    • bader: yo guys
      August 15, 2017, 05:46:08 PM
    • Spacehost:[link] Updated our thread :)
      August 15, 2017, 09:40:34 AM
    • Adaro: The client is in Download section at Homepage
      August 15, 2017, 01:09:20 AM
    • FaTe_Of_GoDs: where do i get the client?????????????
      August 14, 2017, 05:23:14 PM
    • stCky: can anyone help me? I cant login to the shoutbox
      August 13, 2017, 05:45:15 PM
    • drubrkletern: appeal denied
      August 13, 2017, 02:35:27 PM
    • King_Trout:[link]
      August 13, 2017, 11:17:12 AM
    • Cole1497: no sorry
      August 13, 2017, 10:27:14 AM
    • ayz: yo can anyone explain something to me
      August 13, 2017, 08:08:51 AM
    • coolking12: Hi
      August 13, 2017, 04:16:06 AM
    • stCky: n+1
      August 11, 2017, 06:09:24 PM
    • PalidinoDH: How many more pages are going to show errors before this dude gets on and fixes shit
      August 11, 2017, 04:57:00 PM
    • stCky: it is made by the wonderful people at jetbrains
      August 10, 2017, 10:00:06 PM
    • Zoravon: what's the difference between that and eclipse?
      August 10, 2017, 05:59:52 PM
    • stCky: use an IDE like IntelliJ or shitclipse
      August 10, 2017, 05:33:01 PM

    Author Topic: Host a Server on Linux (Ubuntu)  (Read 28971 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineFat Cookies

    • Moparscape Vet
    • Global Moderator
    • *****
    • *
    • Posts: 3,833
    • Thanks: +0/-0
      • View Profile
    Host a Server on Linux (Ubuntu)
    « on: May 14, 2009, 03:45:15 PM »
    How to Host a Server on Linux


    You may have heard about Linux but if you have not heres a brief introduction: Linux is an open source OS (Operating System) created by Linus Torvalds however many organisations have added their own features and programs to it to create a distribution. These Distributions vary in complexity and size but the ones that are best known are Ubuntu, Feroda, Gentoo, Red Hat, SUSE, Slackware. There are over 300 in total so your never lacking choice like you do with Windows. Since Linux is open source and under the GNU General Public Lisence therefore everyone has access to the source code. This means that these OS's are incredibly stable and bug-free. (In the most recent Linux Kernel there were only around 900 bugs in all the 4.5 million lines of code, Windows XP on the other hand has around 20-30 bugs in every thousand lines. Thats a lot when you consider that XP contains over 40 million lines of code.) Ultimately if you run a private server on a Linux Distribution you will get a lot more out of your computer. That's enough explaining how Linux > Windows

    For this Tutorial we will be following Ubuntu since it is installed on many notebooks and is a very user-friendly: Perfect for a Linux newbie! On the other hand if you feel a bit adventurous and and not scared of a command line interface I advise you to use Arch Linux because it uses less resources that Ubuntu does and has a fantastic Wiki which explains everything perfectly which counts me out for explaining how to install and configure it.

    1. Getting and Burning Ubuntu to a disc

    You can obviously skip this step if you have already got Ubuntu installed on your computer.

    First of all you need to get the CD image of Ubuntu. Go onto the Ubuntu Download Page[/url] select your Location (Or the closest one) from the drop down box and then click "Begin Download"
    When you have downloaded the image you will need to download a image burning software. Download ImgBurn and install it. When you have it running you want to select "Write image file to Disc" select the Ubuntu iso file and click on the large icon at the bottom.


    If you already have such a program like Alcohol 120% or Nero just import the iso image and burn to a cd-r/rw or dvd-r/rw.
    Note: Ubuntu 9.04 (Current Release) is 715MB which means you must burn the image to a DVD.

    2. Installing Ubuntu
    WARNING: You have to remember that this is a whole new Operating System and if you dont "Dual Boot (Lets you have the option of running either Windows or Ubuntu on one computer) you may even delete Windows. Please refer to the guides on how to dual boot

    I wont give a detailed guide into installing Ubuntu onto your computer because I think the documentation on the site is more than enough.


    Something that isnt included is how changing your boot order that occasionally is necessary. To change the boot order on your BIOS you need to press "Delete" or "F2" or whatever key is assigned to "Setup", this should be shown with the logo of your computer manufacturer when you boot your computer.
    When you have pressed this key you should have a screen that looks on the lines of this:

    This is a basic Phenox BIOS(Very Old, notice the floppy disc drive and 4GB Hard Drive) . Yours might look similar or completely different.
    Don't worry if it looks different, as long as you can find the "Boot" menu (Might be under Advanced) you are OK. Remember you have to use the arrow keys! No mouse!
    Then you need to go onto Boot Order and put your CD/DVD drive First! and press the key for exit or the Save and Exit key.
    Now insert your freshly made Ubuntu CD and reboot.

    The rest of the Installation is pretty easy and the nice interface will guide you through (Its all graphical). If your stuck you can always refer back to the documentation.


    3. Installing Java (JRE and JDK)

    When you have finished the install process you should be presented with the GNOME desktop which is a nice interface that is very user-friendly. (I personally don't like it but many others do)



    As you can see at the Top there is a taskbar very similar to Windows Task Bar. You need to click on "Applications" then "Accessories" and Finally "Terminal"


    A window like the one above will pop up (expect it will be opaque and the first line will have your user-name which you created during the setup process). This program is much like command prompt (cmd.exe) on Windows however is used more often when you want to carry out tasking such as installing programs. Unlike Windows Ubuntu can install programs without even going to the Website on Terminal using the apt-get command.
    The most important command though is "sudo" which you will need to type before pretty much all commands in Terminal. Sudo gives you "Administrator" rights so you cant make major changes by accedent. You will be asked for your password when using this command.
    Before we download and install Java we need to make your the "Repository" (a place were a lot of cool programs are held) is up to date. First of all we need to check that the server settings are correct to do this we need to type:

    Code: [Select]
    sudo gedit /etc/apt/sources.list
    Then press enter.This will open gedit (Like Notepad) you need to make sure the following lines are included:

    Code: [Select]
    deb http://za.archive.ubuntu.com/ubuntu/ intrepid main restricted
    deb http://za.archive.ubuntu.com/ubuntu/ intrepid multiverse

    Save the file and then input:
    Code: [Select]
    sudo apt-get updateThis will update the list of programs so we can install Java.

    Once that is finished you need to input:
    Code: [Select]
    sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-pluginThis will install JRE and JDK with the Firefox plugin all at the same time. Its much quicker than manually downloading all those files from the Internet like you do on Windows.

    Unfortunately, If for whatever reason the above fails you can download the installer from Sun's website. You must go to the "Linux" section and select:
    Linux (self-extracting file)




    4. Opening Rar Archives

    Most people package their work in Rar archives and unfortunately by Default you cannot open these however you can install a program that can! Get back onto Terminal if you have closed it and type:

    Code: [Select]
    sudo apt-get install unrar

    After it has finished installing (it wont take long) you can start downloading rar files.
    When you have got your first Rar file on your desktop, the default download directory for Firefox, you must right click on it and select "Open with other Application. For illustrative purposes I provided a picture similar to what you will see:


    You now should click on "Use a custom Command" and type:
    unrar -x

    After this you can open all rar files like normal (In Ubuntu's compression program) and drag them do a folder just like WinRar.



    5. Setting Path and Classpath

    I should first mention that if you correctly installed java from the Repository you wont even need to do this step! However if any reason you cant update them you should run this command in Terminal:

    Code: [Select]
    sudo update-java-alternatives -s java-6-sun
    If further problems persist you can manually edit your environment variables by running the following:

    Code: [Select]
    sudo gedit /etc/environmentYou can replace gedit with sudo if you prefer it.

    Now find the two variables called PATH and JAVA_HOME.
    First find JAVA_HOME and then delete it if it exists and replace it with:
    Code: [Select]
    JAVA_HOME=/usr/lib/jvm/java-6-sun
    Now look for PATH and after the PATH=" add this:
    Code: [Select]
    $PATH:$JAVA_HOME/bin:



    6. Creating shell scripts to replace batch files


    With your source or client you now must now create a shell file (.sh) that does the same functions as a batch script (.bat .cmd) does, except it runs the commands in terminal. Now you have found the runserver batch script you need to open it in a text editor. You can use either gedit (an editor with a GUI and basic functions) or GNU Nano which is a very basic editor; its only useful when you are editing a couple of words and not running a desktop environment. To open in gedit just click on the file, for nano go onto Open with other Application and on the custom command box type "nano".

    You should see the normal stuff like:

    Code: [Select]
    @echo off
    color 0a
    title My Rubbish Server
    java -Xmx512m -cp server
    Note: server is the main class in this example, it could possibly be something else when running other servers/clients.

    For a shell script you keep the main command (java -Xmx512m -cp server) and get rid of the rest. Then at the beginning of the file add the following (All shell scripts should start off with this line.):

    Code: [Select]
    #!/bin/bash

    When you have finished editing everything it should look like this:

    Code: [Select]
    #!/bin/bash
    java -Xmx512m -cp server
    Now you just save the file using "Save as" and call it run.sh

    Then in terminal in the same directory run this command:

    Code: [Select]
    chmod -x run
    To run it double click on run and your Server/Client should run!


    To compile the basic syntax is:
    Code: [Select]
    #!/bin/bash
    javac *.java



    7.Sorting out your Router and DNS Server

    This is exactly the same as Windows!
    To access your router you type  (Or the default address of your router) and then make the necessary changes such as port-forwarding and adding exceptions to the firewall.
    You must remember that if you like using the no-ip duc program you must select "Linux/BSD/Unix"


    Have fun running a rs server on Linux.
    Ask any questions!

    This is unrelated to servers however I think if your running Ubuntu and want to run some Windows executables get Wine. (sudo apt-get install wine) Then open an .exe file with "Open with another Application" and use the custom command "wine". You can now try to run Windows executables as normal.
    .msi installer files are configured using the custom command "wine start"
    You should remember that your program is not guaranteed to work however you can search the application database on Wine's website to make sure.
    « Last Edit: July 07, 2009, 12:19:48 PM by Fat Cookies »





    OfflineTaharok

    • Member
    • ****
    • *
    • *
    • *
    • *
    • *
    • *
    • Posts: 7,524
    • Thanks: +0/-0
      • View Profile
      • Thornefall
    Re: Host a Server of Linux (Ubuntu)
    « Reply #1 on: May 14, 2009, 05:50:42 PM »
    Sure, why not. :|

    OfflineJc22493

    • Rock climber
    • Member
    • ****
    • *
    • Posts: 12,374
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server of Linux (Ubuntu)
    « Reply #2 on: May 14, 2009, 07:43:46 PM »
    Nice job.


    Offlineshapaklekas

    • Member
    • ***
    • Posts: 157
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server of Linux (Ubuntu)
    « Reply #3 on: May 15, 2009, 10:43:33 AM »
    OMG I SEARCH THIS TUT ABOUT 2weaks :D

    OfflineZillionair1

    • Member
    • ****
    • Posts: 415
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #4 on: May 15, 2009, 04:56:53 PM »
    So I could install Ubuntu onto my laptop, go to the F2 boot screen and change it to Ubuntu, my laptop would run faster and I could worry less about glitches?
    « Last Edit: May 15, 2009, 05:43:05 PM by Zillionair1 »

    OfflineSi Force

    • The beekeeper
    • Member
    • ****
    • *
    • Posts: 5,331
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #5 on: May 15, 2009, 05:25:27 PM »
    This is quite a good tutorial Fat_Cookies, I have a question though;

    When you're installing Ubuntu would it install it on all computer users, or just the specified one?
    There is a house in New Orleans

    Check out the Official Moparscape Server! Being developed by Sinisoul and Davidi2

    OfflineEfilite

    • Member
    • ****
    • Posts: 428
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #6 on: May 15, 2009, 05:28:56 PM »
    Thank you, now all I need to do is set up my virtual machine again.

    This is quite a good tutorial Fat_Cookies, I have a question though;

    When you're installing Ubuntu would it install it on all computer users, or just the specified one?

    You can set it up as a virtual machine, basically two computers on one machine.
    https://www.virtualbox.org/

    OfflineSi Force

    • The beekeeper
    • Member
    • ****
    • *
    • Posts: 5,331
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #7 on: May 15, 2009, 05:33:00 PM »
    Alright, thanks Efilite ;)
    There is a house in New Orleans

    Check out the Official Moparscape Server! Being developed by Sinisoul and Davidi2

    OfflineZillionair1

    • Member
    • ****
    • Posts: 415
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #8 on: May 15, 2009, 05:35:03 PM »
    So I could install Ubuntu onto my laptop, go to the F2 boot screen and change it to Ubuntu, my laptop would run faster and I could worry less about glitches?
    « Last Edit: May 15, 2009, 05:42:45 PM by Zillionair1 »

    OfflineEfilite

    • Member
    • ****
    • Posts: 428
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #9 on: May 15, 2009, 05:40:03 PM »
    So I could install Ubuntu onto my laptop, go to the F2 boot screen and change it to Ubuntu, my laptop would run faster and I'd worry less about glitches?
    Linux is open source, you can easily find glitches, but I recommend it to anyone who enjoy's messing with computers, windows is a bad idea to mess with, last week I wrecked my computer by editing the registry.


    OfflineZillionair1

    • Member
    • ****
    • Posts: 415
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #10 on: May 15, 2009, 05:53:53 PM »
    So I could install Ubuntu onto my laptop, go to the F2 boot screen and change it to Ubuntu, my laptop would run faster and I'd worry less about glitches?
    Linux is open source, you can easily find glitches, but I recommend it to anyone who enjoy's messing with computers, windows is a bad idea to mess with, last week I wrecked my computer by editing the registry.


    Thanks for answering my question and for the siggy =)

    OfflineFat Cookies

    • Moparscape Vet
    • Global Moderator
    • *****
    • *
    • Posts: 3,833
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #11 on: May 16, 2009, 03:34:56 AM »
    If look at Ubuntu's wiki you should find a section on how to dual boot. You have remember that your physical hard disk is split into Partitions (On Windows they appear to be separate disks like C: and D:)
    Therefore when installing Ubuntu on the Partitioning you should resize your current Windows (NTFS) to allow ~5gb space to make a new ext2,ext3 or ext4 partiton and a swap partition twice the size of your RAM. Furthermore later during installation you will need to change the GRUB bootloader to put your Windows onto the list

    Zillionair1, theres nothing wrong with recking your computer via the regestry, its how many viruses and trojans work.
    « Last Edit: May 16, 2009, 09:59:09 AM by Fat Cookies »





    OfflineEfilite

    • Member
    • ****
    • Posts: 428
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #12 on: May 16, 2009, 09:41:35 AM »
    So I could install Ubuntu onto my laptop, go to the F2 boot screen and change it to Ubuntu, my laptop would run faster and I'd worry less about glitches?
    Linux is open source, you can easily find glitches, but I recommend it to anyone who enjoy's messing with computers, windows is a bad idea to mess with, last week I wrecked my computer by editing the registry.


    Thanks for answering my question and for the siggy =)
    No problem, although I don't find the signature very funny.

    Offlinejumperscape

    • First Time Poster
    • *
    • Posts: 2
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #13 on: May 16, 2009, 03:12:20 PM »
    Usefull :)

    Offlinemr bob silab2

    • Member
    • ***
    • Posts: 133
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #14 on: May 19, 2009, 10:32:53 PM »
    Very very nice. I will have to learn a little more about how Linux runs but I think I am going to use this. I have a very old computer that I want to use as a hoster and win 98 is a disaster.

    OfflineFat Cookies

    • Moparscape Vet
    • Global Moderator
    • *****
    • *
    • Posts: 3,833
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #15 on: May 20, 2009, 10:51:41 AM »
    Very very nice. I will have to learn a little more about how Linux runs but I think I am going to use this. I have a very old computer that I want to use as a hoster and win 98 is a disaster.

    Well, if you have an "old" computer that can hardly run windows 98 I advise the either get a really lightweight distribution or disable the Window Manager on Ubuntu because GNOME eats a lot of RAM and CPU.

    To disable GNOME (X.org) at startup enter this into Terminal:
    Code: [Select]
    sudo update-rc.d -f gdm remove
    Now when you restart you will be not boot into a GUI but instead you will be preseneted with a CLI. You will have to manually navigate to your server folder (cd.) and run the shell file. This will be much more effcient than running your server in GNOME.

    When you are not running your server and want the GUI back just enter this command:

    Code: [Select]
    sudo update-rc.d -f gdm defaults






    OfflineMaxxxx

    • Member
    • ***
    • Posts: 229
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #16 on: May 21, 2009, 12:07:36 PM »


    Thanks this will be useful to members, :)


    Offtopic: Look how my mac 10.5 owns

    Which is stronger and much more tougher and elastic? a vagina or a dick?
    Code: AppleScript
    1. nerds x nerds = NERDS
    2.  

    Offlineziplock

    • Member
    • ****
    • Posts: 3,669
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #17 on: May 22, 2009, 08:54:18 AM »
    I use ubuntu and I love it more than any other OS. I'm glad I have it too, because I hated Windows.

    I inputed this command in the terminal.

    Code: [Select]
    sh Run.sh

    I got this output.

    Code: [Select]
    [email protected]:/media/disk/RSPS/client_Client$ bash Run.sh
    Run.sh: line 2: JAVA: command not found
    « Last Edit: May 22, 2009, 11:13:25 AM by ziplock »

    OfflineFat Cookies

    • Moparscape Vet
    • Global Moderator
    • *****
    • *
    • Posts: 3,833
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #18 on: May 23, 2009, 12:20:09 PM »
    Code: [Select]
    [email protected]:/media/disk/RSPS/client_Client$ bash Run.sh
    Run.sh: line 2: JAVA: command not found

    Change "JAVA into "java". I think thats the problem, If it persists repeat step 5





    Offlinedark magshin

    • Member
    • **
    • Posts: 73
    • Thanks: +0/-0
      • View Profile
    Re: Host a Server on Linux (Ubuntu)
    « Reply #19 on: May 25, 2009, 06:00:37 PM »
    long overdue tutorial. ubuntu is the best os i have ever seen. personally, i use xubuntu.
    -dark magshin (a.k.a. tom pwn3s y0)
    owner of fairyscape, http://thomasfarey.com/smf homepage at http://thomasfarey.com

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal