SETTING UP UBUNTU 12.04.1 WITH JDK7, SVN AND OPENSSH FOR REMOTE MANAGEMENT CREATED 3RD OCTOBER 2012.
This tutorial sets up a remote server for the purpose of running Multiverse on the latest versions of software available to us. There will be changes needed to the Multiverse software and I am currently working on the modified Axiom engine to adopt these changes. The Axiom engine is almost ready for implementation into the project and modifications to the Multiverse coding will be done simultaneously. Anyone wanting to use this tutorial I would point out that it has been done for a standalone server and not a Virtual Machine. I have tried VMPlayer without success on windows 7 and in XP mode as well as WAMP in windows and Lamp on Ubuntu.
As of today this server works and the multiverse code as it currently stands runs the server after creation using standard tutorials, a number of errors do occur during creation and each is being hunted down. Once I have cured an error I will post it in this chain for others to use as my contribution to this project.
One rule though guys keep it as simple as possible. Chimes.
Those of us new to Linux or Ubuntu may learn a thing or too here, I know I did doing this tutorial. Youll come across the word "SUDO" a lot in here, It seems to be Super User DO the following function. If its not that then Im sure the Linux boys will point out the error.
Commands I've highlighted in red, key presses where necessary in blue.
I have installed in on a dedicated server Pentium 4 Quad Core, 4GB ram, 250GB HDD, just used motherboard resources, no additional cards. I did try VMPlayer on windows 7 and XP mode on windows 7 , it didn't work to well got errors all over the place and the server didn't like having its name changed.
The installation was done as follows:-
INSTALLING UBUNTUWipe hard drive original partition, by deletion, then secure wipe first 2% of disk space ( fill with zero`s to wipe any trace of former Master File Table and traces of formatting) this I found out by having to redo it all after deleting the partition left a previous Linux install in place, just wiped the partition data. I used Partition Wizard 7, you use whatever you like.
Ubuntu 12.04.1 using burned cd image from Ubuntu site for x86 server.
Servername multiverse
User name and password at users discretion, must be all small case for user name.
Set NO AUTOMATIC UPDATES
No additional plugins at this time
No Proxy set. DO NOT encrypt home directory.
Update and upgrade to current specs immediately on completion of installation.
sudo apt-get updatewait for the update list to finish
sudo apt-get dist-upgradeall done for the base installation.
--------------------
FIXING THE SERVER IP ADDRESSFirst restart the server and make a note of what name has been given to your Internet Adapter, usually it is "eth0" eth zero for those who cant decide between 0 and O. Been there, so your not alone.
now we open the networks interface and modify it
sudo nano /etc/network/interfacesNano is Linux version of Notepad in Windows.
Change last word of last line to
static instead of dhcp
My network has 5 top IP addresses reserved for other uses so make sure you know your numbers and dedicated IP addresses attached to MAC numbers, game consoles, daughters laptop etc
If you have facility to in your router/modem then assign each item including mobile phones with net access. Saves problems later on with daughter screaming about cant get on facebok etc.
Now add the following lines depending on your own network settings and setup, find these numbers prior to you editing this file. Gateway IP, Network IP (usually gateway Ip with last digit a zero),
Subnet mask and the Ip of the server you wish to use. Obviously change the numbers below to suit your system, these are just an example.
address 192.268.1.10
netmask 255.255.255.0
network 192.168.1
broadcast 192.168.1.250
gateway 192.168.1.1
dns-nameservers 192.168.0.1Nameservers in Ubuntu are no longer handled by "resolv.conf", try changing it, the file get overwritten each time. Yet one really stupid thing here is that when the initial disk is installed int puts the gateway IP in that file until the networking/ interfaces gets altered.
Some people may have an issue using 127.0.0.1 as this is the internal gateway handler and you would get better results using your routers gateway IP address or add any you normally use, one per line.
Save the file,
Ctrl+o then press
Enter and exit Nano
Ctrl+xRestart networking to adopt the changes made.
sudo /etc/init.d/networking restart --------------------
Ping a website to make sure of internet connection. Ubuntu 12.04 seems not to like people messing with /etc/resolv.conf any changes made get overwritten so the warning says so it got left alone. Additional nameservers add at your peril or if someone knows how to change it without it getting overwritten then add it as a reply please Id love to know how.
ping www.google.comhit
Ctrl+c to stop it
Successful ping, your ok to continue, unsuccessful, resart server and try it again after the restart, still getting nothing then check the ifconfig and make sure the gateway is open to the net.
--------------------
INSTALLING OPENSSH-SERVERInstall this as a useful little utility called PUTTY will alow you remote access on any windows PC to the server so removing the need to have a screen and keyboard attached. Its good and work, does just what it says on the tin.
sudo apt-get install openssh-serveronce installed you can sit in front of the TV and control the server off a laptop using PUTTY if you want, keep the wife happy that your spending time with them. also makes it useful to have the server put somewhere cool so long as you can hard wire it to the router, wireless linking I found to be a little crappy at times. Besides, wires are quicker.
From now onwards you can use PUTTY of any Windows PC to talk to the server, so if you want you can now switch it off, remove the keyboard and screen then restart it,
Get PUTTY from its home site,
http://www.chiark.greenend.org.uk/~sgtatham/putty/ If possible always get stuff from homesites, it is less likely to have been tampered with.
Putty is a standalone application so put it somewhere easy to find. You know the IP address of the server from earlier so just run it, enter the IP address of the server and click open, A box sometimes pops up, just answer yes, then login to your server with your user name and password. and there you are in your own server.
--------------------
INSTALL SVN (SUBVERSION)This ones easy
sudo apt-get install subversion --------------------
INSTALLING MYSQL-SERVERAnother tough one to install. While it downloading think of and write down in your trusty notepad so you dont forget, root password first, youll be asked to enter it in the install. Repeat the password when asked, good idea here as root is important use at least 10 characters, mix cases, letters and numbers. HENCE WRITE IT DOWN.
sudo apt-get install mysql-server --------------------
INSTALLING MYSQL-CLIENTAnother tough one for us new ubuntu users
sudo apt-get install mysql-clientQuick note at this point, INSTALL in the commands, I thought it just meant install the package when in actuality it looks on the main ubuntu server for the package named after it then runs its own install routine. Sorry for being a noob.
--------------------
INSTALLING ANTQuite what ANT is im not entirely sure yet but the wiki says to install it so it got installed.
sudo apt-get install ant ant-optionalIf someone knows what ANT actually does or is used for add a reply please and I can update this tutorial.
--------------------
INSTALLING THE JDK7Here's where I hit on the first hitch, so many false trails, links and commands from ancient versions it drives you nuts downloading the new JDK7, not one of them worked as they all didn't take into account the accepting of the oracle agreement prior to downloading from the tutorials links. however I did find a way round it in the end. Some bright spark even convinced me to uninstall openjdk6 and default java first before carrying on. Reformat and start again, screwed it up for internet, apt and a host of other programs, was easier to strip it and start again. OK, now Ubuntu 12.04.1 has had a facelift and some commands have been made sensible (OMG that means mere mortals can work it out and not just gods, well sorry but I'm a human and I like simple and Im only human, lol kidding guys). However it does have to have a few little tweeks here and there to get them to all work so here goes.
First add the new repository command system to ubuntu the old add-apt-repository has changed to apt-add-repositroy to bring it into line with the other commands, or so I read, which makes sense to me.
Sudo apt-get install python-software-propertiesthis has now given you the new
apt-add-repository function. Also adds apt-remove-repository function so I believe. Nice huh for us meer mortals?
You'll see why in a minute that its going to help. Obviously check the links work prior to using them. Its pointless trying to spend hours to get a download link to work that has been updated, I know I spent the whole weekend looking for working ways.
sudo apt-add-repository ppa:webupd8team/java check it with a google of "webupd8" and go to their website, things change.
During this youll be asked if you want to add it, choose yes if you do no if you dont.
This was the only direct untouched, needs no login, license agreement before you download way to get the JDK, you will get a couple of screen asking you to accpt the license, I can live with that, but messing around trying to make a script agree to a download before it lets you get to it or downloads a html page instead, sheesh. Obviously check the link first. This will get to be an old post one day. Things change.
sudo apt-get updatethis keeps the list up to date on where to find stuff.
Now before you go installing this next package and the repository you just added exists. If alls fine then continue, if not then adapt the next section to suit the new parameters.
So go ahead and enter. Java 8 SDK has been released on 30th Sept 2012 so if you want to use that then change the installer package below in accordance with the file name on the wepud8 teams site.
sudo apt-get install oracle-java7-installerDuring the installation of this package 2 automated screens should appear to accept the licenses etc, should they not appear for some reason, use the following command to accept the license.
sudo echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selectionsIf all goes well you've now got JDK installed, Now we have to check it is the default Java version, use the following commmand,
java -versionIf it says the version you just installed congrats and skip next step, If not then use next step
This will tell you which java package is currently the default. Should it NOT be the one you want then we have to change a number of settings possibly for jar javac and java.
sudo update-alternatives --config javachoose the manual java option by its number in the list if it isnt set already for the version you just installed.
--------------------
INSTALLING THE JAVA TO MYSQL CONNECTORThis has to be installed to make java and myql communicate to each other.
sudo apt-get install libmysql-java --------------------
REBOOT OR POWER DOWN THE SERVERUp to this point everything went well and without a hitch. I had loads of reformats to make sure this worked right every time, it did so I'm happy.
Anyone has any suggestions to improve on this then by all means add them as a reply. This version is purely the absolute basics for a remotely controlled server unit.
Take a break and reboot the server
sudo rebootor if you've had enough for the day
to use shutdown command you must be in Super User mode, simply type
sudo sunow you can shut the server down if you wish
shutdown now -P"shutdown" obviously shuts down the server, "now" tells it when but it leaves the power on, use + followed by a number for timed shutdown eg +15 would cause the server to shut down in 15 minutes and the -P which turns the power off after the server has shutdown. This is one of the many operations in Linux or Ubuntu that can only be done by a super user or in windows terms an administration not a user.
To get back to your user account simply anter
exitAt any point feel free to educate yourself with the command help system, just type say sudo --help or sudo --? be warned some scroll right off the screen like a flash.
I was going to incorporate Multiverse into this, but you all have more experience of it than I, plus Ive only got through about 60% of the files so far working out what each does. "A little knowledge is a dangerous thing" a quote I recall from my childhood and first coding experiences, if in doubt test it out on your own machine first, so I did, Ive spent the last 4 days getting this so it installs like clockwork with no errors or bugs in the installation. Just to make sure I've gone through this procedure 5 times to make absolutely sure I hadn't made any cock ups, works like a charm every time.
Hope this helps you all out to get a more stable server system and easier coding thanks to the new python properties. I shall make separate posts for the Axiom Engine and for the Multiverse system to run with this and have full remote access at the same time with as little hassle as is humanly possible.
Chimes.
Next chapter of installing Multiverse which should be simple, will be posted here as a link or available in main list as soon as Ive ironed out any bugs I find and cleared the rebuild with admin for use. But for now if you have any old pc lying around, absolute base pentium 3, 512mb ram, 60GB HDD should be more than enough to make a standalone sever on. A troll round a car boot sale may get you what you need if you want to get a standalone unit to play with. Sure the wife wont mind. lol.
------------------