Posted by Radoslav Bogdanovic - 2011/04/10 - Linux
Install update manager
$sudo apt-get install update-manager-core
Change in release-ugrades file so that it says Prompt=normal instead of Prompt=LTS
$sudo vi /etc/update-manager/release-upgrades
Finally start the upgrade and answer yes [y] on all that is asked
$sudo do-release-upgrade
After the reboot you have now a 10.10 version running instead of 10.04
Posted by Radoslav Bogdanovic - 2011/04/10 - Linux
Recently I have started my cloud experience by evaluating and testing out cloud computing at CityCloud the Swedish cloud computing provider. So far it has been a good experience. Anyway when you have your own server then you also want to host multiple sites or subdomains. In a shared hosting environment one would normally have support for handling multiple sites in cpanel or similar. However when you don’t have a panel application then one needs to do that manually and here how I have done that.
First one need to add an A record to your DNS which points to your cloud computer IP address. This step is normally done at your registrar or where you have your name servers for your domain. Say that you have a domain called yourcloud.com and you want to add a subdomain called site1.
Next is the Apache setup.
One could start with following step with a copy of the default site definition
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/site1.yourcloud.com
or just skip that step and just paste my already predefined site file.
sudo vi /etc/apache2/sites-available/site1.yourcloud.com
Paste following and replace everything with site1.yourcloud.com with your own site and domain name.
<VirtualHost *:80>
ServerAdmin webmaster@site1.yourcloud.com
ServerName site1.yourcloud.com
DocumentRoot /var/www/site1.yourcloud.com/
<Directory />
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
DirectoryIndex index.php index.html
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
Save the file.
To activate your new site then execute command
sudo a2ensite site1.yourcloud.com
And finally restart Apache
sudo /etc/init.d/apache2 restart
Hopefully if your DNS change have kicked in you should now be able to browse to site1.yourcloud.com
Posted by Radoslav Bogdanovic - 2011/04/08 - Java, Linux
After one have installed JDK 6 then do following steps to install Tomcat 7
wget http://apache.dataphone.se/tomcat/tomcat-7/v7.0.12/bin/apache-tomcat-7.0.12.tar.gz
tar xvfz apache-tomcat-7.0.12.tar.gz
sudo mv apache-tomcat-7.0.12 /usr/local/tomcat7
For autostart create following script in /etc/init.d
sudo vi /etc/init.d/tomcat7
Paste in the following
# Tomcat auto-start
#
# description: Auto-starts tomcat 7
# processname: tomcat7
# pidfile: /var/run/tomcat.pid
export JAVA_HOME=/usr/lib/jvm/java-6-sun
case $1 in
start)
sh /usr/local/tomcat7/bin/startup.sh
;;
stop)
sh /usr/local/tomcat7/bin/shutdown.sh
;;
restart)
sh /usr/local/tomcat7/bin/shutdown.sh
sh /usr/local/tomcat7/bin/startup.sh
;;
esac
exit 0
Save the file and set executable permissions
sudo chmod 755 /etc/init.d/tomcat7
Link the startup script to startup folders
sudo ln -s /etc/init.d/tomcat7 /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat7 /etc/rc2.d/S99tomcat
Finally test to start
sudo /etc/init.d/tomcat7 start
Now open url http://yourserver.com:8080/
Almost the complete description of this installation was taken from the blog post http://www.howtogeek.com/howto/linux/installing-tomcat-6-on-ubuntu/ but adapted to Tomcat 7. It turns out that it works perfectly for Tomcat 7 as well as Tomcat 6.
It might seem as a bit unnecessary to duplicate most of the steps from an already existing blog post. However this is more for my own reference and on occasion blogs and useful posts disappear.
Posted by Radoslav Bogdanovic - 2011/04/08 - Java, Linux
To install Oracle (Sun) JDK 6 on Ubuntu do the following steps
First to get the add-apt-repository support do the following command
sudo apt-get install python-software-properties
Then
sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jdk
# to set this as default java version
sudo update-java-alternatives -s java-6-sun
Finally do a test with java -version
Almost the complete description of this installation was taken from the blog post http://thilina.gunarathne.org/2011/02/installing-sun-oracle-jdk-6-on-ubuntu.html
These steps were successfully executed on Ubuntu 10.04 64-bit. However in the original post this was done on Ubuntu 10.10.
It might seem as a bit unnecessary to duplicate most of the steps from an already existing blog post. However this is more for my own reference and on occasion blogs and useful posts disappear.
Posted by Radoslav Bogdanovic - 2011/02/24 - General
Ran across this really amusing article on the subject “Why PHP is better than Ruby”. I must admit that I never have done any Ruby development myself but have done some PHP programming even if I cannot consider myself as any expert. The article starts with…
"PHP is better than ruby. There, I said it. In this article I'm going to show you why, and probably upset some twenty-something, flip-flop clad, mac-using hippie fanboys in the process."
Anyway a must read and look at the first comment as well. You will understand after you have read the article.