Automatic restart of c++ process attached to a wamp server - c++

I've been working on a computing server and I need to make sure it restart properly in case of crash. The computer restarts properly, so I'm trying to start my process.
Our server is a C++ executable attached to Apache on a wamp server, the whole thing on a Windows computer. So I need to find a way to :
Start Wamp when Windows restarts
Start my process when Wamp is ready
I found out how to start Wamp when Windows reboots but I'm stuck on how to get my process to start when Wamp is ready. How can I do that ?

I'm using NSSM to create windows services out of regular processes. It's painless and you can set another service as a dependency, ensuring your process won't start before it.

Related

Embedded Jetty keeps running after application exits

I have a Jetty 9 server embedded in my app and found that when I launch the program in eclipse and then stop it via the eclipse red button, Jetty stays running in the background.
I have to do a netstat to find which process owns the port and then do a taskkill.
Now do I configure jetty to die when the host app dies?
The Server instance should be told to stop.
server.stop();
Jetty does not know about any host app, it runs on its own daemon thread.
You could also just use java.lang.System.exit(int) to close the JVM and all threads it has running.
Killing the JVM (via the Eclipse Red Button) should kill all threads on that JVM too. If it doesn't, you have discovered a bug in Eclipse.
But before you go there, you should know that Eclipse IDE itself has it's own Eclipse Jetty server running (used for a number of things internally, and also for serving the documentation / help page).
So just the fact that you see an Eclipse Jetty instance running is misleading, it could be the one that the Eclipse IDE itself is running for its own reasons.

WAMP- localhost opening error

I am trying to install wamp server (following is the exact setup name) on windows 7, 64Bit OS. But it never starts, icon stays in green color meaning services start.but it is not working.
Possibilities
WAMP use port 80 : Is there any other process running which might use port 80. Skype use this port. Do you have skype ?
If the Wampmanager icon in the system tray is Orange then one of the services has not started.
Look at your MySQL error log and Windows Event Viewer, for error messages from MySQL, that should tell you what the problem is.
If you tried installing Apache and MySQL independantly before you installed WAMPServer make sure they are both properly uninstalled. Also check there is no my.ini file anywhere on your system except inside the C:\wamp folder structure.

Wamp server icon will not turn green

I read many similar questions about it but the solutions are not working for me.
The icon says WAMP Server online but it stays orange.
when I test port 80 under Apache/services/Test port 80 it says that port 80 is actually used by: Server: Apache/2.2.8 PHP/5.2.6
Shouldn't that be a good thing? As there are no other programs using port 80, despite that when I type local host I get a weird page instead of the normal one, it has pink bars
The AppServ Open Project - 2.5.10 for Windows
phpMyAdmin Database Manager Version 2.10.3
PHP Information Version 5.2.6
About AppServ Version 2.5.10 for Windows
AppServ is a merging open source software installer package for Windows includes :
Apache Web Server Version 2.2.8
PHP Script Language Version 5.2.6
MySQL Database Version 5.0.51b
phpMyAdmin Database Manager Version 2.10.3
ChangeLog
README
AUTHORS
COPYING
Official Site : http://www.AppServNetwork.com
Hosting support by : http://www.AppServHosting.com
Change Language :
Easy way to build Webserver, Database Server with AppServ :-)
I really need to start working in this project but this is preventing me from even starting.
I have solution...
Click WampServer icon in tray icons -> Apache -> Service -> Install service
(same for mysql -> Service -> Install service )
Then, Apache -> Service -> Start service (same for MySql -> Service -> Start service)
done! Enjoy :-)
If you are running Skype, stop it since it uses port80 which is needed by WAMP
You can also switch the port needed for Wamp.
Follow this article
How to change port number for apache in WAMP
Unless you really know what you are doing you should only have ONE Apache on your system.
Basically WAMPServer and APPServ are the same thing, that is they are installers for the WAMP Stack i.e. Apache, MySQL and PHP.
You only need one of them so uninstall the other, of course remember to backup anything you may want to move over to the other before you uninstall one of them.
Check if MySQL is running or not
Click on Wamp icon in icon tray then
MySQL->Service
if Start/Resume Service is visible and clickable it means your MySQL service is not running that's why it is giving you problem.
It's possible that you have installed some other application that installed and running MySQL - so already having one MySQL running is what conflicting with wamp's MySQL.
How to stop other MySQL from running?
Simply go to My Computer and search for file name "my.ini" (without quotes)
There should be at-least two my.ini files on your computer delete all other my.ini except the one in wamp directory
Restart your computer and start the wamp server it should solve your problem
As of WampServer 2.5 (64bit), these are the things I had to do to get it to go green:
In your my.ini
Change [wampmysqld] to [wampmysqld64]. Now when you start/stop wamp you should get information in your mysql log file (and errors if you have any).
I uncommented all the innodb lines under where it says Uncomment the following if you are using InnoDB tables (except for innodb_log_arch_dir and innodb_additional_mem_pool_size).
Make sure the innodb_data_home_dir is set properly, like innodb_data_home_dir = C:/wamp/bin/mysql/mysql5.6.17/data/. Do the same for innodb_log_group_home_dir.
Change the locale line to read lc-messages=en_US for English.
You can confirm mysql is up and running with Wamp Icon > Mysql > Service (Start/Resume service should be greyed out)
Install and start apache:
Wamp Icon > Apache > Service > Install Service.
Wamp Icon > Apache > Service > Start. (you can click on "test port 80" to see if something was blocking it like others have mentioned, such as skype, sql reports, etc.)
During the starting of WAMP server, the Apache service should be started as well. In case, it doesn’t start; WAMP server won’t perform as it should be.
To fix this issue, navigate to the WAMP server icon in the system tray > Apache > Service administration ‘wampapache64’ > Install Service.
it will open the Command Prompt on your screen. After closing the Command Prompt, go to the same path and click on Start/Resume Service.
The WAMP server icon should turn to green right away.
In case you can have all these but still, the icon is displaying orange color, you need to click on Restart Service button.

Coldfusion JRUN 4 Server - how to stop it

I got halfway through installing a security patch for CF801 ent (http://kb2.adobe.com/cps/890/cpsid_89094.html) on a windows 2k8 server + iis.
I made a backup copy of the WEB-INF directory as instructed. Then I tried to merge the new WEB-INF provided by Adobe. It hung up on one particular file (C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\lib\cfmx_bootstrap.jar), with the error:
Cannot delete output file (above file).
So, I tried renaming the file and got the error:
The action can't be completed because the file is open in jrun.exe.
I have stopped the server via JRUN launcher, so where could the file still be open. I tried rebooting the server in case there was something still running in the background. Error persists.
I'm new to enterprise multiserver installs, so I may be missing something basic.
Resolved: Stopping the server instance via JRUN Launcher doesn't shut the coldfusion server. I needed to stop it in services, which I tried originally, but I wasn't used to the way CF with JRUN was appearing in the services (It appears as "Macromedia JRUN CFusion Server", whereas I had been looking for services beginning with "ColdFusion" or "Adobe"). Once I found the service and stopped it, I was able to overwrite the file.
Offhand, I would try setting all the ColdFusion services to start manually instead of automatically, and reboot. Install the security pack, set the services back to start automatically, and reboot again.
HTH.

Wamp - no operation is available

I just installed wamp.
I started the application and 2 things:
I keep getting red light.
when I press the icon nothing happens, I am pretty sure it should have come up with a menu or something.
I can't restart or nothing...
I am administrator, I tried reinstalling.
ideas?
Thanks
Is there any other program using port 80 ? so that apache can't start ?
tried already to start the services by hand?
Start Menu - Run - Services.msc
and look for apache and mysql.
What OS are you running? make sure you haven't IIS running.