Finally got my Raspberry Pi! The cheap $25/$35 board with 700Mhz ARM cpu, GPU, 256 mb RAM, dual USB, ethernet and a bunch of general purpose IO pins. Looking awesome in its bare metal and firing it up is no problem. I flashed an SD card with the Raspbian “wheezy” Linux distribution. To write the image to the SD card I used Win32DiskImager from a PC with SD card slot.
After attaching USB keyboard, network cable and HDMI it comes to life by using a micro USB as power supply. The diods flashes and even X runs quite smooth on this limited hardware.
However, after playing around I soon realised I will be much more comfortable working on a distance from my ordinary desktop machine. So how to enable ssh?
A lot of tutorials talks about something as simple as this to enable ssh daemon on boot.
sudo mv /boot/boot_enable_ssh.rc /boot/boot.rc
Sorry, I have no such files in my /boot directory. Furthermore, when trying to start the ssh daemon with
/etc/init.d/ssh start
it refuses to start. Clues in the startup log are
Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_dsa_key
Why these are corrupt I don't know, but it's easy to regenerate them.
ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
Make ssh daemon start permanent
sudo update-rc.d ssh defaults
A sudo reboot and everything seems ok.
Now, my mission for tonight was to get a web server running on the chipset. Here's what you need to do to make Tomcat 7 run.
Tomcat obviously need Java:
sudo apt-get install openjdk-6-jdk
And you obviously need a potent editor
sudo apt-get install vim
Clean up your installs to save some space on the SD card
sudo apt-get clean
Now, download, unpack and install Tomcat
wget http://mirrors.axint.net/apache/tomcat/tomcat-7/v7.0.28/bin/apache-tomcat-7.0.28.tar.gz
tar xzf apache-tomcat-7.0.28.tar.gz
cd apache-tomcat-7.0.28/conf
vim tomcat-users.xml
Add a user to the authorization file, directly below <tomcat-users> add
<user username="system" password="raspberry" roles="manager-gui"/>
Now start Tomcat
cd ../bin
sudo sh startup.sh
Nice! From your PC (or via a browser on the Pi) surf against the Tomcat console.
http://192.168.1.90:8080/
(Figure out the ip address via for example ifconfig)
It takes a short while to warm up the server but then you can login via Manager App. Now, it's business as usual. Upload a war archive and you have a nifty web server running you web application, for $35!
Works like a charm!
ReplyDeleteThanks! It saved me an evening.
What about performance?
ReplyDeleteDoes it work (fine), for example, running a little webservice?
Thx!
Good post!
ReplyDeleteYou wrote: "I flashed an SD card with the Raspbian “wheezy” Linux distribution". I've readed, this version of the OS doesn't support Oracle JVM, you have to install the Soft-float Debian “wheezy”.
But you have installed the openJDK. The Raspbian wheezy version works fine in this case? Thanx in advance!
Yeah, I haven't noticed any problems with OpenJDK. I'm not an expert, but isn't the codebase pretty similar these days? Most differences are in the proprietary codecs etc which you can't GPL?
ReplyDeleteOn performance: The performance is decent. Can't imagine any problems running an standard webservice.
Thanks for the post! I flashed the SD with the Soft-float Debian “wheezy” image and installed the Oracle Java Embedded Runtime 1.7.0_10, but other than that followed this post.
ReplyDeleteThe sshd setup was easy with "sudo raspi-config", but the TomCat part of this worked like a charm. Now that I've figured this out and have a door chain position sensor chosen for the Arduino controller, my garage automation project is progressing. Thank you for saving me some time. Now I need to order some MCP23008s for lighting and sprinkler control - Jy@
ReplyDeletehad a problem downloading tomcat? - version 28 is no longer available.
ReplyDeletechange 28 to 35 or whatever number is available
wget http://mirrors.axint.net/apache/tomcat/tomcat-7/v7.0.35/bin/apache-tomcat-7.0.35.tar.gz
tar xzf apache-tomcat-7.0.35.tar.gz
cd apache-tomcat-7.0.35/conf
vim tomcat-users.xml
I found the answer. update & upgrade the system first
ReplyDeletesudo apt-get update
sudo apt-get upgrade
If my localhost works outside my home network, but localhost/8080 doesnt, do i need to open more ports for tomcat on my router ?
ReplyDeletemean localhost:8080
DeleteIf you intend to access the Pi outside your LAN you must surf against the router with the external IP/hostname of the router. You can use whatever port, so you could use standard 80 if you want. The important thing is to create a port forwarding rule in the router that redirect traffic on that external port to the ip address of the Pi on the internal network, and to use port 8080. So example of forwarding rule: 234.123.123.123:80 -> 192.168.1.5:8080
DeleteThnx, I'll update the versions soon!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHello,
ReplyDeleteThanks very much for the good description. All steps had worked at the frist run. Now i try to deploy a web applicaton and install firefox (iceweasle) and try to run some addons. What a great stuff!.
Mike
Thanks for the tutorial. It is a little slow (startup time: 12 seconds ;-) but works ;-)
ReplyDeletePerfect !!!
ReplyDeleteGreat tutorial. Note: Oracle are aiming to bring out a SE8 JDK that runs on hard float wheezy which will run faster than OpenJDK which is slower as it doesn't have JIT compiler... cannot wait
ReplyDeleteI'm kind of wondering how now to get Tomcat and the environment variables all to run ok at bootup without logging in. Any advice?
My advice would be to learn UNIX
Deletesudo nano /etc/rc.local
DeleteNotable points on your website. We are interested to add some more information to this post. Keep posting new content.
ReplyDeleteThanks
Reliable dedicated hosting
Uşak
ReplyDeleteAnkara
Adıyaman
Hatay
Şırnak
BS3DTP
Diyarbakır
ReplyDeleteSamsun
Antep
Kırşehir
Konya
TGOİ3R
van
ReplyDeleteelazığ
zonguldak
uşak
sakarya
FO48J2
ankara parça eşya taşıma
ReplyDeletetakipçi satın al
antalya rent a car
antalya rent a car
ankara parça eşya taşıma
D45AF3
0992F
ReplyDeleteKarabük Evden Eve Nakliyat
Tekirdağ Evden Eve Nakliyat
Balıkesir Evden Eve Nakliyat
Konya Evden Eve Nakliyat
Çanakkale Evden Eve Nakliyat
5B7E4
ReplyDeleteKütahya Evden Eve Nakliyat
Muğla Evden Eve Nakliyat
Manisa Evden Eve Nakliyat
buy oxandrolone anavar
Maraş Evden Eve Nakliyat
buy sarms
order masteron
Denizli Evden Eve Nakliyat
fat burner for sale
DF432
ReplyDeleteAmasya Şehir İçi Nakliyat
Sakarya Lojistik
Aydın Parça Eşya Taşıma
Bitmex Güvenilir mi
Poloniex Güvenilir mi
Rize Parça Eşya Taşıma
Osmaniye Evden Eve Nakliyat
Hatay Evden Eve Nakliyat
Yalova Evden Eve Nakliyat
8D4B4
ReplyDeleteSivas Evden Eve Nakliyat
Malatya Evden Eve Nakliyat
buy testosterone propionat
order anapolon oxymetholone
Siirt Evden Eve Nakliyat
order turinabol
Mersin Evden Eve Nakliyat
Muğla Evden Eve Nakliyat
buy primobolan
04562
ReplyDeleteadıyaman mobil sohbet et
Erzincan Canlı Sohbet Siteleri Ücretsiz
rastgele sohbet odaları
Bayburt Seslı Sohbet Sıtelerı
çankırı görüntülü sohbet yabancı
kırşehir kadınlarla görüntülü sohbet
Burdur Canli Goruntulu Sohbet Siteleri
kırşehir parasız görüntülü sohbet
canlı sohbet siteleri