DreamHost Discussion Board http://discussion.dreamhost.com/postlist.pl?Board=forum_programming Threads in the "forum_programming" forum at the DreamHost Discussion Board! Sun, 22 Nov 2009 16:50:05 -0800 http://discussion.dreamhost.com/ en Password Protecting Wordpress Uploads http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124147&page=0&view=collapsed&sb=5&o=14&vc=1 Thu, 19 Nov 2009 14:22:49 -0800 Proto forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124147&page=0&view=collapsed&sb=5&o=14&vc=1 Post Reply?

Hi,

I need to password protect a range of files that will be managed by the Wordpress uploader. I don't know exactly where the file will be within the uploads folder, and I don't know in advance the exact filename.

I think .htaccess <FilesMatch> will suit my needs, though I'm open to alternative suggestions. My main consideration is that the end user not have to do anything technical or difficult to protect the uploaded file.

I've tried the following:

____ code _____

<FilesMatch "private\.*$">
AuthName "Private File"
AuthType Basic
AuthUserFile /mydomain.com/.htpasswd
require valid-user
</FilesMatch>

____ end code _____

You can see I'm attempting to password protect any file that has the word private in the name. This isn't working though, and the file "http://www.mydomain.com/wp/wp-content/uploads/2009/11/private_mydoc.docx" is still able to be downloaded without a password.

Any suggestions on how I can better manage this?

Edited by proto on 11/19/09 02:33 PM (server time).

]]>
Post Reply?

Hi,

I need to password protect a range of files that will be managed by the Wordpress uploader. I don't know exactly where the file will be within the uploads folder, and I don't know in advance the exact filename.

I think .htaccess <FilesMatch> will suit my needs, though I'm open to alternative suggestions. My main consideration is that the end user not have to do anything technical or difficult to protect the uploaded file.

I've tried the following:

____ code _____

<FilesMatch "private\.*$">
AuthName "Private File"
AuthType Basic
AuthUserFile /mydomain.com/.htpasswd
require valid-user
</FilesMatch>

____ end code _____

You can see I'm attempting to password protect any file that has the word private in the name. This isn't working though, and the file "http://www.mydomain.com/wp/wp-content/uploads/2009/11/private_mydoc.docx" is still able to be downloaded without a password.

Any suggestions on how I can better manage this?

Edited by proto on 11/19/09 02:33 PM (server time).

]]>
PHP and imap_search http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124130&page=0&view=collapsed&sb=5&o=14&vc=1 Wed, 18 Nov 2009 12:52:15 -0800 jared314 forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124130&page=0&view=collapsed&sb=5&o=14&vc=1 Post Reply?

I am writing a php script to check my DH imap server in a DH cronjob and am getting a seg fault every time I use the imap_search function. The script works locally and follows the examples I have seen.

imap_search($mbox, 'SINCE "17 Nov 2008"');

Has anyone else seen this behavior?

]]> Post Reply?

I am writing a php script to check my DH imap server in a DH cronjob and am getting a seg fault every time I use the imap_search function. The script works locally and follows the examples I have seen.

imap_search($mbox, 'SINCE "17 Nov 2008"');

Has anyone else seen this behavior?

]]> php.ini and upload_max_filesize http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124096&page=0&view=collapsed&sb=5&o=14&vc=1 Tue, 17 Nov 2009 17:30:00 -0800 Halpert forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124096&page=0&view=collapsed&sb=5&o=14&vc=1 Post Reply?

So far I've read and followed the instructions at: http://wiki.dreamhost.com/PHP.ini, but these continue to return a 500.

I'm using Notepad to create the .htaccess and php-wrapper.fcgi files and when I save them I'm selecting "All files" under 'Save as type:' and I'm using ANSI encoding. Is this the right encoding? Should I be using UTF-8? Please help!

I can provide screenshots or even capture of what I'm doing if that helps. All I'm trying to do is increase the upload_max_filesize from 7M to 50M. Any help, links, or suggestions are greatly appreciated.

]]> Post Reply?

So far I've read and followed the instructions at: http://wiki.dreamhost.com/PHP.ini, but these continue to return a 500.

I'm using Notepad to create the .htaccess and php-wrapper.fcgi files and when I save them I'm selecting "All files" under 'Save as type:' and I'm using ANSI encoding. Is this the right encoding? Should I be using UTF-8? Please help!

I can provide screenshots or even capture of what I'm doing if that helps. All I'm trying to do is increase the upload_max_filesize from 7M to 50M. Any help, links, or suggestions are greatly appreciated.

]]> PHP mod for my website's Script http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124038&page=0&view=collapsed&sb=5&o=14&vc=1 Sun, 15 Nov 2009 06:32:38 -0800 diafiro forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124038&page=0&view=collapsed&sb=5&o=14&vc=1 Post Reply?

Hello, everyone.

I have *no* experience or knowledge about this area of PHP at all. I can handle a tiny little bit of it on the 'design', html-ish side, but I have no idea how to do this one.

For a website script that I bought, I need several server configuration things.
I contacted DH, and they told me that everything seems alright, except for two settings.
The Script requires:

-session.gc_maxlifetime = 15000 (Recommended or higher)

{{but I have 1440}}

-magic_quotes_gpc = on

{{but mine is off}}


I don't have the slightest idea how to change these variables, or even if it's really worth changing (well, the script totally requires it, because I contacted their customer support, and they told me that it is, indeed, necessary).
I'm talking about this script: http://www.fmyscript.com/requirements.html

Here's their demo: http://demo.fmyscript.com/


Would someone please tell me how I could change these two things just for one of my domains??
Your help will be much appreciated!

Tony.- ]]> Post Reply?

Hello, everyone.

I have *no* experience or knowledge about this area of PHP at all. I can handle a tiny little bit of it on the 'design', html-ish side, but I have no idea how to do this one.

For a website script that I bought, I need several server configuration things.
I contacted DH, and they told me that everything seems alright, except for two settings.
The Script requires:

-session.gc_maxlifetime = 15000 (Recommended or higher)

{{but I have 1440}}

-magic_quotes_gpc = on

{{but mine is off}}


I don't have the slightest idea how to change these variables, or even if it's really worth changing (well, the script totally requires it, because I contacted their customer support, and they told me that it is, indeed, necessary).
I'm talking about this script: http://www.fmyscript.com/requirements.html

Here's their demo: http://demo.fmyscript.com/


Would someone please tell me how I could change these two things just for one of my domains??
Your help will be much appreciated!

Tony.- ]]> Using Perl CGI-Hooks on a Dreamhost server http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123966&page=0&view=collapsed&sb=5&o=14&vc=1 Thu, 12 Nov 2009 07:23:40 -0800 Jan forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123966&page=0&view=collapsed&sb=5&o=14&vc=1 Post Reply?

Hi all,

I was curious wether there is a way to get the following script working.
It works for every server tested but not for Dreamhost.
Is it possible to get it working or was choosing Dreamhost just wrong?


#!/usr/bin/perl
use strict;
use warnings;
use File::Slurp;
use CGI;

run();

sub run {
my $logfile = 'test.txt';

my $cgi = CGI->new(\&hook, $logfile);

print $cgi->header('text/html'),
$cgi->start_html,
$cgi->p( 'Upload done' ),
$cgi->end_html;
return;
}

sub hook {
my ($filename, $buffer, $bytes_read, $logfile) = @_;
append_file $logfile, \ sprintf("%d: %d\n", time, $bytes_read);
}




The problem is that the CGI->Hook is called after the upload and not like with all other servers during the upload.

I already tried using a newer CGI version (3.48) however that did not fix the Dreamhost bug.

Does anyone know which server settings have to be changed?

]]> Post Reply?

Hi all,

I was curious wether there is a way to get the following script working.
It works for every server tested but not for Dreamhost.
Is it possible to get it working or was choosing Dreamhost just wrong?


#!/usr/bin/perl
use strict;
use warnings;
use File::Slurp;
use CGI;

run();

sub run {
my $logfile = 'test.txt';

my $cgi = CGI->new(\&hook, $logfile);

print $cgi->header('text/html'),
$cgi->start_html,
$cgi->p( 'Upload done' ),
$cgi->end_html;
return;
}

sub hook {
my ($filename, $buffer, $bytes_read, $logfile) = @_;
append_file $logfile, \ sprintf("%d: %d\n", time, $bytes_read);
}




The problem is that the CGI->Hook is called after the upload and not like with all other servers during the upload.

I already tried using a newer CGI version (3.48) however that did not fix the Dreamhost bug.

Does anyone know which server settings have to be changed?

]]> [shell] Killed http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123900&page=0&view=collapsed&sb=5&o=14&vc=1 Tue, 10 Nov 2009 06:44:43 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123900&page=0&view=collapsed&sb=5&o=14&vc=1 Post Reply?

I've used compiled scripts (ELF) in shell on DreamHost without any trouble in the past, but when trying to run one today I received the following message:

./install: Operation not permitted
Killed

Only thing of note:

2.6.31.5-aufs2-grsec-1.0-i686-opt #4 SMP Wed Oct 28 10:16:48 PDT 2009

bbq?



Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost ]]> Post Reply?

I've used compiled scripts (ELF) in shell on DreamHost without any trouble in the past, but when trying to run one today I received the following message:

./install: Operation not permitted
Killed

Only thing of note:

2.6.31.5-aufs2-grsec-1.0-i686-opt #4 SMP Wed Oct 28 10:16:48 PDT 2009

bbq?



Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost ]]> [Question] Script to calculate prices. http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123868&page=0&view=collapsed&sb=5&o=14&vc=1 Mon, 09 Nov 2009 16:22:24 -0800 CajuCLC forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123868&page=0&view=collapsed&sb=5&o=14&vc=1 Post Reply?

I need some script that has to do this.
1st you select a motherboard on drop-down.
2nd, it will show only CPU that run on that motherboard.
And then RAM, Monitor, etc etc.
But they have cost prices.
If I select resell, it will add 20%.
If cash, 30%.
If Credit Card, 50%.

And it gives me the price.
Anyone knows something like that, can be a simple script.
Thanks;

VISIT MY WEBSITE! ]]> Post Reply?

I need some script that has to do this.
1st you select a motherboard on drop-down.
2nd, it will show only CPU that run on that motherboard.
And then RAM, Monitor, etc etc.
But they have cost prices.
If I select resell, it will add 20%.
If cash, 30%.
If Credit Card, 50%.

And it gives me the price.
Anyone knows something like that, can be a simple script.
Thanks;

VISIT MY WEBSITE! ]]>