Tuesday, November 3, 2015
Docker - Setup and running 1st time on Windows7.1
http://docs.docker.com/windows/step_one/
(if docker stuck on creating VM on cmd 1st time, close it. Run Kitematic tool, it will tell you that setup is not done. 'delete VM and resetup'. Do that. Then try to run docker terminal, it should work fine)
Jkumar@IND-JKumar MINGW64 ~
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
975b84d108f1: Pulling image (latest) from docker.io/library/hello-world
975b84d108f1: Pulling image (latest) from docker.io/library/hello-world, endpoint: https ://registry-1.docker.io/v1/
975b84d108f1: Pulling dependent layers
3f12c794407e: Pulling metadata
3f12c794407e: Pulling fs layer
3f12c794407e: Download complete
975b84d108f1: Pulling metadata
975b84d108f1: Pulling fs layer
975b84d108f1: Download complete
975b84d108f1: Download complete
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world: this image was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker.
Hello from Docker.
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/userguide/
Jkumar@IND-JKumar MINGW64 ~
$
Wednesday, September 23, 2015
Leshan build - how to
Use Leshan-1
Create repro with these steps.
1. Using Git Extension.
2. Close repository using link : https://github.com/mrinalsharma/leshan-1.git
3. destination path: D:\sthana
Delete existing repository (if existing) at path:
C:\Users\jkumar\.m2\repository\org\eclipse\californium
Now navigate to path: D:\sthana\sthana\src\sthana>
- run ~ gradle leshanall
(build should be successful)
then
- run ~gradle leshanclean
(build should be successful)
- run -gradle install
(build should be successful)
(also run) -- 'mvn install' need to be run.
You should be ready to use Leshan
Create repro with these steps.
1. Using Git Extension.
2. Close repository using link : https://github.com/mrinalsharma/leshan-1.git
3. destination path: D:\sthana
Delete existing repository (if existing) at path:
C:\Users\jkumar\.m2\repository\org\eclipse\californium
Now navigate to path: D:\sthana\sthana\src\sthana>
- run ~ gradle leshanall
(build should be successful)
then
- run ~gradle leshanclean
(build should be successful)
- run -gradle install
(build should be successful)
(also run) -- 'mvn install' need to be run.
You should be ready to use Leshan
Saturday, August 1, 2015
5 COMMON APP DEVELOPMENT MISTAKES
http://www.startapp.com/blog/5-common-app-development-mistakes/
When done right, making and publishing apps can be very profitable for developers. Making an exceptional app is not easy, so we are highlighting 5 common mistakes that beginner app developers should try to avoid:
Don’t develop an app without the end user in mind
You know that you have a great idea for an app. But, will anyone else agree with you?
Always think about the user as you develop your idea. Constantly put yourself in the user’s position. Why would a user need this app? What benefit would they get from it? How will they interact with this app? How is it different from your competitors?
It is also very important to BETA-TEST your app before you release it. This will help you get a sense for how the UI and UX appeal to actual users.
If you don’t think about the user, you may end up with an app that you enjoy but one that doesn’t appeal to anybody else.
Don’t carry over UI elements from other platforms
EACH MOBILE OS has its own specific look and feel. If you copy the UI of another platform, users may complain and you may get in trouble from the App Store or Google Play Store for not following brand guidelines. Examine the design guidelines for ANDROID and IOS for a better idea of what your app should be expected to look like.
However, don’t be afraid to add your own branding and feel to your app. Just make sure that the general design of your app looks like it belongs on the right platform.
Don’t have just one screen size in mind
This is especially important! One important aspect of app development, especially on the Android platform, is that apps are available on a range of devices of differing size and shape. If you only design your app for one screen size, it won’t scale correctly on different devices. This will frustrate and alienate potential users.
Make sure that you put a lot of thought into how your device will look on bigger screen, like a tablet. In addition, keep in mind that devices allow for screen rotation and landscape orientation.
There are many tools to preview how your app will look on different devices, includingANDROID APP DESIGN. For iOS developers, this process is more simple because the range of devices is smaller. For iOS, focus on the most recent devices released (iPhone 5 & 6, for example). Apple usually phases out older devices unlike Android, so you won' t have to worry about them.
Don’t try to add too many features too soon
Though it may be tempting to showcase all that you can do, you don’t want to overwhelm your users with too many features at the very beginning. Let them get used to your app before adding new or more complicated features. The more tech-savvy users will embrace any new features, and the average user can explore new features or choose to simply use the original features.
Additionally, by saving some features for future updates, users will also see that you are actively working on and improving your app. This is an important image to have if you want to retain users and stay relevant.
Don’t be afraid to ask for advice
This is both the easiest and the hardest mistake to avoid. You may not want to reveal your app just yet or you may be embarrassed about encountering a problem. While this is understandable, there is a whole community of app developers out there in nearly every corner of the internet.
Visit forums and ask questions. Join discussions. You may find out that someone out there has encountered a similar problem!
In addition, there are many other resources available to you across the online community, including the IOS and ANDROID developer websites.
When you are just starting out in app development, there will be a lot of trial-and-error until you finally launch an app that catches an audience. The important thing is to not get discouraged. There are millions of apps out there, and not every one will be a major hit. Just do the best you can and avoid making some simple mistakes, and you will start to gain users slowly but surely.
4-tips-beta-testing-success
http://www.startapp.com/blog/4-tips-beta-testing-success/
Beta-testing is an important step for any app developer who wants to release a strong, stable app into the app stores. To make your beta-testing as thorough and effective as possible, try following these 4 tips:
1) Create a list of objectives
Before beginning your beta test, make sure you outline your objectives and what metrics you want to measure. You should ask yourself some questions before you start. Do you want to release to friends and family? Do you have contacts from a previous app release? How long will the test period be? How are you going to measure your results? Who is your target customer?
If you are unsure when deciding what to measure, here is a short list of key metrics that you should include in your beta-testing strategy:
- Sign-up and log-in: If users have trouble signing in to your app, it doesn’t matter how fantastic the rest of your it is.
- Menu Options: Make sure that your menu options are easily accessible and options like “support” or “help” are easy to locate.
- Data Handling: If your app stores data, make sure the data is stored properly and isn’t deleted without notice.
- Interruptions: How does your app function when a user gets and SMS or a call? How does it function on low battery v. full battery?
2) Screen Your Testers
Public beta tests may seem like a great idea because of the time and energy it saves. While it is true that your beta tester pool will be larger, the feedback you receive will most likely be low-quality. Public beta testers usually sign up out of curiosity and grow bored with the process and/or never submit any feedback. In addition, public beta tests open up your unfinished product to the public. If the public’s first interaction was with an unfinished app, they may not be willing to re-try your app once it is out of beta.
Go for a private beta-testing. Private beta testers are much more invested in the process than public testers. The testing group can be as large or as small as you would like. You can also have them submit a tester application to help you choose the best testers for your app. Look for testers who are fully committed and who seem like they will give you valuable feedback.
By screening your testers, you can also make sure that a diverse group of software and hardware is represented. As we all know, the mobile industry is extremely fragmented, with hundreds of devices and mobile software versions. You want to make sure your app is tested across a variety of devices and software versions by a variety of testers.
3) Be Attentive
You need to engage with your beta testers and make sure the beta testing process is smooth. First, you should have open channels of communication. Be up front with what your testers should expect once they begin using your app. If there are areas of your app that are not yet functional at the start of the test, your beta testers should be the first to know.
There should also be an easy way for your testers to give you feedback or report any bugs. Try setting up a forum or a database where they can easily enter information. A forum is also a good way to connect all of your beta testers. This way, they can discuss any issues in your app. You will also be able to see if a bug is widespread or only occurred on one tester’s device. This can help you prioritize which bugs or issues that you should tackle first.
Most importantly, you should acknowledge that you received the feedback from your testers. A simple “thank you for your feedback” is sufficient. If you are able to, give your testers an estimate for when a bug will be fixed. This will let them know that you heard their feedback and that you are actively addressing it. Your beta testers are giving up some of their own time to help you out. If it seems like you are ignoring their feedback, they may abandon the whole process.
4) Incentivize Your Active Testers
As your beta test is coming to a close and your ready to publish, it is important to consider one thing: you already have a group of active users in your beta tester pool. If you have been analyzing your data well enough, you should be able to easily identify who the power-users are. Capitalize on this. Give your beta testers some incentives for downloading your app once it hits the app stores. If your app is paid or freemium, give them a coupon code so they can get the app for free. Show them that you appreciated the time they took to help you perfect your app.
Clearly, the active testers enjoyed engaging with your app. By treating them well, you can turn them into advocates for your app and your company. You will have downloads from the beginning and you can count on your active testers for accurate and fair app reviews.
Keep the contact information for the most active testers. If you decide to develop another app down the road, you already have a list of dedicated and enthusiastic app testers.
Beta-testing your app gives you a chance to fix any major bugs or performance issues before releasing it into the app stores. This will not only ensure that you are releasing the best possible version of your app, but it will also cut down on negative reviews and ratings when your app is released.
Wednesday, July 15, 2015
Wednesday, April 15, 2015
FlyMigrate - DB in postgres
Try creating Schema in following way.
1. Drop cascade public schema in your sthana database
2. create public schema again. It will be schema without sthana tables.
2. cd to $HOME/sthana/sthana/src/ sthana/sthana-core
3. gradle flywayMigrate
This 3rd command should automatically create a schema with sthana tables for you. When you create data SQL, it should look like V2__data.sql. Put V2__data.sql in same folder as V1__init.sql. Then if you run "gradle flywayMigrate" your database should get updated with data also.
Thursday, April 2, 2015
Notification - test cases
Device need to test: samsung s2, nexus 7, samsung note and beacon
Testing On: wifi and 3g and 2g
- check notification.
- enable Tombhor face-detection and then give size in URL then verify thumbnail
- Verify JSON values.
- Verify "ImageType"
- etc
Configuration - test cases
Device need to test: samsung s2, nexus 7, samsung note and beacon
Testing On: wifi and 3g and 2g
Test-cases:
- in 1st 10 secs,
a) it will find locationProbe (longitude and latitude)
b) it will not find locationProbe (longitude and latitude)
- in 1st 10 secs,
a) it will find locationProbe (longitude and latitude)
b) it will not find locationProbe (longitude and latitude)
Saturday, March 21, 2015
Sample Configuration in Leshan. Through Sthana-core or Local Leshan
**************
\"edu.mit.media.funf.probe.builtin.SimpleLocationProbe\",\n\t \"@schedule\": {\"interval\": 60, \"duration\" : 10
- It shows that Client will try finding location probe using mobile hardware after each '60' secs.
- and only for first 10 secs, it will check.
then next call will be made after 60 secs (interval)
How to verify this:
- check in LogCat in Android Studio with filter like 'sthana' or 'funf'
- Register with Leshan and push configuration, check 'connect'/'reconnect'
Sample JSON configuration to Push for all registered clients:
{
"userPreferedCategorys":[
{
"name":"Thai",
"parentCategory":{
"name":"FOOD",
"id":1
},
"id":2
},
{
"name":"FOOD",
"id":1
}
],
"funfConfiguration":{
"pipelineConfigJson":"{\"@type\":\"edu.mit.media.funf.pipeline.BasicPipeline\",\n \"name\":\"default\",\n \"version\":1,\n \"data\": [\n\t {\"@type\": \"edu.mit.media.funf.probe.builtin.SimpleLocationProbe\",\n\t \"@schedule\": {\"interval\": 60, \"duration\" : 10, \"strict\": true}\n\t },\n\t {\"@type\": \"edu.mit.media.funf.probe.builtin.AndroidInfoProbe\"\n\t },\n\t {\"@type\": \"edu.mit.media.funf.probe.builtin.HardwareInfoProbe\"\n\t },\n\t {\"@type\": \"edu.mit.media.funf.probe.builtin.BluetoothBeaconProbe\",\n\t \"@schedule\": {\"interval\": 60, \"duration\" : 20, \"strict\": true},\n\t \"vendorConfig\": [{ \"uuid\" : \"bbbb2222-2222-2222-2222-222222222222\",\"major\":1, \"minor\":2, \"vendorName\": \"estemeto\",\"layout\": {\"m\": \"2-3+0215\",\"i\":[\"4-19\",\"20-21\",\"22-23\"],\"p\": \"24-24\",\"d\": []}}]\n\t }\n ]\n }"
}
}
*****************************************************
Monday, March 16, 2015
Sample Notification. It uses new Image server
Deploy WAR for sthana-core server on EC2.
- Hit sthana core server by URL: http://52.1.153.252:8080/sthana-core-1.0/#/clients
- Leshan page with 'Client' shows.
- Enter this server IP into sthana client App > Settings > OK
- It should show mobile client as 'Registered' in Leshan page.
- click on client ID.
- Click on 'Observe' in Device section. (to verify the device)
- Go to Notification section, click 'Write' and jump to sample JSON.
---------------Alternate Local JAR running method if Core server not working------------------
- Run Leshan from D:\sthana\leshan\leshan-standalone\target
with $ Java -java leshan-standalone-0.1.10-SNAPSHOT-jar-with-dependencies.jar
- Hit Leshan server in browser with: http://54.85.77.102:8080/#/clients/
- If leshan throw some error, check 8080 port is free to run on.
--------------------------------------------------------------------------------------------------------------------
Enter Sample notification in Notification section: Change vendor ID always, because limit is set yet for each vendor.
{
"vendorId":2,
"contentTitle":"Welcome Shedd Aquarium",
"contentText":"Welcome Shedd Aquarium",
"smallIconPath":"http://ec2-
"largeIconPath":"http://ec2-
"vendorPhone":"3129392438",
"vendorLocation":{
"name":"1200",
"street":"South Lake Shore Drive",
"city":"Chicago",
"zip":"60605",
"state":"IL",
"country":"USA",
"coordinates":{
"latitude":41.8678,
"longitude":-87.6139
},
"distance":0,
"id":2
},
"product":{
"upc":"999999",
"name":"Chicago CityPASS ",
"modelNumber":"",
"manufacturere":"",
"longProductDescription":"
"shortDescription":"Chicago CityPASS includes priority entry to Shedd Aquarium",
"deals":[
{
"dealName":"Save 50% off Chicago’s 5 best attractions",
"dealImage":"Deal Image",
"promoCode":"e74d77f5-0a29-
"id":2
},
{
"dealName":"Save 50% off Chicago’s 5 best attractions",
"dealImage":"Deal Image",
"promoCode":"e74d77f5-0a29-
"id":2
}
],
"categories":[
{
"name":"Recreation",
"subCategories":[
],
"id":2
}
],
"images":[
{
"imageFilePath":"http://ec2-
"imageType":"PNG",
"imageView":"LEFT",
"id":3
},
{
"imageFilePath":"http://ec2-
"imageType":"JPEG",
"imageView":"FRONT",
"id":4
}
],
"id":2
}
}
Configuring Ubuntu with the Desktop Environment and VNC Server
Now you can install the desktop packages and remote desktop (VNC) server by entering (or copying and pasting) the following commands one at a time:
sudo apt-get update sudo apt-get install ubuntu-desktop sudo apt-get install vnc4server
Now, to configure the VNC server enter
vncserver, which will then prompt you to create a password. Once created, entervncserver -kill :1 to stop the server.
Next, configure the VNC xstartup file so you'll see the desktop when connecting via VNC. Enter
vim .vnc/xstartup.
Then hit the Insert key, scroll around the text file with the keyboard arrows, and delete the pound (#) sign from the beginning of the two lines under the line that says "Uncomment the following two lines for normal desktop." And on the second line add "sh" so the line reads
exec sh /etc/X11/xinit/xinitrc. When you're done, hit Ctrl + C on the keyboard, type :wq and hit Enter.
Now you can start the VNC server again by entering
vncserver. And remember, you must enter this again at every reboot if you want VNC access, or consider configuring it to automatically run at startup.Connecting to the Ubuntu Instance via VNC
Now that you have Ubuntu set up, you need to install a VNC client (like TightVNC) on your local machine, and when connecting enter the following address:
127.0.0.1:9000
When connecting via that address you must first connect to the server via SSH (like with PuTTY) and then connect with the VNC client.
If you prefer to connect directly to your Ubuntu instance via VNC rather than having to SSH into it first, you can use the Public DNS address (from the AWS Instances page of your instance) followed by a colon and the number one, such as
ec2-184-169-226-14.us-west-1.compute.amazonaws.com:1.
Or you could even create an elastic IP and associate it with your Ubuntu instance, which you could then use (also with the colon and 1) to connect via VNC. But remember when connecting directly via VNC, it isn't as secure and you must open port 5901 up on the firewall via the Security Groups page.
Connect using: ec2-184-169-226-14.us-west-1.compute.amazonaws.com:1
Connect using: ec2-184-169-226-14.us-west-1.compute.amazonaws.com:1
PostgreSQL install and creating DB in ubuntu
https://help.ubuntu.com/community/PostgreSQL
Installation
To install use the command line and type:
sudo apt-get install postgresql postgresql-contrib
This will install the latest version available in your Ubuntu release and the commonly used add-ons for it.
See "External Links" below for options for getting newer releases.
Installing PostGIS, procedural languages, client interfaces, etc
Additional packages contain procedural language runtimes, add-ons like PostGIS, language client interfaces like psycopg2 for Python, etc. You can get a listing with:
apt-cache search postgres
Administration
pgAdmin III is a handy GUI for PostgreSQL, it is essential to beginners. To install it, type at the command line:
sudo apt-get install pgadmin3
You may also use the Synaptic package manager from the System>Administration menu to install these packages.
Basic Server Setup
To start off, we need to change the PostgreSQL postgres user password; we will not be able to access the server otherwise. As the “postgres” Linux user, we will execute the psql command.
In a terminal, type:
sudo -u postgres psql postgres
Set a password for the "postgres" database role using the command:
\password postgres
and give your password when prompted. The password text will be hidden from the console for security purposes.
Type Control+D to exit the posgreSQL prompt.
Create database
To create the first database, which we will call "mydb", simply type:
sudo -u postgres createdb mydb
Using pgAdmin III GUI
To get an idea of what PostgreSQL can do, you may start by firing up a graphical client. In a terminal type :
pgadmin3
You will be presented with the pgAdmin III interface. Click on the "Add a connection to a server" button (top left). In the new dialog, enter the address 127.0.0.1 (Local host is default, so it can be left out.), a description of the server, the default database ("mydb" in the example above), your username ("postgres") and your password. One more step is required in order to allow pgAdmin III to connect to the server, and that is to edit pg_hba.conf file and change the authentication method from peer to md5 (Will not work if you have not set the password.):
sudo nano /etc/postgresql/9.3/main/pg_hba.conf
and change the line
# Database administrative login by Unix domain socket local all all peer
to
# Database administrative login by Unix domain socket local all all md5
***************OR
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
*****************
Now you should reload the server configuration changes and connect pgAdmin III to your PostgreSQL database server.
sudo /etc/init.d/postgresql reload
With this GUI you may start creating and managing databases, query the database, execute SQl etc.
----------------------------------------------------------------------
Check whether Postgres is running or not !
9.3/main (port 5432): online
Restarting PostgreSQL Server
To start PostgreSQL server, run:
Sunday, March 15, 2015
Deployment of sthana server on EC2
Deployment of Sthana-vendor on EC2.
(We should have EC2 instance should be ready/running with all packages. Check: EC2 setup)
Sthana-vendor:
- From your machine, build a WAR from the code.
- windows machines, cd to from D:\sthana\sthana\src\sthana\sthana-vendor
- $gradle build
- check war file under D:\sthana\sthana\src\sthana\sthana-vendor\build\libs [there should be war file available if build is successful]
- Hit URL: http://<serverIP>:8080/manager/html [in my case http://52.0.157.177:8080/manager/html] Enter <user username="sthana" password="S*****!***" which can be found on tomcat-users.xml
- To deploy another version of WAR, Stop > Undeploy in section /sthana-vendor-1.0 OR if you are deploying 1st time then simply select WAR.
- Select WAR file to upload > Upload
- To connect with putty: ubuntu@52.0.157.177 with ppk key [set ppk in Connection > SSH > Auth]
~/leshan/leshan-standalone$ java -jar target/leshan-stan-*-SNAPSHOT-jar-with-dependencies.jar
--------------------------------
Sthana-core:
- From your machine, build a WAR from the code.
- windows machines, cd to from build war from D:\sthana\sthana\src\sthana\sthana-core
- $gradle build
- check war file under D:\sthana\sthana\src\sthana\sthana-core\build\libs [there should be war file available if build is successful]
- Hit URL: http://<serverIP>:8080/manager/html [in my case http://54.88.185.161:8080/manager/html] Enter <user username="sthana" password="S*****!***" which can be found on tomcat-users.xml
- To deploy another version of WAR, Stop > Undeploy in section /sthana-core-1.0 OR if you are deploying 1st time then simply select WAR.
- Select WAR file to upload > Upload
- To connect with putty: ubuntu@54.88.185.161 with ppk key [set ppk in Connection > SSH > Auth]
~/leshan/leshan-standalone$ java -jar target/leshan-stan-*-SNAPSHOT-jar-with-dependencies.jar
How to make New Instance on Amazon- EC2
How to make New Instance on Amazon- EC2:
1. Hit URL: http://aws.amazon.com/console/
2. 'Sign in to console' and if you have login Id, Login to it.
3. Go to EC2.
4. Select Instances at left hand side and follow steps.
1. Hit URL: http://aws.amazon.com/console/
2. 'Sign in to console' and if you have login Id, Login to it.
3. Go to EC2.
4. Select Instances at left hand side and follow steps.
- click on launch instance.
- Step 1: Choose an Amazon Machine Image (AMI). Select Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-9a562df2
- Step 2: Choose an Instance Type. Select General Purpose.
- Click on Review Instance Launch button.
- Step 7: Review Instance Launch, Edit Security Group.
- Select an existing security group and select 'default' Group. (default VPC security group)
- Click Launch to assign a key pair to your instance and complete the launch process
- Select Existing key pair (i have selected imageS) or create new pair.
Deployment Tomcat/Webserver on EC2
Deploy server on EC2:
1. Preliminary Note
This tutorial is based on Ubuntu 14.04 server, so you should set up a basic Ubuntu 14.04 server installation before you continue with this tutorial. The system should have a static IP address. I use 192.168.0.100 as my IP address in this tutorial and server1.example.com as the hostname.
[to know how to create instance on EC2, go to: HERE]
2. Installation
To start the installation of Tomcat we need to first install java-1.7.0-openjdk, we will install it as follows:
apt-get install default-jdk
Check the version of java as follows:
java -version
root@server1:~# java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.1) (7u65-2.5.1-4ubuntu1~0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
root@server1:~#
Proceeding further we need some essential packages:
apt-get install unzip wget
Now we will download the latest Tomcat version from its home page and install it as:
cd /opt
wget http://ftp.nluug.nl/internet/apache/tomcat/tomcat-8/v8.0.9/bin/apache-tomcat-8.0.9.zip
unzip apache-tomcat-8.0.9.zip
mv apache-tomcat-8.0.9 tomcat
Configure .bashrc:
vi ~/.bashrc
[...]
export JAVA_HOME=/usr/lib/jvm/default-java/
export CATALINA_HOME=/opt/tomcat/
Restart the bash, to make the changes affective as:
. ~/.bashrc
Again before starting Tomcat service, we will provide executable permissions to following files:
chmod +x $CATALINA_HOME/bin/startup.sh
chmod +x $CATALINA_HOME/bin/shutdown.sh
chmod +x $CATALINA_HOME/bin/catalina.sh
Now we need to start Tomcat service by using:
$CATALINA_HOME/bin/startup.sh
root@server1:~# $CATALINA_HOME/bin/startup.sh
Using CATALINA_BASE: /opt/tomcat/
Using CATALINA_HOME: /opt/tomcat/
Using CATALINA_TMPDIR: /opt/tomcat//temp
Using JRE_HOME: /usr/lib/jvm/default-java/
Using CLASSPATH: /opt/tomcat//bin/bootstrap.jar:/opt/tomcat//bin/tomcat-juli.jar
Tomcat started.
root@server1:~#
It will start the Tomcat server, we can also check by using:
netstat -an | grep 8080
[root@server1 ~]# netstat -an | grep 8080
tcp6 0 0 :::8080 :::* LISTEN
[root@server1 ~]#
Now we need to setup the user account. Finally we need to create user accounts to secure and access admin/manager pages. Edit conf/tomcat-users.xml file in your editor and paste inside <tomcat-users> </tomcat-users> tags
vi $CATALINA_HOME/conf/tomcat-users.xml
[...]
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
</tomcat-users>
In above configuration I have used username=admin and password=admin, you can make the changes as per your choice. Then we need to stop/start the Tomcat service
cd $CATALINA_HOME
./bin/catalina.sh stop
[root@server1 tomcat]# ./bin/catalina.sh stop
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
[root@server1 tomcat]#
Then start the service:
./bin/catalina.sh start
[root@server1 tomcat]# ./bin/catalina.sh start
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Tomcat started.
[root@server1 tomcat]#
Now access the page for login at http://192.68.0.100:8080
-----------------------------------------------------------------------------------
1. Preliminary Note
This tutorial is based on Ubuntu 14.04 server, so you should set up a basic Ubuntu 14.04 server installation before you continue with this tutorial. The system should have a static IP address. I use 192.168.0.100 as my IP address in this tutorial and server1.example.com as the hostname.
[to know how to create instance on EC2, go to: HERE]
2. Installation
To start the installation of Tomcat we need to first install java-1.7.0-openjdk, we will install it as follows:
apt-get install default-jdk
Check the version of java as follows:
java -version
root@server1:~# java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.1) (7u65-2.5.1-4ubuntu1~0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
root@server1:~#
Proceeding further we need some essential packages:
apt-get install unzip wget
Now we will download the latest Tomcat version from its home page and install it as:
cd /opt
wget http://ftp.nluug.nl/internet/apache/tomcat/tomcat-8/v8.0.9/bin/apache-tomcat-8.0.9.zip
unzip apache-tomcat-8.0.9.zip
mv apache-tomcat-8.0.9 tomcat
Configure .bashrc:
vi ~/.bashrc
[...]
export JAVA_HOME=/usr/lib/jvm/default-java/
export CATALINA_HOME=/opt/tomcat/
Restart the bash, to make the changes affective as:
. ~/.bashrc
Again before starting Tomcat service, we will provide executable permissions to following files:
chmod +x $CATALINA_HOME/bin/startup.sh
chmod +x $CATALINA_HOME/bin/shutdown.sh
chmod +x $CATALINA_HOME/bin/catalina.sh
Now we need to start Tomcat service by using:
$CATALINA_HOME/bin/startup.sh
root@server1:~# $CATALINA_HOME/bin/startup.sh
Using CATALINA_BASE: /opt/tomcat/
Using CATALINA_HOME: /opt/tomcat/
Using CATALINA_TMPDIR: /opt/tomcat//temp
Using JRE_HOME: /usr/lib/jvm/default-java/
Using CLASSPATH: /opt/tomcat//bin/bootstrap.jar:/opt/tomcat//bin/tomcat-juli.jar
Tomcat started.
root@server1:~#
It will start the Tomcat server, we can also check by using:
netstat -an | grep 8080
[root@server1 ~]# netstat -an | grep 8080
tcp6 0 0 :::8080 :::* LISTEN
[root@server1 ~]#
Now we need to setup the user account. Finally we need to create user accounts to secure and access admin/manager pages. Edit conf/tomcat-users.xml file in your editor and paste inside <tomcat-users> </tomcat-users> tags
vi $CATALINA_HOME/conf/tomcat-users.xml
[...]
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
-->
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
</tomcat-users>
In above configuration I have used username=admin and password=admin, you can make the changes as per your choice. Then we need to stop/start the Tomcat service
cd $CATALINA_HOME
./bin/catalina.sh stop
[root@server1 tomcat]# ./bin/catalina.sh stop
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
[root@server1 tomcat]#
Then start the service:
./bin/catalina.sh start
[root@server1 tomcat]# ./bin/catalina.sh start
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Tomcat started.
[root@server1 tomcat]#
Now access the page for login at http://192.68.0.100:8080
-----------------------------------------------------------------------------------
- To Start server: <Tomcat Root>/bin>startup.sh
- To Stop server: <Tomcat Root>/bin>shutdown.sh
Subscribe to:
Posts (Atom)