Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

allowing anonymous users of Apache to write to a file and ttyS0

Status
Not open for further replies.

NewtownGuy

Technical User
Jul 27, 2007
146
US
Hello,

From feedback on the perl forum, and from an error message in /etc/log/httpd/error_log, it is clear that I don't have permissions set correctly for anonymous users of Apache 2 to write some debug info to a test file and to write some real data to /dev/ttyS0. I'm running Fedora Core 3.

I have a perl script in /var/ The script is activated by a browser on the Internet. I want the script to be able to write to /var/ for debugging, and to /dev/ttyS0 to do what I really want to do, which is to output a byte string to a robot via a COM port. There currently is no file name for the string that gets written to /dev/ttyS0, although I have the usual OPEN statement as a file handle.

I see in /etc/httpd/conf/httpd.conf that the default User is apache and the default group is apache. I don't know if this is relevant or not, or how to use it.

At boot time, what command(s) do I need to give, and in what file do I need to place them, so that anyone who anonymously accesses my script remotely can write a test file and can write a string to /dev/ttyS0 ?

Thank you.

-- NewtownGuy
 
If you want apache to be able to write to a file, you will need to give it read/write permissions by everybody. To do that to the file you gave in your example, you would issue this command:

chmod 666 /var/
I don't know enough about your other issue to be of any help but can you send the contents of the file to COM1 something like this:

/var/ > /dev/ttys0

I know you might have to change permissions for that device but I'm not sure how to access it outside of a console.
 
TO: RyhthmAce (TechnicalUser)

Thank you.

Since I want the permissions to be active upon boot, what startup file would I put the chmod command in so it runs automatically upon boot ?

Does the test.txt file have to exist at the time the chmod command is given, or will Linux remember the command and apply it in the future whenever the file is created ?

-- NewtownGuy

 
the device file (ttys0) is outside the scope of this forum. You may have better luck with the linux (server) forum. forum54 However, you don't need to use a script to change permissions. As root you can do it from the command line. If you move this thread to the linux forum, be sure to specify how /dev/ttys0 will be accessed. Will it be a particular user, a group or anybody? How will you be connecting? Console, camera, iPod, etc. Does it aready exist or does it need to be created? It would also help if you can give an overall picture of what it is you want to do. There may be better solutions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top