Skip to content

Instantly share code, notes, and snippets.

@amjd
Last active December 2, 2016 13:44
Show Gist options
  • Save amjd/75fdab01c6b5bc0b8580ed5a266bd4e9 to your computer and use it in GitHub Desktop.
Save amjd/75fdab01c6b5bc0b8580ed5a266bd4e9 to your computer and use it in GitHub Desktop.

Install instructions for NS2, Apache Tomcat, PHP, Perl & CGI:

NS2

$ sudo apt-get update
$ sudo apt-get install ns2
$ sudo apt-get install xgraph
$ sudo apt-get install nam

If nam doesn't work, try:

$ sudo apt-get purge nam

Download nam package from here: https://www.dropbox.com/s/mtc5ccju0d52vuz/nam_1.15-10_i386.deb?dl=0

Then cd to the directory or copy it to your home directory and execute:

$ sudo dpkg -i nam_1.15-10_i386.deb

If nam still doesn't work, try these commands:

$ sudo apt-get purge nam
$ wget --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1" "http://technobytz.com/wp-content/uploads/2015/11/nam_1.14_amd64.zip"
$ unzip nam_1.14_amd64.zip
$ sudo dpkg -i nam_1.14_amd64.deb
$ sudo apt-mark hold nam

Tomcat

To install Java:

$ sudo apt-get install default-jre
$ sudo apt-get install default-jdk

To install Tomcat:

$ sudo apt-get install tomcat7
$ sudo apt-get install tomcat7-docs tomcat7-admin tomcat7-examples

Tomcat root will be at /var/lib/tomcat7. Apps will have to be placed in /var/lib/tomcat7/webapps

Apache

$ sudo apt-get install apache2

MySQL

$ sudo apt-get install mysql-server mysql-client

PHP

$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring php-xdebug libapache2-mod-php5.6 libapache2-mod-php7.0
$ sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
$ sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php

This will install both PHP 5.6 and 7.0, and PHP 5.6 will be set as default.

To switch PHP version manually between PHP 5.6 and 7.0:

From php5.6 to php7.0:

$ sudo a2dismod php5.6 && sudo a2enmod php7.0 && sudo service apache2 restart
$ sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php

From php7.0 to php5.6:

$ sudo a2dismod php7.0 && sudo a2enmod php5.6 && sudo service apache2 restart
$ sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php

Perl & CGI

Perl is installed by default on Ubuntu. You just need to enable CGI in Apache by running:

$ sudo a2enmod cgi
$ sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment