PDA

View Full Version : APMM - Apache, PHP and MySQL Monitor



coderpp
January 23rd, 2009, 10:50 PM
Program main features:

Start/stop/restart all (apache and mysql)
Start/stop/restart apache
Start/stop/restart mysql
Add/remove autostart
See server status - started/stoped, uptime
...


1. Is there already such program for linux with GUI?
2. How can i start/stop these programs from my program (i will write in c++)?
3. What about user rights? to stop or start apache need super user right.

Reiger
January 23rd, 2009, 11:11 PM
(1) Probably. A program to do the start/stop/install stuff is exceedingly easy to make because each action corresponds to a simple command line:

sudo /etc/init.d/<service_name> <command>
For instance:

sudo /etc/init.d/apache2 restart
(2) See above.
(3) Yes you will require super-user rights. It ought to be resolved by creating a desktop file (the launcher) which executes (if you want to login as root)

gksu <actual_command> or (if you want to login using 'ordinary' sudo)

gksudo <actual_command>

The <actual_command> is whatever it takes to launch your program. The gksudo or gksu means you'll get a nice GNOME login window first (or fail if you don't have the gk[sudo/su] program) but there is a KDE equivalent as well.

Tibuda
January 23rd, 2009, 11:31 PM
For Apache setup you can try
sudo aptitude install rapache (apt:rapache)