Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Ubuntu - Setup Eclipse wiht Java EE, Maven for Spring development

Context

Starting with a new toolset requires a clean drawing board and - as I believe this is currently the best solution -be able to go back in time where things still worked ;-)
The aim is to create a VirtualBox VM with Ubuntu as OS.
The toolset to be installed for the development is Java (and EE), Eclipse, Maven, Spring) ... for now at least. I suppose a number will need to be added to the stack but I'll add them along the way.

Thanks to a number of sources I used to fall back in the need to sharpen (better but not to say is build) my knowledge of the Ubuntu Desktop environment. It's yet an other kind of Linux than the one I'm used to. (Redhat, Fedora, Oracle Linux ... )

Ubuntu is based on Debian and ... if I recall well Debian is also the basis for Mac OS X ...my platform in favour.


Software download links

  • Virtualbox : www.virtualbox.org
  • Ubuntu : 
  • Java JDK 7 : with apt get 
  • Java EE SDK : from oracle website
  • Eclipse : www.eclipse.org/downloads
  • Maven : 
  • Spring
  • Oracle Express Database ( https://forums.oracle.com/thread/2303639 )
  • vim  and vim-gnome via apt-get ( not needed but a personal favour)
  • Maven for eclipse (software install url to be used within eclipse) 
    http://q4e.googlecode.com/svn/trunk/updatesite-iam/
  • Spring IDE 3.4.0 Release (Software install and update url to be used within eclipse (can be found in the marketplace of eclipse) Google search arguments sprint ide 3.4.0 release eclipse marketplace, then click the download button on the right)
    http://dist.springsource.com/release/TOOLS/update/e3.7/
  • tomcat download
    wget http://mirror.atlanticmetro.net/apache/tomcat/tomcat-7/v7.0.29/bin/apache-tomcat-7.0.29.tar.g 

References

  • Install Eclipse with Maven for Spring development : See Eclipse Spring video's on Youtube. Free intros by Cave Of Programming (http://www.caveofprogramming.com)
  • Installation of Java on Ubuntu ... just to get the standard java version:
    http://askubuntu.com/questions/309900/installing-java-7-update-25-on-12-04-lts
  • Installation of Eclipse on Ubuntu:
    http://askubuntu.com/questions/26632/how-to-install-eclipse
  • Installation of Tomcat on Ubuntu 12.04
    https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04
  • Installation Oracle Express Edition
    http://askubuntu.com/questions/198163/how-to-install-oracle-express-11gr2

VM Creation

 Create Virtualbox VM with following specs:
 - 8 GB memory
 - 4 virtual cores
 - disk of 60 GB
 - nic connected to internet via NAT Network (new from 4.3 vbox)

Ubuntu 1204 LTS


Install from Iso File 64 bit
Install Ubuntu 12.04 LTS 64 bit
Update as far as possible

Oracle Java jdk 7


install java on ubuntu ... 
http://askubuntu.com/questions/309900/installing-java-7-update-25-on-12-04-lts
Steps to be executed :

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer


The first step adds the repository to the apt 'namespaces for repositories'
The next step will update the packages in the Ubuntu installation ... all of them. Took an hour to execute.
The last step finally installs the java jdk
Execute a java -version to verify the version of java your running now.

Oracle Java EE

Download from the Oracle website.
File is called : java_ee_sdk-7-unix-ml.sh

Uses the installed Java JDK
And installs also the Glassfish Middleware server from Oracle (Sun inheritance)

Glassfish server 4848

Starting domain
_______________
Executing command :/home/jhelling/glassfish4/glassfish/bin/asadmin start-domain domain1

/home/jhelling/glassfish4/glassfish/bin/asadmin start-domain domain1
Waiting for domain1 to start ..........
Successfully started the domain : domain1
domain  Location: /home/jhelling/glassfish4/glassfish/domains/domain1
Log File: /home/jhelling/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.


Java EE + Glassfish installation.

Please see the detailed summary report for an overview of this session, including next steps for using this installation.Please see the log file for detailed information.
 2013-12-15-01-29-install-summary.html 2013-12-15-01-29-install.log
Product Name
Status
Update Tool Bootstrap
Installed
GlassFish Server
Installed
Uninstallation Software
Installed
Update Tool Bootstrap
Configured
GlassFish Server
Configured

Eclipse

Advice to download Eclipse for Java EE Developers (Also for building web interfaces). The steps to install Eclipse on Ubuntu are xplained here:
http://askubuntu.com/questions/26632/how-to-install-eclipse

Optain maven for


Install the Glassfish tools for Eclipse
This is documented in the following post :
Steps:
  • open eclipse
  • in the Window > Show View > Servers
  • In the new opened pane right click and select New Server
  • Click in the link to download the additional server adapters
  • and ... wait ... 
  • From the list of providers select GlassFish tools (Oracle)
  • Install the software 
  • restart eclipse.
  • After restart go to the servers and add a new one
  • select as type the correct version of Glassfish server.
  • Select as install directory of glassfish the directory where it was installed
    (~/Glassfish4/glassfish)
  • Provide credentials ... ( by default leave the password empty )
  • The local server will be viewable in the list of the servers. 
  • Right clicking on the server will show a number of adminstrative actions that can be taken on the server and further on on the applications that will be installed.

VirtualBox Shared folders

I had some problems in using the method everybody seems to be using when wanting to share a folder between the WinXP host and the guest OS Ubuntu.

You may find everywhere that you need to execute the following command:
sudo mount -t vboxfs sharename mountpoint

This seems to give a protocol error.
On one of the fora there was an alternative that did work however:
sudo mount.vboxfs sharename mountpoint

This seems to work fine.
Thanks to entry found here.

Tax-On-Web op Ubuntu

Hieronder gecopieerde informatie over hoe op Ubuntu Linux naar taxonweb te kunnen gaan.

Onderaan volgt de link naar het originele artikel.

Eid / Taxonweb : Linux 1 - Windows 0

Tax-on-web op Ubuntu in 30 seconden:

$ sudo apt-get install libacr38u libacr38ucontrol-dev pcscd
$ sudo apt-get install beid*

Open /usr/share/beid/beid-pkcs11-register.html in Firefox, wacht even en klik op "Install". Er verschijnt "The "Belgium Identity Card PKCS#11" module is now registered."

Cardrreader verbinden, kaart insteken, surf naar http://www.taxonweb.be/ en je kan je belastingaangifte invullen. Op die tijd heb je met Windows net de driver voor je cardreader gevonden. ;-)
Als er nu nog iemand een oplossing kon vinden voor de x86-64'ers onder ons...

De link naar het origineel artikel:

Met de nodige groeten



VNCServer op Ubuntu Server/Desktop

This topic ... it was missing.
For the sake of all the Tims and Toms I still have some work here.
I want to point them for the moment to a number of documents that already exist and which I have used in the past to get it working on Ubuntu.
So here they come
http://ubuntuforums.org/showthread.php?t=795036

Ubuntu Server - Defining Screen resolution

Problem Statement

After installation Ubuntu servers screen is not in synch with the resolution of the display

Solution

Found this document on the internet.
Thanks to the author ...

The resume of this article is as follows:

Howto

The screen resolution is determined at startup ... when the kernel is loaded.
An option can be specified to the kernel to indicate the required screen resolution.
So ... three steps:
- determine parameter
- change menu.lst and the parameter
- reboot the system

Determine the correct vga parameter

Determine the argument using the following table
          640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
--------+--------------------------------------------------------------
4 bits | ? ? 0x302 ? ? ? ?
8 bits | 0x300 0x301 0x303 0x305 0x161 0x307 0x31C
15 bits | ? 0x310 0x313 0x316 0x162 0x319 0x31D
16 bits | ? 0x311 0x314 0x317 0x163 0x31A 0x31E
24 bits | ? 0x312 0x315 0x318 ? 0x31B 0x31F
32 bits | ? ? ? ? 0x164 ?
Look up the coorect vga indicator in the following table:

Edit the menu.lst file

Edit the /boot/grub/menu.lst file
Look for the correct line that defines the kernel to use with the correct options and if not already present add a parameter vga=0xyyy
The value 0xyyy is the vga parameter that you determined in step 1.

Reboot the system

Enter the following command:

#> reboot


A reboot is required to enable the setting.

Ubuntu Server - SSH configuration

Found the information on the following this link
Here follows a resume where I left out the sudo command because personally I always set a root password.

Check sshd service is running:

#> netstat -tulpln | grep -i ssh

Configure ssh port to something nonstandard

go to /etc/ssh
edit the sshd_config file (with vi for example)
Search for the keyword 'Port' which will be followed with 22 because this is the default
Change 22 to for example 512

Restart SSH deamon

#> /etc/init.d/ssh restart

Verify that the port is enabled by running netstat -tulpn | grep -i ssh again.

Firewall blocking

Verify with the following command that the port is open for connection through the firewall

#> iptables -L -n

This should give a list of all listening ports ... including as in the example 512.

If it is not in, configure it <>

Now you should configure your SSH client tool to connect to the server.

Look at this link to see how to configure PuTTY


Howto install Joomla on your very own Ubuntu Server

Credits for the one who earns it ...

I found this article on the internet and found it so interesting that I copied it to this blog.
Thanks for the person who wrote it : Mr Percival on the following link: http://www.parcival.org/2006/07/14/howto-install-joomla-on-your-very-own-ubuntu-server/
July 14, 2006 on 12:58 pm | In Computing |

You have a spare computer, you know that Joomla is a fairly powerful CMS, that Ubuntu is a really nice Linux distribution, and you’d like to combine all these things. So here is how it’s being done:

Make sure you are firewalled

We are going to install various services that can be accessed from users all over your network. However, I assume you want to keep out unwanted guests from the internet. Before you proceed, make sure that all ports are firewalled that connect you with the internet and no critical forwarding is active.

Download the necessary software

Download the Ubuntu server edition and the latest stable Joomla CMS.

Install Ubuntu

Burn the downloaded Ubuntu image onto a CD-R with your favorite CD writing program. (in most cases, burning an image to a CD is somewhere in the advanced section) On your spare computer boot from the newly created CD and pick the ‘Install LAMP’ option. This will install the Linux Apache Mysql PHP environment we are going to need to host our Joomla testsite.

Disclaimer: In the following sections, you are going to see the sudo command a couple times. sudo is used in Linux (and in Ubuntu particularly) so that an ordinary user can get admin/root privileges to maintain the system. I created a true root account (sudo passwd) in my Ubuntu so I don’t have to mess with sudo all the time. I tried to put the sudo into the following code wherever necessary, but I probably forgot it a couple times. If you want to execute a command and your Ubuntu refuses to do it, you probably need to add a sudo in front of it. :D

Upgrade Ubuntu

Free software is good, but it also has security problems just like any software that is being written. However, the good thing about free software is that those problems are minimal if you regularly update it. Luckily, this is fairly easy with Ubuntu, all you need is two commands:


#This will check online for the latest
#software packages and security fixes
sudo aptitude update
#This will download the latest packages of
#the software you already have installed
sudo aptitude upgrade

Repeat this regularly to ensure you have always the latest software and are protected from known exploits.

Optional: Add software that makes life easier

Sitting in front of that bare Linux screen may not exactly be what you consider to be fun and you probably want to manage and edit things from your own main desktop computer. To do so we need to install two more things and you can manage everything from your Mac/Windows/Linux computer. OpenSSH allows an encrypted = secure remote connection to your Ubuntu server. Samba allows you to access shares on your Ubuntu server similarly to remote Windows shares. We proceed to install:

sudo aptitude install ssh samba

You can also solely type sudo aptitude and browse a GUI to add/remove software if you prefer that.

Now you can remotely access your Ubuntu server with your Ubuntu username and password.

On a Mac, open the Terminal application (it’s in Utilities) and enter

ssh your_username@ubuntus_IP_address

On a Linux computer, proceed the same as on the Mac - I believe you already know where your terminal is. ;)

On a Windows computer, install putty and use this tool to connect to your Ubuntu server.

Now we still need to configure Samba so we are able to easily upload files onto our Ubuntu server. For this purpose we are going to edit /etc/samba/smb.conf with the nano editor (if it hasn’t been installed yet, do it with aptitude as explained above):

sudo nano -w /etc/samba/smb.conf

Now in this file you specifically want to pay attention to the to the homes share:

[homes]
comment = Home Directories
browseable = yes
writable = yes

Before anyone can do anything with Samba, we also have to create the necessary Samba account first:

smbpasswd -a your_username

This will enable access for remote users to their home directories. Let’s assume Slartibartfast has a Windows computer where he logs in with his name and password. He also has an account on your Ubuntu server with the same username and password and obviously also a matching Samba account. If that’s the case, Slartibartfast will be able to find in his Ubuntu home directory in his Explorer’s network neighborhood. (Mac Users: just hit Apple-K to mount the Samba share)

Setting up a place for your files to reside

Okay, now we have the Apache webserver installed. You can verify if it’s up and running by pointing your webbrowser to the IP address of your Ubuntu machine, e.g. http://192.168.0.1 This should load the generic Apache welcome site in your browser.

Next we need a place where you can store your (Joomla) files so they are being displayed when you attempt to open your site with your browser. In Ubuntu this is being done by creating a public_html directory in your /home directory. So do

mkdir public_html

in a terminal in your home directory or mount the samba share and create the directory in the file browser of your prference. When you have it, extract your Joomla files into it so that the index.php file and its fellows come to reside in your shiny new public_html.

In your home directory, also recursively set the proper read/write permissions (this is to ensure that Joomla can write the settings to disk):

chmod -R ugo+rwx public_html/

If it worked, the command ls -l will display read/write/execute permissions for all users on your public_html folder.

Next we are going to check if we can access the site in our web browser by adressing it with the proper username in the URL.


#generic
http://your_ubuntu_IP/~username
#example for user Slartibartfast
http://192.168.0.1/~Slartibartfast

Now you should be greeted with the screen that lets you start with the Joomla configuration. Before we can start the Joomla configuration, there is one important step left.

Create the necessary database

Joomla stores its content in a database, so we still need to setup the MySQL database in Ubuntu. First we need to create a valid MySQL user: (see also this and this chapter of the MySQL documentation)


#first we log into the MySQL shell
mysql --user=root mysql
#now we create same user TWICE
GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'localhost' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'your_username'@'%' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
#we exit the MySQL shell again
exit

According to mkr it’s also okay to add only the localhost user as long as the Apache, PHP and MySQL are hosted on the same machine. I haven’t tested that, but it does make sense. :)
Furthermore, it’s also wise to set a password for the root user in MySQL:


mysql -u root
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyPW');
exit

Once we have the user we need to create the tables that belong to him/her: (see also the Ubuntu server guide on Joomla)


#we create the database for your user
mysqladmin -u your_username -p create your_database_name
#we log into our database
mysql -u db_user -p
#we set the priviledges
GRANT ALL PRIVILEGES ON your_database_name.* TO 'your_username' IDENTIFIED BY 'your_password';
#we activate the new permissions
flush privileges;
#we leave the MySQL shell again
exit

Optional: phpmyadmin

You may be one of those users who doesn’t like managing MySQL databases in a terminal very much. Well, you are in good company. If you prefer to manage your MySQL from now on by means of your webbrowser, those additional steps will take you there:

nano -w /etc/apt/sources.list

remove the comment marks for the universe repository. This will allow you to install phpmyadmin:

aptitude update
aptitude search phpmyadmin
aptitude install phpmyadmin

After that you can connect to your MySQL Server and do all admin tasks by visiting the URL

http://localhost/phpmyadmin/

This is it

Now you should be able to setup Joomla in your webbrowser and start developping your website. If you ever feel like shutting down your server or rebooting it, this is how it’s being done:

#shutdown and turn off
shutdown -h now
#reboot
shutdown -r now

If you want to upload your website later on a professionally hosted machine where it’s accessible to the entire world, you need to perform the following steps:

  • In your Joomla settings, reconfigure the database name, database username, and database password to match the values provided by the hosting company. (see also the Joomla FAQ)
  • Load your files in public_html into the corresponding location provided by your hosting company by means of an FTP program.
  • Export your database as SQL syntax. Paste and execute the syntax into the database provided by your hosting company.
  • If everything went well, your Joomla should now properly work on the hosting company’s server.

With your little Ubuntu server you could also keep hosting your Joomla yourself and make it accessible to the entire world if you open the port in your firewall that Apache listens to. However, if you decide to do this be prepared to get attacked by those sick minds who have fun ruining other people’s property, so don’t do it yourself unless you are skilled enough to handle that kind of server yourself.

Update on hosting

I am done with my Joomla project and I am thrilled about it. However, I ran into a problem I originally did not consider: version conflicts. Doing your Joomla project on your Ubuntu server is a nice thing since you have a wonderful development environment - you have the latest stable version of everything. However, my hosting company does not. When I uploaded Joomla and wanted to make it run there, I first had to wade through a series of “has been depreceated” errors. Slowly I understand why one would want to host his websites on his very own server - it saves a couple headaches.

Ubuntu Server - Setting root password

By default Ubuntu Server has no password set for the root account. The account is locked until you set the password for the account.

This is done by executing the following command in a shell:

sudo passwd root

Then you have to enter the same password twice. From now on a su - will work ...

Ubuntu/Linux Server - Switch between tty's

Well for those not used to it and are always working on boring windows displays in stead of performant - back to basics and essentials - character based screens ...
There seem to be six of them.
At startup you are by default using the first.
By pressing ctrl-alt-Fx you can select any of the six tty's.
Ctrl-Alt-F2 will go to the second tty
Ctrl-Alt-F1 will go back to the first (the default in use)