I have to use Tomcat to deploy my webapplication. I have copied the installable files and was able to install tomcat. I have very limited privilages on the linux system. I need to make tomcat run as a system service. Can anyone help?
However, when I logged out and logged in to the Linux machine, Tomcat was still running. Is it that we need not worry to restart Tomcat at every login. Any help needed
Thanks,
vamsi
Based on what you have mentioned above, looks like tomcat is already running in the background. If you want tomcat to run as a service, use the steps here
http://www.spaceprogram.com/knowledge/tomcat_init_d.html
It is possible that tomcat was started as a background process, which explain why it was still running when you logged off and back in.
The advantage of setting it up as a service is that when the server restarts, upon startup it will also startup tomcat.
Related
I'm newbie using GCP and his Compute Engine Service. I've deploy a Linux Ubuntu Image an it's running like a charm, but I have a issue running Node JS backend.
Let me explain it better:
I'm connecting using Web Browser SSH terminal or GCloud Shell ssh, and it way works running node app.js my backend starts working. But after a time, the sessions stop and my backend service stop working as well. At this time every time when I need to work have to re-activate the service each time.
How could I do for this service works in background and not depends that my ssh terminal are opened?
Thanks a lot in advance.
What actually happen is you are starting your nodejs application using an client which is parent process. So if after sometime the connection is lost of some xyz seconds the parent process dies killing your node application. Now what you can do is use screen. On ubuntu you would do something like this.
sudo apt-get install screen
after successful install run the screen command. Now you will be thrown a brand new terminal. Here you can run your nodejs code which will never die. Since screen runs your application in background. More information here
A good solution could be to use a startup script. To insert a startup script into your already created instance you need to go to this link [1]. When you have your startup script inserted in the metadata field you just need to restart your Instance and then should work perfectly without depending of the ssh session.
[1] https://cloud.google.com/compute/docs/startupscript#startupscriptrunninginstances
I've created this npm package, to make your node app run as a service on your linux machine. Please try it out.
It creates a systemctl service on your machine and runs it as a background service.
How to keep a node application running in windows even when user logs off?
Also how to keep running a node http-server even after user log-off?
You have 2 great options. One is as mentioned in comments above Forever.
The other is PM2 which is easy to install and offers an incredible amount of options. I use this in all projects, but I cannot attest to the Windows version as I am on Linux & Ubuntu servers and work on a Mac. You can daemonize your node process, follow logs, cluster it and make sure the process reboots even with a server shutdown (it is a service).
windows task scheduler: execute node.exe: start in project folder: and argument (app.js)
I am trying to create an application that would run on ubuntu desktops,I want a scenario where when the OS boots up ,it starts my application and its required services but the main ubuntu desktop does not show so it would seem only my application is running on the device,I need help on how this can be achieved links,articles,commands etc,anything that can point me in the right direction.
It is really hard to understand what you are saying but...
You must distinguish major difference between runlevel startup and user session startup.
You did not provide any information what kind of application you have.
deamon application should be launched by upstart script
user session application should be launched by .desktop entry
If you want to launch your application instead of regular session you can hijack X session launching pipeline.
At /etc/X11/Xsession.d there are 'shell' scripts. Last one 99- calls exec. You have to provide your own (let's say 98-) script and make exec call before 99-. Scripts are launched in lexical order.
I wonder if there is a way to detect if a Tomcat Server has been crashed on a LInux machine? How can i
recover it (- start it) automatically?
I can do it through a cron job. But that is not what i Want!
I want to detect immediately the time that Tomcat crashed!
Is there a way?
Any help?
Antonis
Take a look at mysqld_safe. It is mysql's launch script that monitors mysql and can recover from some errors and relaunch mysql again. You might get some hints on how to do the same thing for tomcat.
A link on how the script work is here.
I work mostly on desktop application on Windows platform. Now I am focusing on Linux platform to host web applications.
While hosting the application on Linux, I don't follow any procedure. I simply CHECKOUT the files from SVN and run the application on home directory. I don't know where to store the application data (example: mysql/postgres or Mongodb or redis, tokyo tyrant). Where to keep the log files.. What is the tip you have when we do the backend maintenance work on the server but display to the user saying that 'maintenance in progress' messages.
How do you host your application on VPS/dedicated/cloud service running Linux application?
Do you have any checklist? Do you have any tips & tricks?
Very broad question
Where do you store application data?. Most people would install MySQL which would properly store the data in /var/lib/mysql and Apache where /var/www is typically used. These applications are usually configured in /etc/apache2 and /etc/mysql.
Where to keep log files?. These almost always goes in to /var/log. For configuration check /etc/syslog.conf
How do you configure a server maintenance message?. Create a HTML file with your message and serve it by configuring apache from /etc/apache2/httpd.conf
How to do virtual Linux servers?. The easiest way is to install an instance on Amazon EC2 or you could use Oracle's VirtualBox (similar to VMWare, but free). You could also try Zen/KVM but these are far form trivial, so unless you have Linux maven around then I would stay clear of these.