This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / Question: One CGI programm is a deamon smtp server, booted by the apache call. what is the default user/group of this deamon program?in my Solaris+Apache, it is uucp, I dont know why?
Bye the way, this deamon process cannt bind to the port, but another indepent smtp server can do so. Why?
I know once the program have the setuid bit and owned by root, then it can use the port 25, why this deamon process in CGI can't?
Any suggestion are appreciated!
-mike20030405(mike);
2005-6-16
{324}
(#2350570@0)
-
up
-mike20030405(mike);
2005-6-16
(#2350586@0)
-
up
-mike20030405(mike);
2005-6-17
(#2351249@0)
-
what is your question? I can not understand what you have written.
-bugfree(BugFree);
2005-6-17
(#2351257@0)
-
sorry my poor english
-mike20030405(mike);
2005-6-17
(#2352585@0)
-
My English also sucks so I can understand you :-)
-holdon(again);
2005-6-17
(#2352719@0)
-
tell you what I do with this kind of daemons.
-unknown2me(行者);
2005-6-17
{1476}
(#2351369@0)
-
Thanks a lot. I resolved the trouble, just because sendmail occupy the port. BTW, I can't type chinese in office,so bad!
-mike20030405(mike);
2005-6-17
(#2352579@0)
-
On Unix systems only root user can bind on lower than 1024 ports. So you have two way to do it: setuid and sudo.
http://www.cyberteams.com/wsdexpress/help/WSDEXPT_UNIX_Perm.htmldo it by setuid:
ls -lrt /.../cgi-bin/deamon
chmod 6755 deamon
chown root deamon
do it by sudo:
check httpd.conf to know the httpd user, nomally nobody.
check the sudo document , add it to /etc/sudoers
let nobody run deamon as root.
modify your cgi, create another cgi d1, let d1 call "sudo deamon"
let http user call d1.
On the other thought, since it's a deamon, why don't you directly start it by root? just like the apache deamon.
-holdon(again);
2005-6-17
{453}
(#2351393@0)
-
Thanks a lot, I got it.
-mike20030405(mike);
2005-6-17
(#2352584@0)