Tomcat on MAMP

MAMP installs the Apache HTTP server which is fine for your PHP development but if you want to do  Java web development then you need to install Tomcat. The good thing is, both servers can run on the same system by following the instruction bellow you can make this happen.

  • Dowload the most recent Binary Core tar.gz file of Tomcat (click here to go to the Tomcat web site).
  • Extract the file into /Applications/MAMP/. This will create a folder such as /Applications/MAMP/apache-tomcat-6.0.20.
  • Rename the folder apache-tomcat-6.0.20 to tomcat. Now you should have a folder called /Applications/MAMP/tomcat.
  • Using a plain-text editor (such as Editra) edit the file /Applcations/MAMP/bin/startApache.sh and add the following line to the bottom of the file.

/Applications/MAMP/tomcat/bin/startup.sh

  • Save the file and close the text editor.
  • Now start MAMP (Applications/MAMP/MAMP).
  • Open a browser and navigate to http://localhost:8080.
Category: Java, Mac, Operating Systems, PHP, Tips and Tricks | Leave a comment

Allow remote access to mysql server.

By default remote access to MySQL server is disabled, security reasons. However, because of some reasons you may need to enable remote access to MySQL  for database management and so on. To do this, 5 steps are involved:

Step 1: Login over SSH if your server is outside your data center


ssh yourusername@yourserverdomain

Step 2: Enable Networking by Editing my.cnf
Once you are logged in, open my.cnf file using your your favorite linux text editor such as vi or nano. As i’m using ubuntu linux (version 10.04) the my.cnf file can be located at /etc/mysql/my.cnf


# sudo nano /etc/mysql/my.cnf

Type your password then hit enter.
Read More »

Category: Database, Linux, MySQL, Operating Systems, Tips and Tricks | 1 Comment

Restarting Ubuntu Linux Netwoking

When there is a need to restart your network service on ubuntu. a single line of command is enough.

Open terminal and type the follows command:


sudo /etc/init.d/networking restart

The above command actuelle is used to desactivate and activate (restart) all network interfaces (NIC) configured to start at boot time.

To stop networking service you can use


sudo /etc/init.d/networking stop

and to start it use


sudo /etc/init.d/networking start

Not that when accessing the server remotely, the last two commands are not recommended only restart option will be helpful in such situation.

Category: Computer, Linux, Operating Systems, Tips and Tricks | Leave a comment

Generate a Random lower case letter

Sometime you may need to generate a random Lowercase letter (a to z) using Java. The following function will do the work perfectly.


/**
 * Generate a Random lower case letter
 * @return char
 */
 public static char rndChar() {
 Random random = new Random();
 char ch;
 ch = (char) (random.nextInt('z' - 'a' + 1) + 'a');
 return ch;

 }
Category: Java, Programming | Tag: | Leave a comment
  • About Me

    I'm 31 years old Programmer / Designer, founder of www.kahigiso.com and co-founder of www.betaught.net. I provide branding strategy, web-application design and development services to individuals, medium and small businesses, and non-profit organizations. I'm simple and a smiling person! I’m also an computer geek, a movie buff and a music freak. You can also follow me on:

  • Latest Post

  • Today

    May 2012
    M T W T F S S
    « Apr    
     123456
    78910111213
    14151617181920
    21222324252627
    28293031  
  • Count per Day

    • 9347Total reads:
    • 4Reads today:
    • 477Visitors per month:
    • 28Visitors per day:
    • March 14, 2011Counter starts on: