Forum Replies Created

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • in reply to: Redirect ASP not working #379270
    jimlooney
    Participant

    thank you for replying.

    I did end up redirecting to a php script which pulls the ID, sends the 301 in the header and delivers the related pdf.

    I just didn’t think it would send back the right header at the right time, but the SEO dude who wanted this done says it looks good so I’m considering it done.

    thanks again for replying

    in reply to: XServe Drive Tray/Sled #372474
    jimlooney
    Participant

    I do see a ton of results for the full drive module, but all I really want are the trays/sleds. Because you can buy much cheaper ATA drives (or SAS drives for the newer ones) and install them in the sleds. That gets you a whole lot of disk space for a whole lot less $$ than buying the full Apple Drive modules.

    in reply to: Tiger Server: FTP, w/o SFTP and SSH #371805
    jimlooney
    Participant

    nevermind. found the answer.

    [code]sudo dseditgroup -o edit -a root -t user com.apple.access_ssh[/code]

    in reply to: chroot ssh/sftp on Tiger server #371804
    jimlooney
    Participant

    nevermind. found the answer.

    [code]sudo dseditgroup -o edit -a root -t user com.apple.access_ssh[/code]

    in reply to: chroot ssh/sftp on Tiger server #371803
    jimlooney
    Participant

    well i decided to just try it and guess what? root is not immune. So, anyone know how I can add root to the list?

    in reply to: chroot ssh/sftp on Tiger server #371802
    jimlooney
    Participant

    i was thinking “didn’t i do this before?”, so searched the site, and found an old post I did. Started to set up an access list but need to add root – possible? or does root remain immune to ACL?

    [url]https://www.afp548.com/forum/viewtopic.php?forum=2&showtopic=11531[/url]

    in reply to: running sips via Perl/PHP system function #371457
    jimlooney
    Participant

    hehe.ya, this would not be accessible to the public, and it’s just for proof of concept right now. 🙂

    So I output the sips command to screen now too:

    [code] echo “/usr/bin/sips –resampleWidth 60 $source –out $thumb
    “;
    exec(“/usr/bin/sips –resampleWidth 60 $source –out $thumb”, $output, $retval);
    [/code]

    and it looks fine:

    [code]Running sips as uid=70(www) gid=70(www) groups=70(www), 80(admin)
    /usr/bin/sips –resampleWidth 60 /Users/php/acuweb_helpers/1.jpg –out /Users/php/acuweb_helpers/sipsthumb.jpg
    Returns: 6
    array(0) { }[/code]

    Hehe, it’s driving me bonkers.

    in reply to: running sips via Perl/PHP system function #371454
    jimlooney
    Participant

    Thank you so much for trying to help me with this.

    When I ran your script on command line, it works fine:

    [code][aw1:/users/php/acuweb_helpers] root# ./sipstest.php ./1.jpg

    Running sips as uid=0(root) gid=0(wheel) groups=0(wheel), 1(daemon), 2(kmem), 3(sys), 4(tty), 29(certusers), 8(procview), 5(operator), 9(procmod), 80(admin), 20(staff)

    /Users/php/acuweb_helpers/1.jpg
    /Users/php/acuweb_helpers/sipsthumb.jpg[/code]

    However, that is what I mentioned previously – the problem is when run through a browser. So I converted your script:

    [code]



    “;

    exec(“/usr/bin/sips –resampleWidth 60 $source –out $thumb”, $output, $retval);
    echo “Returns: “.$retval.”\n
    “;
    var_dump($output);
    foreach ( $output as $line )
    {
    echo “$line\n
    “;
    }

    ?>

    [/code]

    When I run that through the browser (like sipstest.php?image=/Users/php/acuweb_helpers/1.jpg), it outputs:

    [code]Running sips as uid=70(www) gid=70(www) groups=70(www), 80(admin)
    Returns: 6
    array(0) { }[/code]

    So the call to sips is failing and returning a 6. Can you test on your server? I am running 10.4.9, and php 4.4.4

    in reply to: running sips via Perl/PHP system function #371435
    jimlooney
    Participant

    I’ll check the different php configs. Although, yes, if I can get it to work in Perl then that would be great. I tried it like this, but it does not work ($? returns a 6):

    [code]my $comm = “/usr/bin/sips –resampleWidth 60 $path –out $thumb_path”;
    system($comm) == 0 or die “$? $! / ” . ($? >> 8);[/code]

    I also tried it with backticks:

    [code]
    `/usr/bin/sips –resampleWidth 60 $path –out $thumb_path`;
    [/code]

    Any Perl pros in the house?

    in reply to: running sips via Perl/PHP system function #371428
    jimlooney
    Participant

    lastly, I also changed over to use the PHP builtin image functions, but still have issues when perl calls the php script. Here are details.

    Ok, maybe you can still help me. If I call my php script directly from the browser, then using the PHP builtin functions works. However, if I call it from the Perl script, then the php script fails at:

    $src = imagecreatefromjpeg(“$path”);

    So, here is the code. This one works fine when called from the browser directly as so:

    http://domain.com/create_thumb.php?path=/Users/aw/www/images/uploads/1.jpg&path2=/Users/aw/www/images/uploads/thumbs/1.jpg

    [code]
    [/code]

    Now, it fails if from my perl script I call the php script like this:

    `/usr/bin/php /Users/php/acuweb_helpers/create_thumb.php $path $thumb_path`;

    [code][/code]

    And note – I also have the php script writing some stuff to a text file so I can troubleshoot. for instance I did implode(‘,’, $argv) and wrote that string to the text file and it shows that the 2 image paths are coming in correctly.

    in reply to: running sips via Perl/PHP system function #371427
    jimlooney
    Participant

    Here are the only differences between the php.ini files on the server where this all works, and on the server where it does not work:

    sips works:
    memory_limit = 8M

    sips does not work;
    memory_limit = 50M
    ———————————————
    sips works:
    extension_dir = “./extensions/”

    sips does not work:
    extension_dir = “./”
    ————————————————
    sips works:
    ;extension=php_gd2.dll

    sips does not work:
    extension=php_gd2.dll

    in reply to: running sips via Perl/PHP system function #371426
    jimlooney
    Participant

    It returns a “6”, but I don’t see anywhere that lists what the heck the error codes mean, so it doesn’t help me much.

    Here’s what I’ve got going:

    Ok, so here is what I am trying to do. I have this old Perl script which I cannot get rid of because it is part of a large content management system. It has an image uploader which currently uploads just about anything. I want to take advantage of OSX’s “sips” command to resample the image and generate thumbnails. This is just a unix command, so I should be able to use one of the functions in the title above. However it doesn’t work.

    I tried calling directly in Perl, but it wasn’t working so then I switched to have perl call a php script so I could try and call sips or go another direction and use PHP’s image functions to do the resizing. So when I was calling directly from Perl, it looked like this ($path and $thumb_path are set based on the account running the script. I have verified that the values are correct):

    my $comm = “/usr/bin/sips –resampleWidth 60 $path –out $thumb_path”;
    system($comm) == 0 or die “$? $! / ” . ($? >> 8);

    In Perl, there are also system() and bactick operators. So, in the Perl code, right after the image is uploaded, I add a call to a php script :

    [code]
    `/usr/bin/php /Users/php/acuweb_helpers/create_thumb.php $path $thumb_path`;[/code]

    $path is the path to the image
    $thumb_path is where I want to write the thumbnail file to

    Now, the php script looks like this:

    [code][/code]

    All the extra stuff there is just me troubleshooting – I write to a text file, the command that I am passing to exec() so I can make sure it comes out right (which it does, everytime).

    So, the problem is that the exec() fails. I have checked permissions and they are wide open. I even modifed the command to be like this (to try and force the command to be executed as root user):

    [code]`sudo -u root -S /usr/bin/sips –resampleWidth 60 $path –out $thumb_path < /etc/root.secret`;[/code] Oh, and since I am printing out to that file (just so I can see the full command being sent to exec()), I can take the string from that file, put it in a php script and it works just fine. In other words, if you look at my code above, the command contains variables that need to be interpolated. However if I just run this script, it works fine: [code] [/code]

    So, apparently I am set to run exec w/o trouble. Note that I have also used the backtick operator and passthru on different occasions. Any other thoughts on ways to troubleshoot? For example, does anyone know the significance of the return error codes for exec()? When I run this it always returns a 6.

    in reply to: running sips via Perl/PHP system function #371411
    jimlooney
    Participant

    Ya, thanks anywho, i guess I’ll just use GD. I was just perplexed as to why I can run other commands via system() but not sips. And also, why running sips via system() on Panther works, but not on Tiger. It annoys me Apple makes changes like that, which might take sysadmins by surprise.

    in reply to: cbl.abuseat.org listing #370469
    jimlooney
    Participant

    so by passing the -r flag from perl and php to sendmail/postfix, it seems to take care of the From=localhost.localhost weirdness. However, I’d like to know if anyone knows how to keep postfix from defaulting to this localhost designation – because if I put up any open source apps (like phpBB or SugarSuite), I’d rather not have to search through their source code and update all of their uses of the mail() function.

    Any ideas?

    in reply to: cbl.abuseat.org listing #370465
    jimlooney
    Participant

    I would be eternally grateful if someone knows how to fix this. I am having the exact same problem. Mail being sent from php or perl is sending with the localhost.localhost described above. I am now listed on two blacklists because of this, however I can find no where to fix the problem.

    I have edited the postfix .cf file, setting mydomain, myhostname etc. to the correct values – but still no luck.

    Any help would be greatly appreciated

    Thanks in advance!

Viewing 15 posts - 1 through 15 (of 20 total)