Development/Coding/Programming

Once You have an Apache webserver (see my article), you are ready to enter into the world of Website development.

Following can be mastered once you have a webserver:

HTML: HyperText Markup Language is the standard markup language used to create web pages

 
  • HTML5
  • XHTM
  • XML

CSS: Cascading Style Sheets (CSS) is a style sheet language used for describing the look and formatting of a document written in a markup language

PHP: A server-side scripting language designed for web development but also used as a general-purpose programming language.

JavaScript: A client side scripting language (runs on your computer when opening a webpage)

  • AJAX/SJAX
  • Socket
  • jQuery

Database
MySQL
is a popular choice of database for use in web applications
You may need to install mysql server once you have the Apache running.

//Install server
sudo apt-get install mysql-server
// Link PHP5 to mysql
sudo apt-get install php5-mysql
// restart the webserver
sudo service apache2 restart
// locate and edit php.ini and change as follows
/etc/php5/apache2$ sudo nano php.ini

display_errors = On
html_errors = On

// open your web browser and login to your mySQL server using the username and password created at installation

http://yourserver/phpmyadmin/

// by clicking on Databases you can create your first database
// under Create table on databases you can create your first table by entering a name and number of columns and click Go
// then you are ready to code a function to fill your database

Now, you need to install a good editor.
My advise is to use a supercool third party editor called Geany.
The basic features of Geany are:

  • syntax highlighting
  • code completion
  • auto completion of constructs like if, for and while, XML and HTML
  • call tips
  • folding
  • many supported filetypes like C, Java, PHP, HTML, Python, Perl, Pascal
  • symbol lists
  • embedded terminal emulation

First you need to add the PPA in order to install this package:

sudo add-apt-repository ppa:geany-dev/ppa

Update the local repositories:

sudo apt-get update

Install Geany:

sudo apt-get install geany

Start the editor with:

geany

Note:
If you do not have GUI on your linux/ubuntu server, like in my case, you can use Xming to forwards the GUI of geany to you Windows computer.
1. Install Xming:
Xming X Server for Windows - Official Website
2. Open Putty on your Windows computer and under SSH tab, check "Enable X11 forwarding" and enter the following to the "X display location:" localhost:0

After this, once you login to your Ubuntu server via Putty and start geany, its GUI will open in your Windows computer.


For those who have a more powerful Ubuntu computer they can go for a editor called NetBean. netbeans.org

For those who have a more powerful Ubuntu computer they can go for a editor called NetBean. netbeans.org

To get started, you must first install Java SE JDK. To do that, visit Java SE JDK download page and download the newest version.After saving it, run the commands below to extract it. Remember at the time of this writing, the current version was jdk-7u45. So you may have to change the version number if it changes.

tar -xvf ~/Downloads/jdk-7u45-linux-x64.tar.gz

After extracting the downloaded JDK package, create a new folder using the commands below.

sudo mkdir -p /usr/lib/jvm/jdk1.7.0/

Next, move all the extracted content to the new directory you created. Remember the current version is jdk1.7.0_45. It may change in the future.

sudo mv jdk1.7.0_45/* /usr/lib/jvm/jdk1.7.0/

Next, run the commands below to enable / configure Java JDK

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1

Then do the same here to enable Javac.

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1


Finally, run the commands below to do the same with javaws.

sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1

To verify if Java is installed, run the commands below.
java –version

Now, that Java SE JDK is installed, go and download NetBeans from here.
Select Linux Download and download the package.

After downloading it, change into the Downloads folder and run the commands below to make the file executable.

chmod +x netbeans-7.4-linux.sh

Finally, run the commands below to begin the installation.

sudo ./netbeans-7.4-linux.sh


Creat a link:

sudo ln -s /usr/local/netbeans-8.0/bin/netbeans /usr/local/bin/netbeans

and start the application by

netbean



Note: dont forget to activate the plugins you need once you started the application

If you have trouble to save your file into www, you need to apply the followings:

sudo chown youruser /var/www/
sudo chown youruser /var/www/* -R
sudo chown youruser /var/www/*.* -R


You may have problems with the characters if you use for example German/Swiss keyboard/key maps. Solution:

sudo gedit /etc/apache2/conf.d/charset
// here add the next line, and save and restart apache2
AddDefaultCharset UTF-8