First date with Ubuntu
It was long time since I touched any Linux but becuase I wanted try some open source environment I decided to install Ubuntu 8.04 LTS Server with Tomcat 6.0.16, MySQL 5, Red5 0.7 and Samba.
As for complete n00b when it comes to Linux I am really amazed how easy it was to install everything. Ubuntu community is doing great job by sharing knowledge on how to configure everything. In less than one day I could set up my environment without any prior Linux knowledge. In this entry I’ll describe what I’ve done to get my Ubuntu up and running. Mostly for myself but maybe someone will find this information useful.
Virtual PC 2007 is problematic when it comes to Ubuntu. I’m using VPC simply because I’m running other VMs also and wanted to keep everything in one place. So first of all I had to find solution how to get rid of nasty error when Ubuntu install starts on VPC. Error says something about critical error and need for restart. But this can bve simply solved by adding some kernel parameters before install begins. When you see Ubuntu boot screen instead of selecting Install Ubuntu press F6 and type:
<backspace><backspace>vga=771 noreplace-paravirt --
and hit Enter. This will start installation. Once everything is installed and Ubuntu asks for restart - don’t do it. Select “Go back” option and then choose to open console. You need to change few settings to avoid critical error when VM starts. When shell is ready execute following commands (server must be connected to the network):
chroot /target /bin/bash aptitude install linux-generic aptitude remove linux-server linux-image-server linux-image-2.6.24-16-server linux-ubuntu-modules-2.6.24-16-server exit
Then modify GRUB boot list:
nano /target/boot/grub/menu.lst
Go to the bottom of that file, to place where it says: title Ubuntu 8.04, kernel 2.6.24-18-generic. In line below, starting with kernel simply add:
vga=771 noreplace-paravirt
Above kernel and title lines you can see two GRUB options where title contains: Ubuntu 8.04.1, kernel 2.6.24.19-server. You can remove them so you don’t have to press ESC and choose right boot option everytiime when VM starts. Remember to remove title, root, kernel and initrrd lines for each option and leave only *-generic options. Save (CTRL+O) and exit (CTRL+X). Now execute following commands:
chroot /target /bin/bash update-grub exit
And finish installation. Your Ubuntu will start.
MySQL first. Because MySQL seems to be easiest to install I decided do it first. Simply execute following commands:
sudo apt-get update sudo apt-get install mysql-server
MySQL will install and setup itself for autostart. I needed access to my dev database from my Vista so I had to slightly modify its configuration. By default MySQL binds to 127.0.0.1 what makes it unavailable from VM host. Because my VM is for dev only I decided to make MySQL available from anywhere. To do that simply edit my.cnf file.
sudo nano /etc/mysql/my.cnf
Find line starting with bind-address and change value from 127.0.0.1 to 0.0.0.0. Save file and and open mysql in terminal by typing:
mysql -u root -p mysql
When in, execute following SQL command:
UPDATE user SET host='%' WHERE user='root' AND host='<YOUR-COMPUTER-NAME>'; FLUSH PRIVILEGES;
Of course this will allow your MySQL root user to access database from anywhere. You don’t want it be configured like that on live server.
When MySQL is configured it is time to restart it:
sudo /etc/init.d/mysql restart
Apache Tomcat 6.0.16. Before installing Tomcat I had to install Java. I have selected Java 5 and installed it simply by executing following command:
sudo apt-get install sun-java5-jdk
Once installed I could install Tomcat. I had two options to download it. Use wget or use lynx. I installed lynx:
sudo apt-get install lynx
Then downloaded Tomcat. To install it simply execute following commands:
sudo mkdir /usr/local/tomcat sudo mv apache-tomcat-6.0.16.tar.gz /usr/local/tomcat cd /usr/local/tomcat tar xvzf apache-tomcat-6.0.16.tar.gz sudo export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun sudo nano /etc/init.d/tomcat
Paste following code in tomcat file:
# Tomcat auto-start # # description: Auto-starts tomcat # processname: tomcat # pidfile: /var/run/tomcat.pid # export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun # case $1 in start) sh /usr/local/tomcat/apache-tomcat-6.0.16/bin/startup.sh ;; stop) sh /usr/local/tomcat/apache-tomcat-6.0.16/bin/shutdown.sh ;; restart) sh /usr/local/tomcat/apache-tomcat-6.0.16/bin/shutdown.sh sh /usr/local/tomcat/apache-tomcat-6.0.16/bin/startup.sh ;; esac exit 0
Save and close. Excute following commands:
sudo chmod 755 /etc/init.d/tomcat sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat
Tomcat is configured. Then it was time to set up Red5. Again I used lynx to download deb package from osflash website. To install it simply execute following command:
sudo dpkg -i red5.deb
And now make it accessible from VM host - Samba. For specific configuration go here. If you have not installed Samba when Ubuntu was installing you can do it now by executing following command:
sudo apt-get install samba
Once installed just stop it:
sudo /etc/init.d/samba stop
and modify configuration:
sudo nano /etc/samba/smb.conf
Find [global] section and change workgroup to name of your workgroup. Next change security setting to user. Set up your shares in following way:
[Share name] path = your path browseable = yes available = yes writable = yes quest ok = no
Save configuration and add your user to Samba users:
sudo smbpasswd -L -a your_username sudo smbpasswd -L -e your_username
Restart Samba:
sudo /etc/init.d/samba restart
And that should be all. But there was one more thing… System beep was getting crazy on VPC so I decided switch it off. Simply execute:
sudo nano /etc/modprobe.d/blacklist
and add blacklist pcspkr anywhere.
About this entry
You’re currently reading “ First date with Ubuntu ,” an entry on ria:it
- Published:
- 8:48 pm on 15/07/2008
- Category:
- Platforms
No comments
Jump to comment form | comments rss [?] | trackback uri [?]