+ Post New Thread
Results 1 to 5 of 5
Web Development Thread, PHP access outside of /var/www in Coding and Web Development; This is probably a stupid question but I work in general school IT and any web stuff I do in ...
  1. #1
    pwds's Avatar
    Join Date
    Dec 2008
    Location
    Derby
    Posts
    279
    Thank Post
    73
    Thanked 48 Times in 38 Posts
    Rep Power
    20

    PHP access outside of /var/www

    This is probably a stupid question but I work in general school IT and any web stuff I do in addition to the job description. Starting an OU degree in web applications but it'll be a couple of years before I get to server configuration.

    Recently I've been experimenting with some open source video applications like KalturaCE and Red5 open source flash. To cut a long story short I have created a symlink for /var/www/kalturaCE/content/webcam to point to the Red5 streams directory at /usr/share/red5/webapps/oflaDemo/streams.

    When recording from webcam from within Kaltura it seems to be able to record the file without any problem using Red5, but Kaltura then isn't able to play back the file.

    Is this as PHP isn't able to read outside of /var/www and if so how can I give it access? For obvious security reasons I'd like to restrict it just to that path.

  2. #2
    SteveBentley's Avatar
    Join Date
    Jun 2007
    Location
    Yorkshire
    Posts
    1,431
    Thank Post
    119
    Thanked 263 Times in 189 Posts
    Rep Power
    72
    Apache will run as a specified user, and by extension PHP uses that same user. You can find this from phpinfo() - often something like 'nobody'.

    For PHP scripts to be able to read and write, that user has to have rights (using the standard Unix chmod and chgrp type permission change commands) to the files/directories concerned.

  3. Thanks to SteveBentley from:

    pwds (9th March 2010)

  4. #3
    jmcdermott's Avatar
    Join Date
    Feb 2008
    Location
    Cornwall
    Posts
    171
    Thank Post
    16
    Thanked 42 Times in 34 Posts
    Rep Power
    21
    Default user for most linux web servers is www-data.
    so:
    sudo chown www-data /usr/share/red5/webapps/oflaDemo/streams

    sudo chmod u=rw,go= /usr/share/red5/webapps/oflaDemo/streams
    or
    sudo chmod a+rw /usr/share/red5/webapps/oflaDemo/streams


    I think.

  5. Thanks to jmcdermott from:

    pwds (9th March 2010)

  6. #4
    SteveBentley's Avatar
    Join Date
    Jun 2007
    Location
    Yorkshire
    Posts
    1,431
    Thank Post
    119
    Thanked 263 Times in 189 Posts
    Rep Power
    72
    Just need to make sure that the account you use for ftp can also access it, by putting it in an appropriate group.

  7. Thanks to SteveBentley from:

    pwds (9th March 2010)

  8. #5
    pwds's Avatar
    Join Date
    Dec 2008
    Location
    Derby
    Posts
    279
    Thank Post
    73
    Thanked 48 Times in 38 Posts
    Rep Power
    20
    Turns out this was a Red5 error as downloading the files using SFTP or playing them in OflaDemo also didn't work- obviously it's not fully recording the file.

    I suspect this is due to server resources so I'll try it on something a bit more substantial and see how I get on.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 3
    Last Post: 11th December 2009, 09:59 AM
  2. Redirecting from WWW.
    By tomdawson in forum Web Development
    Replies: 7
    Last Post: 2nd March 2009, 08:53 AM
  3. Can access intranet but not WWW
    By speckytecky in forum General Chat
    Replies: 4
    Last Post: 16th December 2008, 09:41 AM
  4. Workstation can access local proxy but not WWW
    By speckytecky in forum Network and Classroom Management
    Replies: 3
    Last Post: 15th December 2008, 10:27 AM
  5. permissions on /var/www
    By browolf in forum *nix
    Replies: 10
    Last Post: 11th August 2007, 05:36 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •