Running Tomcat from windows 10 bash shell - bash

I installed tomcat server on windows10 bash shell. Though it says apache is running.. its not opening admin panel in browser. Browser says 'Connection can't be reached'
Have someone tried this ever before? Please share your inputs.
Thank you

I am assuming you are referring to Bash for Windows (Ubuntu) on Windows 10. Yes Tomcat server can be installed and run from Bash for Windows with no need to install Tomcat in the Windows environment.
First, you may want to check if any local server is running on Windows 10 port 8080 - the default port for Tomcat, or whatever port you are configuring Tomcat for.
Second, open BASH for Windows and install Java. I used Oracle Java JDK 8 (http://www.oracle.com/technetwork/java/javase/downloads/index.html) and downloaded the tar.gz file.
Extract the tar.gz and copy to a standard directory like /usr/local/java or in the /opt/ directory for easy access.
Create JAVA_HOME and JRE_HOME environment variables that link to your java location.
I also updated the alternatives to map java, javac, and javaws. You can use this link to assist (http://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre)
Then download the tar.gz of Tomcat. Again, I used Tomcat 8.5 for my scenario and extract the files to your chosen directory.
Last, run the startup script located in the bin folder of the tomcat extracted folder. You should have a working Tomcat version.
Use the curl command to validate - curl localhost:8080
If you want to change the admin privileges, edit the tomcat-users.xml file located in the conf folder within the extracted tomcat directory.
Access to the tomcat server can also be done through the Windows system and not just through the Bash for Windows CLI.
Hope this helps!

Related

install weblogic on console mode without xming

I'm trying to install weblogic server on Centos 7 with following instruction of oracle about console mode. Everything will be fine till weblogic file 's extracting on my computer. I get this message about
display enviroment variable failed
I google it and found xming as solution. But is there any solution to install weblogic without xming.
You need to do a silent install as mentioned. You can find the documentation here.
Basically, you need two files:
A response file
Here, you will set some parameters like ORACLE_HOME, proxy information if needed and installation type, etc.
An oraInst.loc file
In this file, you need to do the following(from documentation):
Replace oui_inventory_directory with the full path to the directory where you want the installer to create the inventory directory. Then, replace oui_install_group with the name of the group whose members have write permissions to this directory.
After doing all of this, you can run the command as follows;
java -jar distribution_name.jar -silent -responseFile file [-options] [()*]
I uploaded my own oraInst.loc and response files here for demonstration. I strongly suggest you to read the documentation though. Good luck.

How do I upgrade Apache Tomcat from 6.0.20 to 6.0.24?

Our security team has scanned our production server and identified vulnerabilities with Apache Tomcat server v 6.0.20.
They have recommended that Apache be upgraded to 6.0.24. Reading through the forums, I believe this is the process to do so
Take a backup of httpd.conf file
Using add remove programs, uninstall version 6.0.20
Install 6.0.24
But, I have some questions depending on a quick test I did to install 6.0.20 and upgrade it to 6.0.24
Where do I get Tomcat administrator login information?
Is it enough just to backup the HTTPD.CONF file? I was thinking to back up everything in the Apache folder instead.
Is it possible not to upgrade 6.0.20 to 6.0.24 by running the MSI installer over the same Apache folder? Is it due to the HTTP/1.1 Connector Port being busy/used that doesn't allow an update of Tomcat on the same port?
Is a restart of the server required after upgrade?
Last but not the least, I am using these executables to test the upgrade. 6.0.20 gets installed fine but when I run 6.0.24, it prompts me for the JRE path and directing it to 6.0.20 JVM Path gives me a message that "JVM is not found". The JVM info on the Apache manager is in this directory
What am I missing here?
I need your thoughts and advice to make this as easy as possible since this is a production server.

How to start tomcat server manually

I installed tomcat 7 in my windows 7.Then ran C:\apache-tomcat-7.0.57\binstartup.bat,one window will open for 1 second and closes.when i hit http //localhost/8080 ,its not dsiplaying anything.I just checked C:\apache-tomcat-7.0.57\conf/server.xml and port is 8080.
Can somebody help on this.
Read RUNNING.txt and create C:\apache-tomcat-7.0.57\bin\setenv.bat file that sets JRE_HOME (or JAVA_HOME) path for Tomcat.
Sample from Tomcat 7 RUNNING.txt file using Java 6 JRE:
set "JRE_HOME=%ProgramFiles%\Java\jre6"
exit /b 0
You need to set Java_Home in Cataline.bat first in order to run TomCat server.
Additional Information for running project using Tomcat Server.
You can cd into the folder where tomcatXX/bin is through command line and run "run startup". So, when you , run startup on command line it tries to run script from startup.bat file, probably it crashed because port to be used by TomCat to run server is already in use. If you try to point your url to localhost:8080, if TomCat's home page appears, that would be because your server is already running. You should ideally also try to point to Windows -> Preference -> Runtime Environment. Check if Tomcat server is added in list under Server Runtime Environment window, if not try to add that server by clicking Add button, and trying to locate where Tomcat/bin is stored. If that still doesn't help, I would suggest you to also try right clicking a project on your IDE then click Run As, then click Run Configuration, it will give you option to run application using TomcatServer. List of servers will be found on left side of Run Configuration window.

Install Liferay as Windows 2012R2 service

I am a newbie on Liferay and furthermore 100% Windows infrastructure knowledge based. I installed Liferay 6.2 on my Windows 2012R2 server together with Java jdk-8u5 version. All is running perfect as long as I am logged in as user on the Server via remotedesktop having open the tomcat startup.bat window.
What have I to do exactly to start Liferay and/or tomcat as service?
Thanks in advance for your efforts.
Configuring liferay or tomcat to run as a service on a windows server doesn't differ that much.So in order to do that you have to add some files to the LIFERAY_HOME\tomcat\bin directory.
To get those files you have to download a full version of 64-bitWindows tomcat from here :
http://tomcat.apache.org/download-70.cgi.
Extract the zip and go to the bin directory, copy service.bat , tomcat7.exe and tomcat7w.exe to this location : LIFERAY_HOME\tomcat\bin
Setting Up the service
Open the commad prompt (Make sure you have admin rights or run the command prompt as administrator),In Command Prompt go to LIFERAY_HOME\tomcat\bin and Execute the following command
service.bat install tomcat7
This will install the tomcat6 service in windows.
Now execute following commond to setup additional configuration for the service
tomcat7w.exe ES tomcat7.exe
2 . Extra configuration :
-XX:MaxPermSize=512m
-Dfile.encoding=UTF8
-Duser.timezone=GMT
-Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config"
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
and make sure to provide enough memory for your service by setting the initial memory pool and the maximum one.
Either go with Rafik Beldi's answer (quite an effort, wow) or just go to tomcat's documentation in case you're still missing some information
I had to delete what was in Java Options completely or it wouldn't start: and then I entered:
-XX:MaxPermSize=512m
-Dfile.encoding=UTF8
-Duser.timezone=America/New_York
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
-Djava.net.preferIPv4Stack=true
note that where I am: America/New_York allows for both EST and EDT

Can't setup remote debugging with JBoss Web 2.1.4 windows and eclipse

I'm unable to find an option to setup remote debugging in JBossWeb 2.1.4 on Windows. It is not installed as a service and there are no .bat scripts where I can edit the JAVA_OPTS environment variable to include:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4142
The only thing in the jboss web bin directory are jbossweb.exe files.
I've tried editing the run configuration in eclipse to start the container by running jbossweb.exe and setting the environment variable JAVA_OPTS to the above, but it doesn't listen on port 4142 on startup (ie, there seems to be no effect in adding the environment variable to the run configuration).
Any ideas here?
If you control the server from eclipse with for instance JBoss Tools, you can just click "debug" instead of "start" in the Server pane in order to start up in debug mode.
You can create such bat script by yourself. Just add jboss.bat file to bin subdirectory of JBoss install directory and put there:
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4142 -jar "D:\JBoss.org\JBoss Web 2.1\bin\bootstrap.jar" start
When you run this script, you will get JBoss running in debug mode. Probably, it won't help you in all situations, but it worked for me.

Resources