Jump to content

Stickybit

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by Stickybit

  1. Hi guys The mtasa://server:port url option is quite cool, but what about password? How can I specify a password in the url? Regards Stickybit
  2. That's not an easy task - since MTA traffic is UDP - and the software is closed source. A reliable script for that purpose would have to come from the MTA team, or from some nasty hacker / cheater who has revese enginered the MTA traffic. Regards Stickybit
  3. Hi guys I have updated the script to match MTA:SA version 1.0: Click here to see an example. Click here to see the sourcecode. Grap a copy for your website. Regards Stickybit
  4. Hi Guys Great work .. very great work. No question about it. You MTA guys is the best. A short question though: Is is possible to run the linux server as a daemon, without the interactive shell? Regards Stickybit
  5. Nope. Yes. Nope. Only real sysadm's who has root acces - and who can handle root acces, should mess with daemons. -Stickybit
  6. The script for version 5 is the same as for version 4. Just replace the version numbers. The script should be part of the init.d / rc.d scripts - and could then be automaticly started and stopped when entering / exiting specific runlevels. This ain't a cgi script for a webserver, so password protected directory's isn't an option. Password protected diretory's isn't really security anyway - it's just a webserver feature. Only root should be able to start daemons, and daemons (especially 3. party daemons without sourcecode) should never run as root. That is the reason for the sudo'ing. This isn't a script for your webpage. It's a plain perl script for shell execution. -Sticky bit
  7. The script has been slightly modyfied - so it matches version 0.5. Click on the "Bugfixed version" link in the above posting, to get the new version. MTA team: Why do you erase the logfile when restarting the server? It would be nice if you just apended data to the logfile instead of emptying it on server starts. Regards Sticky
  8. I gues that you has got some wrapped lines after having copied the code to file. Remove these wraps, and give your webserver read permissions on the logfile.. and you should be up running. Bugfixed version Regards Stickybit
  9. Nope .. you just visited the page while I was moving to another server. i works fine now. Regards Stickybit
  10. Click here to see the script in action. -Stickybit
  11. I see no problem in running the script on a PHP capeable IIS server... unless the Windows version of MTA server is using an other logformat. Instead of executing wget.. you can use fopen to open the remote file in the mode needed. -Stickybit
  12. .. and for ver. 0.4 - pretty much the same: #!/usr/bin/perl use English; die "\nYou must be root in order to start the MTA server.\n\n" if ($EFFECTIVE_USER_ID != 0); die "\nUsage: $PROGRAM_NAME {start|stop}\n\n" if (!(($ARGV[0] eq 'start') or ($ARGV[0] eq 'stop'))); $action = $ARGV[0]; $user = 'mta'; $dir = '/opt/MTAServer-0.4/'; $bin = 'MTAServer0.4'; CASE: { ($action eq 'start') && do { print "\nStarting MTA daemon.\n\n"; chdir($dir); system('sudo -u ' . $user . ' ' . $dir . $bin . ' -b') == 0 or die "Fatal error while starting server.\n"; last CASE; }; ($action eq 'stop') && do { print "\nStopping MTA daemon.\n\n"; system ('ps -C ' . $bin . ' -o pid= | xargs kill -9') == 0 or die "Fatal error while stopping server.\n"; last CASE; }; } -Sticky bit
  13. Hi guys Would it be possible to get a copy of mtastatus.php for local use? -Sticky bit
  14. Hi guys I have a few suggestions for the linux server: 1: An option for generating .pid files would be nice. 2: Force the server to run as a non-superuser - or include documentation on how to make a secure installation - or include a start script which starts the server in a secure way. 3: A default unix-like directory structure like this: [installdir]/bin/MTAServer0.3 [installdir]/bin/SecureStartScript [installdir]/etc/mtaserver.conf [installdir]/etc/motd.txt [installdir]/etc/banned.lst [installdir]/doc/README [installdir]/doc/CHANGELOG [installdir]/var/mtaserver.pid -Sticky bit
  15. Hi Guys Having installed the server program on a linux server.. i realized the the program needed some kind of startup script... so I wrote one: /sbin/mta. here is the simple code: #!/usr/bin/perl use English; die "\nYou must be root in order to start the MTA server.\n\n" if ($EFFECTIVE_USER_ID != 0); die "\nUsage: $PROGRAM_NAME {start|stop}\n\n" if (!(($ARGV[0] eq 'start') or ($ARGV[0] eq 'stop'))); $action = $ARGV[0]; $user = 'mta'; $dir = '/opt/MTAServer-0.3/'; $bin = 'MTAServer0.3'; CASE: { ($action eq 'start') && do { print "\nStarting MTA daemon.\n\n"; chdir($dir); system('sudo -u '. $user .' '. $dir . $bin .' -b') == 0 or die "Error while starting server.\n"; last CASE; }; ($action eq 'stop') && do { print "\nStopping MTA daemon.\n\n"; exec ('ps -C '. $bin .' -o pid= | xargs kill -9') == 0 or die "Error while stopping server.\n"; last CASE; }; } Before you can use this script.. you must create a non-priveleged user called "mta"... and alter the content of $dir to reflect your MTA install directory. For increased security, I have set these permissions on the files: -rw------- 1 mta mta 0 Oct 26 17:31 banned.lst -rw------- 1 mta mta 1417 Dec 31 02:46 CHANGELOG -rw------- 1 mta mta 49 Feb 8 11:02 motd.txt -rwx------ 1 mta mta 178897 Dec 31 20:32 MTAServer0.3 -rw------- 1 mta mta 8489 Feb 8 11:00 mtaserver.conf -rw------- 1 mta mta 3092 Dec 31 02:48 README That was my 50 cent. Thanks for a great program. -Sticky bit
×
×
  • Create New...