Installing LAMP on Kubuntu or Ubuntu

This post represents a small guide of how to setup your LAMP (Linux-Apache-MySQL-PHP) under Kubuntu (this works also for Ubuntu).

Usually LAMP tutorials guide you to install one by one all the applications, that looks something like this:

sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install mysql-server

There is one more easy solution, and the only difference is that it installs all + some other packages for LAMP.

sudo apt-get install lamp-server^

When installation of new packages finishes you have you own LAMP setup! Test it entering http://localhost in your browser it should say It works!

Tip #1

For adding PhpMyAdmin execute the following command in console:

sudo apt-get install phpmyadmin

It is possible when you type in your browser http://localhost/phpmyadmin/ that phpmyadmin don’t runs. Then you have to create a link in your www directory:

sudo ln -s /usr/share/phpmyadmin /var/www/phpmyadmin

After doing this http://localhost/phpmyadmin/ should work now!

Tip #2

To have permissions to your www directory do following:

sudo chown username:username /var/www

Tip #3

Enable Apache mod_rewrite module and restart Apache for taking effects:

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

You can enable or disable some other modules like this.

Now you have your LAMP up and the work can start :)

Using Wubi to Install Kubuntu

What is Wubi?

Wubi is an officially supported Ubuntu installer for Windows users that can bring you to the Linux world with a single click. Wubi allows you to install and uninstall Ubuntu as any other Windows application, in a simple and safe way. Are you curious about Linux and Ubuntu? Trying them out has never been easier!

Why to use it?

If you’re new to Ubuntu and other Ubuntu based installations (Kubuntu, Xubuntu) this is a great way to play with it, and if you don’t like it you can easily remove it!

What do you need for start?

You need a Kubuntu installation disc, which you can download from official Ubuntu site or Kubuntu.org, you can chose there from 32-bit or 64-bit version. There are few alternatives, you can download it via FTP or torrent if you like that more.

On Kubuntu.org you have option to download only Wubi (~1.5Mb) and start install Kubuntu with it, but then it will download all the data (installation disc) from Internet. So, if you don’t have a good bandwith Internet I don’t recommend this.

Start installing

After you downloaded your Kubuntu installation disc, you can burn it on CD or if you have a virtual drive mount in it. Now you have to run Wubi.exe (find on CD or through Windows Autoplay) which is in root of CD. A window will appear with Kubuntu CD menu and three option, you chose the second one from there Install inside Windows. After that it’ll appear a window which looks something like next picture.

wubi-installer.org

wubi-installer.org

Now you have to configure some options before you start you Kubuntu installation through Wubi installer. Chose your Installation Drive (it can be any partition which can Windows access), but it has minimum 12GB free space. Installation size is worth to set bigger if you want to install a bunch of programs and stuff, if you don’t you can leave on 8GB. Desktop Environment will be Kubuntu in our case. Set Language, Username and Password, click on Install and here it goes! It will copy some files and after that will ask to restart your system, and finish with whole installation after setting up more stuff (when installation finishes don’t forget to remove your install CD from drive).

After next restart you’ll see a boot menu which gives you option to chose which OS to start Windows or Kubuntu. You can now run your new Kubuntu OS :)

My Experience

I’m using Kubuntu like this for about 2-3 weeks, and have to say I’m satisfied with it. Only I have to say there were few difficulties during the install.

My first attempt was with Kubuntu 9.10, but after entering in it there was no wireless connection on notebook (Dell Inspiron 1525). I checked it, it recognized that I have wireless card, but I could not manage it or to connect on my home network. I didn’t have choice so I connected with LAN cable, and make all the updates/bug fixes for Kubuntu. After finished update and restart I was able to handle my WLAN connections.

One more thing to pay attention is sound. If you don’t have any it’s worthy to check your KMix and run alsamixer from console. Be sure that is in alsamixer everything turned on (volume is on top and it’s not MM – muted). With ‘M’ key you can change the values where you find it is MM.

For more detailed installation process and informations about Wubi visit wubi-installer.org.

Zend Framework Book Review by Robert Bašić

Picture from robertbasic.com

Picture from robertbasic.com

Few days ago my friend Robert Bašić has posted his review of a book named “Zend Framework 1.8 Web Application Development” on his blog. Here is a short quote from that review:

The book starts off with a basic application (yep, “Hello world!”), explains the bootstrapping, configuring, working with action controllers, views and handling errors… The second chapter continues with explaining the MVC architecture, the front controller, router, dispatcher… It even has a nice flowchart about the whole dispatch process, great stuff.

It’s a not too long, but a well written and informative review. So, if you’re interested in whole review and what’s Robert saying about the book, I recommend you to visit his blog and read his nice post!

Clone VirtualBox vdi Image

virtualbox clone vdi imageFew words about VirtualBox

VirtualBox is an open source virtualization product for home and enterprise use. It gives you the power to work on some other OS than you’re running (Windows, Linux, Macintosh and Solaris as hosts), and it supports a great number of guest operating systems.

How to clone?

Let’s suppose you setup you guest OS, installed some applications, made updates, and now you wish to backup it if something goes wrong. The easiest solution will be to find directory where is your vdi file and copy it somewhere as backup, but that isn’t the good solution. You have to clone it!

There are few solutions how to do it, this one is when the host is a Windows OS. Run command prompt and enter the directory where is your VirtualBox applications installed (usually program files) and than execute a command.

C:\Program Files\Sun\VirtualBox>VBoxManager.exe clonevdi "source" "destination"

Suppose your vdi image is located on D: drive under directory VBox and named ubuntu910 and you want to make a vdi image clone named bckup_ubuntu910 on D: drive. That will look like this:

C:\Program Files\Sun\VirtualBox>VBoxManager.exe clonevdi "d:/VBox/ubuntu910.vdi" "d:/bckup_ubuntu910.vdi"

After execution of command you’ll see a percentage number of cloning status in command prompt, when it reaches 100% your vdi clone is ready. Clone has got new UUID (Universal Unique Identifier), so there will be no conflict if you decide to use both (original and the cloned one).

Using Multiple Firefox Profiles

firefoxTime since I discovered this little trick, I use it always. I like that I can have two Firefox profiles run at the same time, but they are totally different. They have separate directories created for profiles and as that they can have totally different extensions installed than each other. So, I have created recently one more profile for web developing, which contains all the extensions I need for it like Firebug, Web developer toolbar, some validators, etc. Now I have the default profile which is used for surfing over Internet with own extensions, browsing history, bookmarks, and web development profile with it own extensions.

How to create Firefox profile?

I won’t make a full descriptions of steps how to do it, I rather redirect you to some places where I also got knowledge about this. Just shortly, after you created your new Firefox profile you can make a shortcut for it, only what you have to do is to add few parameters in the target field. In my case it looked like the following line.

"C:\Program Files\Mozilla Firefox\firefox.exe" -P WebDev -no-remote

As you can suppose from the line above, my new profile name was “WebDev” before which is a parameter “-P” which means profile, so we call profile named “WebDev” and “-no-remote” parameter is which enables to run multiple profiles!

For further read I suggest to visit following links which explains in more details how goes the profile creation part and all together.

I think this is very handy, how about you?

How to Compress JavaScript Code

how to compress javascriptIn past few months and recently I did some JavaScript coding. The whole source code wasn’t so big, around 15kB, but it may be growing more, and there are also other JavaScript files which are included in the page and maybe I merge them. To reduce amount of data and in hope to little speed up loading of the page I was looking for some options to compress (minify) the source code.

What means to minify JavaScript?

One more term which is used for reducing the size of code is minification or minify.

Minification (very often just minify, and sometimes also minimisation or minimization), in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code, without changing its functionality. These unnecessary characters usually include white space characters, new line characters, comments and sometimes block delimiters; which are used to add readability to the code, but are not required for it to execute. – wikipedia.org

Why to compress/minify?

In putting to a simple way the whole quote above, compress (minify) the code to load it faster! Beside that you’ll reduce the bandwidth consumption of website, and number of HTTP requests if you combine several JavaScript files in one.

Tools for compress/minify

Searching over Internet I found several tools which are commonly used for compressing JavaScript code, these tools for compress are:

JSMin – is a filter which removes comments and unnecessary whitespace from JavaScript files. It typically reduces filesize by half, resulting in faster downloads. It also encourages a more expressive programming style because it eliminates the download cost of clean, literate self-documentation.

Dojo compressor – in the design of the the Dojo compressor,  instead of brittle regular expressions, the Dojo compressor is based on Rhino, a JavaScript engine from the Mozilla project.

Packer v3.0 – some features of it are respect Microsoft conditional terms, new option to shrink variable and argument identifiers, removed the special chars feature (except the ;;; feature which people seem to like) etc.

Google minify -  is a PHP5 app that helps you follow several of Yahoo!’s Rules for High Performance Web Sites. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers.

YUI compressor – The YUI Compressor is a JavaScript compressor which, in addition to removing comments and white-spaces, obfuscates local variables using the smallest possible variable name. This obfuscation is safe, even when using constructs such as ‘eval’ or ‘with’ (although the compression is not optimal is those cases) Compared to JSMin, the average savings is around 20%.

Note: it’s possible to make gzip compression of code, which are supported natively by modern web browsers, and also shrink previously minified JavaScript file.

Which one to use?

Well that’s a personal decision, I read some posts and articles over Internet and most of them suggests YUI compressor, but it don’t means that you have too.

On web page called JavaScript CompressorRater you can found details and analyzes how successful are different compression tools in action. Compression is done on popular JavaScript libraries. I recommend to visit it, at least you can get some view on their success in action.

Online compress tools

Here are some online compress tools for beginning:

In some of next posts I’ll try to explain how to make it done on your computer, not with an online compress tool. Happy compressing!

Let’s get started

picture by hello.w0r1d.net

picture by hello.w0r1d.net

Howdy there, I’d like to welcome you at my blog. My name is Bojan, and I’m a 24 years old web developer from Subotica, Serbia. I graduated at Subotica Tech. Currently I’m a freelance web developer, and I’m working as that in the last 3-4 years. First touch with HTML and web developing I had with 19 years, and from that moment I was interested in web stuff. Some of my work can be viewed under the Portfolio section.

I started this blog part as a test, and I’m curious how it will go. I had/have already one blog, which is on Serbian language, called Webija. So now the challenge is try to write on English :)

On this blog I will share with you interesting sources for developing, web related things as some interesting places, nice applications, discuss about sites, try to share some interesting code snippets, etc. So it will be mostly about Internet, web development and me :)

If you want to contact me, you can fill out a form via Contact page or find on About page more contact information on some social pages or IM.

In case you’re wondering what means the image/picture above, it means “Hello, world!” :) One of the most popular phrases in programming manuals and wider, and it is represented as Semacode (for more details you can visit url which is under the picture).

Thank you for visiting, come again when there will be new posts :)