LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-09-2008, 01:42 PM   #1
otie
LQ Newbie
 
Registered: Dec 2006
Location: Houston
Distribution: fedora
Posts: 8

Rep: Reputation: 0
Question mp3 file server called by apache won't respond to client request


Hi,

I have an archive for radio stations running in a number of places. Recently we've been advised that any downloadable file is a potential copyright infringement (assuming there's copyrighted material in the file).

As a result, I've written a server in 'c' so an mp3 can be delivered from above the docroot. It's your basic socket-type unix server which responds to a request on the port it's bound to.

On my site (kpftx.org/kuleft) it works fine as long as I run it from the login. I've written extensive php to control this server, move files from accessible directory to private and back, etc. All works on my own linux box (Fedora 2). On the server, however, if I start the server from the web page control, it does not respond to a request from a client. It just stays permanently in 'select()'.

It's not a selinux issue (as far as I can tell - there were a bunch of others but they're handled.

The question: why does a server work when I call it, but not when it's called by apache?

Thanks in advance for any assistance, help or pointing out how poor my code is.

O.

Otis Maclay
Houston
 
Old 04-11-2008, 12:48 PM   #2
p_s_shah
Member
 
Registered: Mar 2005
Location: India
Distribution: RHEL 3/4, Solaris 8/9/10, Fedora 4/8, Redhat Linux 9
Posts: 237
Blog Entries: 1

Rep: Reputation: 34
I think you already provided solution in your problem itself.

Problem is with permission issues.
Apache user/group is not having permission to read/execute your 'C' server binaries.

Please check whether
1. Apache user/group has permission to directory where server files resides.
2. Apache has permission to execute binaries ( if there are ).
3. Check whether you are using absolute path/relative path and its accessible by Apache.

Please update us if you still have problems.
 
Old 04-16-2008, 12:55 PM   #3
otie
LQ Newbie
 
Registered: Dec 2006
Location: Houston
Distribution: fedora
Posts: 8

Original Poster
Rep: Reputation: 0
thanks - but....

thanks for your reply, pratik
sorry to be so long replying to your suggestion - away

Unfortunately, it is deeper than permissions:

The server runs and binds to the port and shows up as 'LISTENING' in netinfo

It just never responds to a request unless started under the login as opposed to apache (the uid of the apache server)

Nothing shows up in /var/log/messages, which seems to indicate that it isn't a selinux question.

a: could it be an apache config issue?
b: could it be some secret selinux issue?

FYI, I also ran it as a root setuid and an apache setuid - made no difference.

Thanks for you response,

O.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
request for ldap server/client configuration soumalya Linux - Server 1 01-29-2008 07:24 AM
can you respond to rdate request with an ntp server? sir-lancealot Linux - Server 1 08-08-2007 05:22 PM
Session request.... (Called name not present) finzilla Linux - Networking 1 11-03-2006 05:28 PM
Need help getting dhcp client request to server. Budious Linux - Networking 0 03-26-2006 06:54 PM
respond on the interface request came in piti Linux - Networking 0 07-15-2003 05:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration