How do I deploy a WAR file to Tomcat 5.5? - war

I want to test my current application on Tomcat running on LINUX.

Click here to see the instructions for how to deploy a WAR file to Tomcat 5.5.
Alternately, check your {tomcat}\conf\server.xml file for the Host node and refer to the appBase attribute as follows:
<Host name="localhost" appBase="{THIS VALUE REPRESENTS A FILE PATH WHERE YOU CAN DROP YOUR WAR FILE MANUALLY}"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

I figured out the solution in my own way and hope this helps for someone who is looking for the same.
1) To create a war file from eclipse, Right click on
MyApp>export>war file>browse for the destination path>Finish
2) Download Apache Tomcat Server 5.5 from http://tomcat.apache.org/ and extract (Install) the tar.gz to a desired folder.
3) Make sure that java environment variables (JAVA_HOME and PATH) are configured in your machine.
$ echo $JAVA_HOME
If not, go ahead and add them to the bash_profile or bashrc with the JDK or JRE absolute path.
For example:
$ which java
/usr/bin/java
$ ls -l /usr/bin/java
lrwxrwxrwx. 1 root root 22 Jan 24 13:11 /usr/bin/java -> /etc/alternatives/java
$ ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 42 Jan 24 13:11 /etc/alternatives/java -> /usr/lib/jvm/jre-1.6.0-ibm.x86_64/bin/java
4) Add below lines to bash_profile or bashrc by giving
$ gedit ~/.bashrc
$ export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-ibm.x86_64
$ export PATH=$PATH:/usr/lib/jvm/jre-1.6.0-ibm.x86_64/bin
5) Logout and Log back in to reflect the changes.
6) To start the Tomcat 5.5 server, go to the extracted folder (apache_tomcat_5.5.XX) which is mentioned in step2.
apache_tomcat_5.5.XX/bin --> Right click --> open in terminal --> ./startup.sh
If the server could not and complains about permissions, add the execute permission to the .sh files by using
chmod 700 *.sh (Your terminal should point at tomcat's bin folder)
7) After starting up the server, enter localhost:8080 in your browser. If you see the Tomcat's home page, then you have succesfully configured the tomcat server setup.
8) To access manager module of Tomcat, you have to add the below lines in apache_tomcat_5.5.XX/conf/tomcat-users.xml
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="admin" roles="admin,manager"/>
Ignore this step if your xml is already configured with the manager roles by default.
9) Click Tomcat Manager on the left side menu under administration, enter admin as your username and password to get access to manager module.
10) Here you can select your buildcentral war file and deploy the same to the server. Click on the buildcentral link in the updated table to access the application from your browser.
PS: if you have any errors after the 10 step, you can see the log file for the runtime errors that are associated to your war file.
Go to apache_tomcat_5.5.XX/logs/Catalina.out

Related

AWS beanstalk wordpress

I was trying to setting up my AWS beanstalk by following the implementation guide provided by AWS.
But when I got to the "Launch an Elastic Beanstalk Environment" section, this message appeared which basically said the app is not created.
Here's the message:
[Instance: i-088472611e1ef4405] Command failed on instance. Return
code: 1 Output: ln: failed to create symbolic link
'wp-content/uploads': No such file or directory. container_command
2link in wordpress-beanstalk/.ebextensions/efs-mount.config failed.
For more detail, check /var/log/eb-activity.log using console or EB
CLI.
Does anyone have the same problem or know how to resolve this?
Try changing the efs-mount to read the following, the directory clearly doesn't exist so lets just create it.
container_commands:
1chown:
command: "chown webapp:webapp /wpfiles"
2create:
command: "sudo -u webapp mkdir -p wp-content/uploads"
3link:
command: "sudo -u webapp ln -s /wpfiles wp-content/uploads"
2create will create the directory owned by the webapp user and should let you continue.
I just faced the same issue. I am going to assume deploying via the AWS console. That is how I started.
STEP 1: I checked if there was an actual directory wp-content/uploads in wordpress-beanstalk and there was not. It might get created on the first WP upload So, I created the folder, rezipped the application, and deployed to Beanstalk via the AWS Console.
I still received the same error and moved on to step 2
STEP 2: Run EB DEPLOY from the command line
from my local wordpress-beanstalk directory
eb init
choose region (if you already created your app should be this region)
if you already created application choose that wordpress-beanstalk for example
eb use name of your environment
eb deploy
I am not certain that Step 1 is related to Step 2, but was able to successfully deploy facing the same issue using EB CLI.
This is the mounting error of EFS .
EB is using EFS storage to store the wordpress files .
Please check the no.7 in documentation .
"Modify the configuration files in the .ebextensions folder with the IDs of your default VPC and subnets, and your public IP address."
Please edit the efs-create.config file inside the .ebextension folder.
A bit late here so for anyone else having this issue, it's caused when that directory does not exist. Here are some reasons this might happen:
1). WP has not created it - Check manually that it exists.
2). .gitignore - When a .ebignore file is not present, EB uses your .gitignore instead. This can cause the directory to not be uploaded with the EB deploy command. If this is the case, make a .ebignore, EB will start ignoring the .gitignore
3). Document root - If you have modified the document root, to something like /src you have to modify the efs-mount.config file.
##############################################
#### Do not modify values below this line ####
##############################################
container_commands:
1chown:
command: "chown webapp:webapp /wpfiles"
2link:
command: "sudo -u webapp ln -s /wpfiles src/wp-content/uploads"
Even though the file mentions not to modify it, you have to add your document root path in the 2link entry. Change wp-content/uploads to src/wp-content/uploads (replace src with your document root)
Finally, I would not include a command to automatically make this directory, as that only puts a band-aid on the problem.
Hope this helps

How to upload my Symfony project to shared hosting?

I have a Symfony 3 app that I need to deploy to a shared hosting server - hostgator. I have copied all of the contents from the web folder into the public_html folder. I also copied all the other folders on the root of my directory. However, I does not run.
Did you check the proper permissions in particular the var/ folder, this is described on this page.
Also, if they use apache, you will have to set the owner:group of the web folder properly.
In Linux that is done easily by this command (from the root folder):
$ chown -R apache:apache web/
Try that out (you might need sudo access to run chown).

Nginx fails to create directories on Windows 10 with error: nginx: CreateFile()...failed

I need to find a way/setting to allow Nginx to run a .bat file that will create directories and files via a WINDOWS service; my OS is Windows 10.
Currently, our windows service fails to create directories and files with the following:
CreateFile()
"C:\someForlderName\build\distribution.\nginx/logs/error.log" failed
(3: The system cannot find the path specified)
Somehow Nginx doesn't have enough permissions to perform write-access operations like creating directories such as /logs/ and /temp/ within the /Nginx/ directory.
Anybody ran into this problem before?
I was facing the same problem, sharing the thing that worked for me.
Nginx is showing this error because... nginx didn't find the error.log file..
For that,
Go to you nginx folder where other folders like conf, docs, html etc are their as.
Create folder name logs, and in that folder create a file name error.logas.
see the right way in picture..
If your Nginx is at D:\nginx\nginx.exe, execute this to start nginx
D:\nginx\nginx.exe -c D:\nginx\conf\nginx.conf -p D:\nginx\
For Nginx on Windows, you need to execute nginx server related command from respective home directory where nginx configuration file is located.

Openshift JBoss Logging

Hi I am deploying my spring application to Openshift Jboss AS. The problem is whereever i placed the log4j.properties it is not read by the application. I've tried the following ways to achieve this but can't.
Placed my log4j.properties in WEB-INF/classes.
Placed my log4j.properties in WEB-ING/resources and in web.xml loaded the
context-param for log4jConfigLocation.
Created a
jboss-deployment-structure.xml in META-INF which excludes log4j
logging.
Nothing seems to work . Can some one please help me.
In Jboss there is a default logging available, which can be implemented by modifying standaole.xml.
In Openshift when you ssh into your app using the below command
rhc ssh <app-name>
You will taken into your application where when you give ls command you will see the list of files and folders, you can find jbossas folder change your working directory to that folder
cd jbossas
execute ls command you will see list of folders where you will find standalone folder, change your working directory to this folder
cd standalone
again execute ls command you can see configuration folder, change your working directory to this
cd configuration
now if you execute ls command you can see standalone.xml, we need to edit this file, but editing here may not work because this standalone.xml is a copy of the another file which is in the following folder .openshift/config/standalone.xml . You can find this folder where you clone your git copy, Not in eclipse go to your working directory in window.
We need to edit this file and add our logging properties here. thats how it works

Websphere 8.5- Application cannot get image from symlink

I have installed Websphere 8.5 and update to Websphere 8.5.5.4, OS: Redhat 6.3
I have installed Application is apptest.war
I have created symlink in folder apptest.war link to Folder on system:
ln -s POSImage /Images
I checked permission folder POSImage and /Images full permission
when I get image in folder /POSImage by URL below show error:
http://192.168.5.4:9080/apptest/POSImages/POS_543956_1425272116854_picture1.jpg
Error 404: javax.servlet.ServletException: java.io.FileNotFoundException: /POSImages/POS_543956_1425272116854_picture1.jpg
but upload images from Application to Folder POSimage is good.
Please help me.
I am no expert by any means, but I have been doing some very similar stuff recently myself. I have a few things to say that MAY help.
1: When I do my link creation, I do the creating in he directory in which I want the link created.
2: I also use the full path for the link. So, the syntax looks like:
ln -s /full/path/to/file/or/directory linkName
3: Finally, I do not include the / that I see in your syntax (/Images).

Resources