Add Tomcat Manager GUI to Tomcat Server

After installing the Tomcat server, you need a GUI of Manager to manage the Tomcat Server. First, go to this directory C:\xampp\tomcat\conf\, open the file tomcat-users.xml in your favorite text editor (I’m using Notepad++).

Add the following lines inside the parent element <tomcat-users>

<role rolename=”manager”/>
<user username=”tomcatadmin” password=”s3cret” roles=”manager”/>

After adding the XML element above, your tomcat-users.xml will look like this.

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="xampp" password="xampp" roles="admin,manager"/>
<role rolename="manager"/>
<user username="tomcatadmin" password="s3cret" roles="manager"/>
</tomcat-users>

Now go to the Xampp Control Panel to restart the Tomcat server, then click on Admin button of Tomcat server. Type the username as tomcatadmin, password as s3cret. The manager of Tomcat will display.


Setup Multiple Servers on 1 computer

For a lot of you who have only one computer but you want to install multiple servers such as Apache 2.0, Apache 2.2, Xampp, NuSphere, and GlassFish for Tomcat users. If you follow my steps below here, you wouldn’t go wrong and you’ll have multiple servers to write your applications in multiple languages.

Step 1: Install all servers in your C:\ drive

Step 2: Define each server with each different port. For example: Apache 2.0, you configure Port 80. Apache 2.2, you configure Port 81 …

For Nusphere development tool, go to Settings, under “Run & Debug” section – SVR web server, select Server Port as 8082 for example.

Step 3: Stop and Restart all of the installed servers, including Tomcat server if you install one. Now you can write PHP MySQL and JSP + JServlet + MySQL at the same time without switching server on and off.

Remember when you want to run the application, use the Port to distinguish different servers.

Example: When typing in the URL http://localhost:80/ you will run all PHP MySQL pages. When typing in the URL http:/localhost:81/ you will run all JSP + JServlet + MySQL pages.


Popular Ports used for WWW

ftp 21/tcp # File Transfer [Control] (XAMPP: FTP Default Port)
smtp 25/tcp mail # Simple Mail Transfer (XAMPP: SMTP Default Port)
http 80/tcp # World Wide Web HTTP (XAMPP: Apache Default Port)
pop3 110/tcp # Post Office Protocol – Version 3 (XAMPP: POP3 Default Port)
imap 143/tcp # Internet Message Access Protocol (XAMPP: IMAP Default Port)
https 443/tcp # http protocol over TLS/SSL (XAMPP: Apache SSL Port)
mysql 3306/tcp # MySQL (XAMPP: MySQL Default Port)
AJP/1.3 8009 # AJP/1.3 (XAMPP: Tomcat AJP/1.3 Port)
http-alt 8080/tcp # HTTP Alternate (see port 80) (XAMPP: Tomcat Default Port)

How to solve Apache server installation issue

If you install Apache on Windows and you’ve got the message: No installed service named “Apache2”, disable all your firewalls like Norton and Windows Firewall, SKYPE (this application and/or other appsĀ  are using the same port 80 as your localhost).

  • Go to window command and type netstat -na to look for all ports used on your PC.
  • When Skype is running, it blocks your Apache installation process and it won’t register Apache to Window Services.
  • Restart your PC. Uninstall Apache, then reinstall Apache while all the above are disabled. Now your Apache should automatically starts after the installation.

How to move cronjob from one server to another

Today I’m moving the entire physical server to a Virtual Server. When it comes to the cronjob that I have set up in the past, I have no idea how I start with since I have hundreds of cronjobs are running periodically on the current server. Some run every hour, some run every Monday morning for marketing and financial reports, some run every night to do the Credit Card batch processing on all subscriptions. Now if I move the server and I don’t carry the cronjobs over, none of the activities will be running on the new Virtual Server. I can sit there and re-type all the cron scripts again but I found out there’s the easier way to do it – Copy and Paste. However, where should I paste on the Linux server. There’re tons of directories in the Linux server, you got to know where to get the cronjob file in order to paste your cronjobs.
Step 1: Log on to FTP/SFTP server, go to a directory called /var/spool/cron/ where you can find root file. You must be a root owner.
Step 2: Open the file in Notepad/Notepad++, now you can paste the entire cronjob activities in this file.
Step 3: Remember to save it to the proper server.
Step 4: Rename the URLs so they’ll resolve based on where your server is, or where your URL points to.