DreamHost Discussion Board http://discussion.dreamhost.com/postlist.pl?Board=forum_programming Posts in the "forum_programming" forum at the DreamHost Discussion Board! Sun, 22 Nov 2009 17:00:06 -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#Post124147 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#Post124147 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).

]]>
Re: PHP mod for my website's Script http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124141&page=0&view=collapsed&sb=5&o=14&vc=1#Post124141 Thu, 19 Nov 2009 05:17:15 -0800 diafiro forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124141&page=0&view=collapsed&sb=5&o=14&vc=1#Post124141 Post Reply?

Never mind!!
Problem Solved!!
The new values showed up today.
I guess it just takes a little time for changes to 'propagate'.
Thanks a ton for the plugin!! :)

Tony.- ]]> Post Reply?

Never mind!!
Problem Solved!!
The new values showed up today.
I guess it just takes a little time for changes to 'propagate'.
Thanks a ton for the plugin!! :)

Tony.- ]]> Re: PHP mod for my website's Script http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124136&page=0&view=collapsed&sb=5&o=14&vc=1#Post124136 Wed, 18 Nov 2009 22:00:24 -0800 diafiro forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124136&page=0&view=collapsed&sb=5&o=14&vc=1#Post124136 Post Reply?

It's an awesome plugin!
I just installed and run it.


However, I go into the php.ini file and change the two little things I need BUT when I run the test info.php, the values listed do not seem to have changed... even when refreshing the page.
Is there a reason for this??

Tony.- ]]> Post Reply?

It's an awesome plugin!
I just installed and run it.


However, I go into the php.ini file and change the two little things I need BUT when I run the test info.php, the values listed do not seem to have changed... even when refreshing the page.
Is there a reason for this??

Tony.- ]]> Re: Error http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124132&page=0&view=collapsed&sb=5&o=14&vc=1#Post124132 Wed, 18 Nov 2009 14:26:23 -0800 Buzzman25 forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124132&page=0&view=collapsed&sb=5&o=14&vc=1#Post124132 Post Reply?

Absolutely no problem at all! Thanks for an awesome program! I totally love it! :D

]]> Post Reply?

Absolutely no problem at all! Thanks for an awesome program! I totally love it! :D

]]> 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#Post124130 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#Post124130 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?

]]> Re: php.ini and upload_max_filesize http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124100&page=0&view=collapsed&sb=5&o=14&vc=1#Post124100 Tue, 17 Nov 2009 20:07:13 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124100&page=0&view=collapsed&sb=5&o=14&vc=1#Post124100 Post Reply?

Notepad as ANSI is fine. Wordpad, Word, etc. will cause trouble.

Receiving the same error using pico indicates the problem lay elsewhere



Maximum Cash Discount on any plan with MAXCASH

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

Notepad as ANSI is fine. Wordpad, Word, etc. will cause trouble.

Receiving the same error using pico indicates the problem lay elsewhere



Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost ]]> Re: php.ini and upload_max_filesize http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124099&page=0&view=collapsed&sb=5&o=14&vc=1#Post124099 Tue, 17 Nov 2009 17:53:17 -0800 Halpert forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124099&page=0&view=collapsed&sb=5&o=14&vc=1#Post124099 Post Reply?

Thank you for such a quick reply!

I've ditched Notepad, deleted the old files, and re-written them in pico but am getting the same error. Does pico also create files with DOS endings? or will it take the server I'm on time to notice the new php.ini file I'm pointing to?

*EDIT* Nevermind - it is working now, my phpinfo() page indicates it is looking at the proper php.ini file. BUT, it's still not letting me upload anything over 7M. I've set it to 10M in the php.ini file, but it doesn't seem to be recognizing that value...

*EDIT2* GOT IT! Forced a recache and now it's operating as it should be. Thank you for turning me off Notepad!! =)

Edited by Halpert on 11/17/09 06:37 PM (server time).

]]>
Post Reply?

Thank you for such a quick reply!

I've ditched Notepad, deleted the old files, and re-written them in pico but am getting the same error. Does pico also create files with DOS endings? or will it take the server I'm on time to notice the new php.ini file I'm pointing to?

*EDIT* Nevermind - it is working now, my phpinfo() page indicates it is looking at the proper php.ini file. BUT, it's still not letting me upload anything over 7M. I've set it to 10M in the php.ini file, but it doesn't seem to be recognizing that value...

*EDIT2* GOT IT! Forced a recache and now it's operating as it should be. Thank you for turning me off Notepad!! =)

Edited by Halpert on 11/17/09 06:37 PM (server time).

]]>
Re: php.ini and upload_max_filesize http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124097&page=0&view=collapsed&sb=5&o=14&vc=1#Post124097 Tue, 17 Nov 2009 17:36:48 -0800 andrewf forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124097&page=0&view=collapsed&sb=5&o=14&vc=1#Post124097 Post Reply?

Don't use Notepad. It creates files with DOS line endings, which Linux doesn't appreciate.

]]> Post Reply?

Don't use Notepad. It creates files with DOS line endings, which Linux doesn't appreciate.

]]> 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#Post124096 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#Post124096 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.

]]> Re: PHP mod for my website's Script http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124040&page=0&view=collapsed&sb=5&o=14&vc=1#Post124040 Sun, 15 Nov 2009 08:39:44 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124040&page=0&view=collapsed&sb=5&o=14&vc=1#Post124040 Post Reply?

See link below (look for Custom PHP.INI in auto-installers).

After running, your editable php.ini can be found in the cgi-bin folder.



Maximum Cash Discount on any plan with MAXCASH

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

See link below (look for Custom PHP.INI in auto-installers).

After running, your editable php.ini can be found in the cgi-bin folder.



Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost ]]> 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#Post124038 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#Post124038 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.- ]]> Re: Using Perl CGI-Hooks on a Dreamhost server http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124010&page=0&view=collapsed&sb=5&o=14&vc=1#Post124010 Fri, 13 Nov 2009 18:28:45 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=124010&page=0&view=collapsed&sb=5&o=14&vc=1#Post124010 Post Reply?

I believe it's handled on a per domain basis.

What's the status of Extra Web Security in Domains > Manage Domains?



Maximum Cash Discount on any plan with MAXCASH

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

I believe it's handled on a per domain basis.

What's the status of Extra Web Security in Domains > Manage Domains?



Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost ]]> Re: Using Perl CGI-Hooks on a Dreamhost server http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123996&page=0&view=collapsed&sb=5&o=14&vc=1#Post123996 Fri, 13 Nov 2009 05:28:15 -0800 Jan forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123996&page=0&view=collapsed&sb=5&o=14&vc=1#Post123996 Post Reply?

Hi sXi,

thanks for your response.

I tried your code and it does not raise an error.
But also it doesn't change anything.

I guess there is no mod_security.c module installed but the security2_module.

The security2_module does not support .htaccess filter settings anymore.
I read that changes have to be done in the vhosts.conf using 'SecRuleEngine Off' however dreamhost won't let you edit the vhosts.conf will they?


]]> Post Reply?

Hi sXi,

thanks for your response.

I tried your code and it does not raise an error.
But also it doesn't change anything.

I guess there is no mod_security.c module installed but the security2_module.

The security2_module does not support .htaccess filter settings anymore.
I read that changes have to be done in the vhosts.conf using 'SecRuleEngine Off' however dreamhost won't let you edit the vhosts.conf will they?


]]> Re: Using Perl CGI-Hooks on a Dreamhost server http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123995&page=0&view=collapsed&sb=5&o=14&vc=1#Post123995 Fri, 13 Nov 2009 05:18:19 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123995&page=0&view=collapsed&sb=5&o=14&vc=1#Post123995 Post Reply?

<IfModule mod_security.c>
SecFilterScanPOST Off
</IfModule>

Error?



Maximum Cash Discount on any plan with MAXCASH

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

<IfModule mod_security.c>
SecFilterScanPOST Off
</IfModule>

Error?



Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost ]]> Re: Error http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123994&page=0&view=collapsed&sb=5&o=14&vc=1#Post123994 Fri, 13 Nov 2009 02:03:04 -0800 ottodv forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123994&page=0&view=collapsed&sb=5&o=14&vc=1#Post123994 Post Reply?

Oops! Fixed that one too.
This time I cleared the log and ran it on my own server as if it were new and there is still 1 error message that appears the first time you run it, but not after that (the error has no effect).
New version now uploaded - 0.2.6b

Sorry for the inconvenience and thanks for reporting it.

Otto - 7is7.com ]]> Post Reply?

Oops! Fixed that one too.
This time I cleared the log and ran it on my own server as if it were new and there is still 1 error message that appears the first time you run it, but not after that (the error has no effect).
New version now uploaded - 0.2.6b

Sorry for the inconvenience and thanks for reporting it.

Otto - 7is7.com ]]> Re: Error http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123993&page=0&view=collapsed&sb=5&o=14&vc=1#Post123993 Fri, 13 Nov 2009 01:05:35 -0800 Buzzman25 forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123993&page=0&view=collapsed&sb=5&o=14&vc=1#Post123993 Post Reply?

I seem to have found another error! Go me. :p

Illegal division by zero at /home/user/bin/psmanager.pl line 173.

which is:

my $trend = int($mem_ave1/$mem_ave2*100)/100;

EDIT:

Well I midified the line using your code example from before to:

my $trend = int(($mem_ave1==0)?1:$mem_ave1/$mem_ave2*100)/100;

After it ran once it created the log file and when I changed it back it didn't give me any errors. :)

Edited by Buzzman25 on 11/13/09 01:17 AM (server time).

]]>
Post Reply?

I seem to have found another error! Go me. :p

Illegal division by zero at /home/user/bin/psmanager.pl line 173.

which is:

my $trend = int($mem_ave1/$mem_ave2*100)/100;

EDIT:

Well I midified the line using your code example from before to:

my $trend = int(($mem_ave1==0)?1:$mem_ave1/$mem_ave2*100)/100;

After it ran once it created the log file and when I changed it back it didn't give me any errors. :)

Edited by Buzzman25 on 11/13/09 01:17 AM (server time).

]]>
Re: Using Perl CGI-Hooks on a Dreamhost server http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123992&page=0&view=collapsed&sb=5&o=14&vc=1#Post123992 Fri, 13 Nov 2009 01:02:13 -0800 Jan forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123992&page=0&view=collapsed&sb=5&o=14&vc=1#Post123992 Post Reply?

Thanks alot!

I tried to add a .htaccess file with:

SecFilterEngine Off
SecFilterScanPOST Off

However it does not work:

.htaccess: Invalid command 'SecFilterEngine', perhaps misspelled or defined by a module not included in the server configuration

.htaccess: Invalid command 'SecFilterScanPOST', perhaps misspelled or defined by a module not included in the server configuration

So I tried disabling security2_module by:
SecRuleEngine Off

It causes an error too:

.htaccess: SecRuleEngine not allowed here


Any other ideas?

Does that mean i have to turn off security2_module for all files?

Edited by Jan on 11/13/09 01:35 AM (server time).

]]>
Post Reply?

Thanks alot!

I tried to add a .htaccess file with:

SecFilterEngine Off
SecFilterScanPOST Off

However it does not work:

.htaccess: Invalid command 'SecFilterEngine', perhaps misspelled or defined by a module not included in the server configuration

.htaccess: Invalid command 'SecFilterScanPOST', perhaps misspelled or defined by a module not included in the server configuration

So I tried disabling security2_module by:
SecRuleEngine Off

It causes an error too:

.htaccess: SecRuleEngine not allowed here


Any other ideas?

Does that mean i have to turn off security2_module for all files?

Edited by Jan on 11/13/09 01:35 AM (server time).

]]>
Re: Error http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123991&page=0&view=collapsed&sb=5&o=14&vc=1#Post123991 Thu, 12 Nov 2009 23:24:15 -0800 ottodv forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123991&page=0&view=collapsed&sb=5&o=14&vc=1#Post123991 Post Reply?

Thanks for reporting this problem.
I have made a change to catch that error and one to prevent the situation from happening, as obviously a division by zero shouldn't be done. This problem was apparently introduced in the latest version and it could only occur for new users.
You can download the newest version (0.2.6.a) here:
http://www.7is7.com/software/dreamhost/psmanager.html

Otto - 7is7.com ]]> Post Reply?

Thanks for reporting this problem.
I have made a change to catch that error and one to prevent the situation from happening, as obviously a division by zero shouldn't be done. This problem was apparently introduced in the latest version and it could only occur for new users.
You can download the newest version (0.2.6.a) here:
http://www.7is7.com/software/dreamhost/psmanager.html

Otto - 7is7.com ]]> Error http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123971&page=0&view=collapsed&sb=5&o=14&vc=1#Post123971 Thu, 12 Nov 2009 14:55:32 -0800 Buzzman25 forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123971&page=0&view=collapsed&sb=5&o=14&vc=1#Post123971 Post Reply?

I too have done this but I do get an error. The error is:
Illegal division by zero at /home/user/bin/psmanager.pl line 239.

And line 239 is: my $trend = $ave1/$ave2;

Any suggestions? I'm using your program without the advanced option enabled using all defaults and allowing it to post to my Twitter.


]]> Post Reply?

I too have done this but I do get an error. The error is:
Illegal division by zero at /home/user/bin/psmanager.pl line 239.

And line 239 is: my $trend = $ave1/$ave2;

Any suggestions? I'm using your program without the advanced option enabled using all defaults and allowing it to post to my Twitter.


]]> Re: Using Perl CGI-Hooks on a Dreamhost server http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123967&page=0&view=collapsed&sb=5&o=14&vc=1#Post123967 Thu, 12 Nov 2009 09:47:20 -0800 andrewf forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123967&page=0&view=collapsed&sb=5&o=14&vc=1#Post123967 Post Reply?

Betcha it's mod_security scanning the uploaded data before it gets passed to the CGI script. Turn off mod_security for this domain (from Manage Domains) and see if that does the trick.

]]> Post Reply?

Betcha it's mod_security scanning the uploaded data before it gets passed to the CGI script. Turn off mod_security for this domain (from Manage Domains) and see if that does the trick.

]]> 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#Post123966 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#Post123966 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?

]]> Re: Dreamhost PS Manager http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123932&page=0&view=collapsed&sb=5&o=14&vc=1#Post123932 Wed, 11 Nov 2009 06:30:59 -0800 ottodv forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123932&page=0&view=collapsed&sb=5&o=14&vc=1#Post123932 Post Reply?

A reboot script for your Dreamhost VPS is now also available here:
http://www.7is7.com/software/dreamhost/psrebooter.html

Otto - 7is7.com ]]> Post Reply?

A reboot script for your Dreamhost VPS is now also available here:
http://www.7is7.com/software/dreamhost/psrebooter.html

Otto - 7is7.com ]]> Re: [shell] Killed http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123922&page=0&view=collapsed&sb=5&o=14&vc=1#Post123922 Wed, 11 Nov 2009 00:33:52 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123922&page=0&view=collapsed&sb=5&o=14&vc=1#Post123922 Post Reply?

Just took a swing at it and forcing traceable seemed to do the trick. It really had me bamboozled as the elfs worked on other DH servers but not the one I was compiling them on - which was ultimately a good thing otherwise I'd never have known about this potential point of failure that would have been all but impossible for me to determine had it occurred somewhere I didn't have access.

Many thanks for your exceptionally prompt attention and accurate advice regarding grsec!



Maximum Cash Discount on any plan with MAXCASH

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

Just took a swing at it and forcing traceable seemed to do the trick. It really had me bamboozled as the elfs worked on other DH servers but not the one I was compiling them on - which was ultimately a good thing otherwise I'd never have known about this potential point of failure that would have been all but impossible for me to determine had it occurred somewhere I didn't have access.

Many thanks for your exceptionally prompt attention and accurate advice regarding grsec!



Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost ]]> Re: PHP BBCode http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123909&page=0&view=collapsed&sb=5&o=14&vc=1#Post123909 Tue, 10 Nov 2009 14:24:26 -0800 chaseler forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123909&page=0&view=collapsed&sb=5&o=14&vc=1#Post123909 Post Reply?

It works!!!

Thanks sooooo much!!! I really appreciate it!


Regards,
Chris Haseler ]]> Post Reply?

It works!!!

Thanks sooooo much!!! I really appreciate it!


Regards,
Chris Haseler ]]> Re: [shell] Killed http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123906&page=0&view=collapsed&sb=5&o=14&vc=1#Post123906 Tue, 10 Nov 2009 10:00:12 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123906&page=0&view=collapsed&sb=5&o=14&vc=1#Post123906 Post Reply?

Will do sir, thank you.



Maximum Cash Discount on any plan with MAXCASH

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

Will do sir, thank you.



Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost ]]> Re: [shell] Killed http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123905&page=0&view=collapsed&sb=5&o=14&vc=1#Post123905 Tue, 10 Nov 2009 09:55:35 -0800 andrewf forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123905&page=0&view=collapsed&sb=5&o=14&vc=1#Post123905 Post Reply?

Is that all it says? Weird, send me a PM (or open a support ticket) and we'll take a look at it.

]]> Post Reply?

Is that all it says? Weird, send me a PM (or open a support ticket) and we'll take a look at it.

]]> [shell] Killed http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123900&page=0&view=collapsed&sb=5&o=14&vc=1#Post123900 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#Post123900 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 ]]> Re: [Question] Script to calculate prices. http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123878&page=0&view=collapsed&sb=5&o=14&vc=1#Post123878 Mon, 09 Nov 2009 23:05:23 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123878&page=0&view=collapsed&sb=5&o=14&vc=1#Post123878 Post Reply?

osCommerce (and similar). You might read up on ZenCart as it's available as a One-Click on DreamHost and probably has the functions necessary to do what you want.

I like your site btw - very clean, neat, and easy to navigate.



Maximum Cash Discount on any plan with MAXCASH

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

osCommerce (and similar). You might read up on ZenCart as it's available as a One-Click on DreamHost and probably has the functions necessary to do what you want.

I like your site btw - very clean, neat, and easy to navigate.



Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost ]]> Re: PHP BBCode http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123877&page=0&view=collapsed&sb=5&o=14&vc=1#Post123877 Mon, 09 Nov 2009 22:58:13 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123877&page=0&view=collapsed&sb=5&o=14&vc=1#Post123877 Post Reply?

In reply to:

Should I try to modify that script for BBCode?


Yep, that would probably work. If you use other scripts as a *guideline* for what you're trying to do then you won't have any trouble at all on DreamHost. I was inquisitive of which script you had chosen in order to try visualise your current paths in my head.


Change the DOMAIN variable below:

#!/bin/sh

DOMAIN="yourdomain.com"

loc="$HOME/php5"
export PATH=$loc/bin:$PATH
export LD_LIBRARY_PATH=$loc/lib:/usr/local/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$loc/lib:/usr/local/lib:$LIBRARY_PATH
export CPATH=$loc/include:/usr/local/include:$CPATH
export tmpdir=$HOME/tmp
repos=http://source.sabrexhost.com/files/
current=/etc/php5/haselerstudios.com
autoconf="autoconf-2.64"
automake="automake-1.9.6"
bbcode="bbcode-1.0.2"
m4="m4-1.4.13"
extdir=$loc/extensions
libdir=$loc/lib
srcdir=$loc/src
mkdir -p $tmpdir
mkdir -p $loc/{bin,etc,extensions,include,lib,src}
cd $srcdir
wget -q $repos$m4.tar.gz
tar -xzf $m4.tar.gz
cd $m4
./configure --prefix=$loc
nice -n 19 make
make install
cd $srcdir
wget -q $repos$autoconf.tar.gz
tar -xzf $autoconf.tar.gz
cd $autoconf
./configure --prefix=$loc
nice -n 19 make
make install
cd $srcdir
wget -q $repos$automake.tar.gz
tar -xzf $automake.tar.gz
cd $automake
./configure --prefix=$loc
nice -n 19 make
cd $srcdir
wget $repos$bbcode.tgz
tar -xzf $bbcode.tgz
cd $bbcode
phpize
./configure --enable-bbcode
make install
cp $libdir/php/extensions/no-debug-non-zts-20060613/bbcode.so $extdir
perl -p -i -e 's/.*extension_dir.*/\; extension_dir =/' "$loc$current/php.ini"
mv -f $loc$current/php.ini $loc$current/php.tmp
echo "" > $loc$current/php.ini
echo "[extensions]" >> $loc$current/php.ini
echo "extension_dir=\"$extdir/\"" >> $loc$current/php.ini
echo "extension=bbcode.so" >> $loc$current/php.ini
echo "" >> $loc$current/php.ini
cat $loc$current/php.tmp >> $loc$current/php.ini
rm -f $loc$current/php.tmp
rm -rf $srcdir
echo "All done."
exit 0


Note that this creates (and sets) an extensions directory: /home/cjhaseler/php5/extensions

...if it works!



Maximum Cash Discount on any plan with MAXCASH

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

In reply to:

Should I try to modify that script for BBCode?


Yep, that would probably work. If you use other scripts as a *guideline* for what you're trying to do then you won't have any trouble at all on DreamHost. I was inquisitive of which script you had chosen in order to try visualise your current paths in my head.


Change the DOMAIN variable below:

#!/bin/sh

DOMAIN="yourdomain.com"

loc="$HOME/php5"
export PATH=$loc/bin:$PATH
export LD_LIBRARY_PATH=$loc/lib:/usr/local/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$loc/lib:/usr/local/lib:$LIBRARY_PATH
export CPATH=$loc/include:/usr/local/include:$CPATH
export tmpdir=$HOME/tmp
repos=http://source.sabrexhost.com/files/
current=/etc/php5/haselerstudios.com
autoconf="autoconf-2.64"
automake="automake-1.9.6"
bbcode="bbcode-1.0.2"
m4="m4-1.4.13"
extdir=$loc/extensions
libdir=$loc/lib
srcdir=$loc/src
mkdir -p $tmpdir
mkdir -p $loc/{bin,etc,extensions,include,lib,src}
cd $srcdir
wget -q $repos$m4.tar.gz
tar -xzf $m4.tar.gz
cd $m4
./configure --prefix=$loc
nice -n 19 make
make install
cd $srcdir
wget -q $repos$autoconf.tar.gz
tar -xzf $autoconf.tar.gz
cd $autoconf
./configure --prefix=$loc
nice -n 19 make
make install
cd $srcdir
wget -q $repos$automake.tar.gz
tar -xzf $automake.tar.gz
cd $automake
./configure --prefix=$loc
nice -n 19 make
cd $srcdir
wget $repos$bbcode.tgz
tar -xzf $bbcode.tgz
cd $bbcode
phpize
./configure --enable-bbcode
make install
cp $libdir/php/extensions/no-debug-non-zts-20060613/bbcode.so $extdir
perl -p -i -e 's/.*extension_dir.*/\; extension_dir =/' "$loc$current/php.ini"
mv -f $loc$current/php.ini $loc$current/php.tmp
echo "" > $loc$current/php.ini
echo "[extensions]" >> $loc$current/php.ini
echo "extension_dir=\"$extdir/\"" >> $loc$current/php.ini
echo "extension=bbcode.so" >> $loc$current/php.ini
echo "" >> $loc$current/php.ini
cat $loc$current/php.tmp >> $loc$current/php.ini
rm -f $loc$current/php.tmp
rm -rf $srcdir
echo "All done."
exit 0


Note that this creates (and sets) an extensions directory: /home/cjhaseler/php5/extensions

...if it works!



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#Post123868 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#Post123868 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! ]]> Re: PHP BBCode http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123845&page=0&view=collapsed&sb=5&o=14&vc=1#Post123845 Mon, 09 Nov 2009 08:58:24 -0800 chaseler forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123845&page=0&view=collapsed&sb=5&o=14&vc=1#Post123845 Post Reply?

To install PHP 5 I used the "Main PHP5 Install Script" with the first method described at http://wiki.dreamhost.com/Installing_PHP5. It has correctly loaded my custom PHP because in the phpinfo() it says: "Loaded Configuration File: /home/cjhaseler/php5/etc/php5/haselerstudios.com/php.ini"

I couldn't find a Wiki script to install the BBCode extension, though there were scripts for other PECL extensions, such as Zip (http://wiki.dreamhost.com/PECL_Zip). Should I try to modify that script for BBCode?

Thanks Again!


Regards,
Chris Haseler ]]> Post Reply?

To install PHP 5 I used the "Main PHP5 Install Script" with the first method described at http://wiki.dreamhost.com/Installing_PHP5. It has correctly loaded my custom PHP because in the phpinfo() it says: "Loaded Configuration File: /home/cjhaseler/php5/etc/php5/haselerstudios.com/php.ini"

I couldn't find a Wiki script to install the BBCode extension, though there were scripts for other PECL extensions, such as Zip (http://wiki.dreamhost.com/PECL_Zip). Should I try to modify that script for BBCode?

Thanks Again!


Regards,
Chris Haseler ]]> Re: PHP BBCode http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123844&page=0&view=collapsed&sb=5&o=14&vc=1#Post123844 Mon, 09 Nov 2009 08:33:52 -0800 sXi forum_programming http://discussion.dreamhost.com/showflat.pl?Board=forum_programming&Number=123844&page=0&view=collapsed&sb=5&o=14&vc=1#Post123844 Post Reply?

Sorry for the tardy reply - been having some awesome network issues here.

Did you follow a Wiki script? If so, which one?



Maximum Cash Discount on any plan with MAXCASH

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

Sorry for the tardy reply - been having some awesome network issues here.

Did you follow a Wiki script? If so, which one?



Maximum Cash Discount on any plan with MAXCASH

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