Listening to Ports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are two ways to do this. You can write a daemon and bind it to the 
port. You can use something like IO::Socket for that. If all you want is a 
simple script that just sends some sort of response when it is connected 
to, just use inetd.conf to map a specific port to your script. (see man 
inetd.conf) This is by far the quickest and easiest way to do it. TBH you 
don't need a book. Doing it through inetd is easy, you need something like 
this:

/etc/services
robintest       1234/tcp

/etc/inetd.conf
robintest       stream  tcp     nowait  root    /var/home/robin/test.pl


This runs the script /var/home/robin/test.pl as UID root when you telnet to 
port 1234.  That should be enough to get a basic web page sent out anyway.



R


R


At 08:12 PM 02/03/02 +0000, you wrote:
>Hi All,
>
>I'm trying to write a perl script that listens to a specific port and
>returns a web page when that port is accessed.
>
>What would be the best way to do this? I searched the logs of this list and
>found something, but the last result was in 1996, so I figure things will
>have changed by now. Is there a good book I could buy on this ?
>
>TIA,
>
>Mark Carruth
>
>
>
>
>_______________________________________________
>Redhat-devel-list mailing list
>Redhat-devel-list@redhat.com
>https://listman.redhat.com/mailman/listinfo/redhat-devel-list





[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux