KBD

Keith Devens .com

Monday, September 8, 2008 Flag waving
Linux is only free if your time has no value – Jamie Zawinski
← Why I think weblog spam isn't a long term problemI am a leftover master! →

Daily link icon Friday, November 21, 2003

I'm running PHP as a CGI?

Well that sucks, I just found out this site's been running PHP as normal CGI, so the PHP interpreter is started for every single request on my site. So, that means my site's been much slower than it has to be. On the bright side, it seems that CGI isn't actually all that slow.

Update: Turns out I was running as a module, which is what I thought I was. Good to know.

← Why I think weblog spam isn't a long term problemI am a leftover master! →

Comments XML gif

Adam Langley (http://www.imperialviolet.org) wrote:

Many multi-user sites run PHP as a CGI because of security reasons. modphp, of course, runs as the same user as the webserver (www). That means that PHP scripts can walk around the webserver and read passwords out of other people's scripts and the like.

PHP/CGI and Apache SuEXEC is pretty much the only way to secure it. In fact, I've reworked SuEXEC quite a lot to run every different directory as a different user and group (like homedirs) and to set resource limits on a per-user basis.

That, and a firewall that stops PHP scripts from using the network stack keeps it at least sane. (Last time we had a user-level breakin our webserver became the central warez hub in Europe over the weekend due to our TBs of storage and 1.1Gps link).

AGL

∴ Adam Langley | 22-Nov-2003 6:41am est | http://www.imperialviolet.org | #3325

Keith (http://keithdevens.com/) wrote:

I've been vaguely aware of the huge security issue that running mod_php on a shared host is, but I've intentionally ignored it Smiley It's unusual for me, because usually I face things I don't want to think about. Oh well. I'm eventually going to move to mod_python and another host, and that host will probably run me in my own sandbox (virtual server, or my own instance of Apache), so that should be good enough.

That's pretty intense about the warez thing. Those people have an impressive operation.

Keith | 22-Nov-2003 1:42pm est | http://keithdevens.com/ | #3326

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

September 2008
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
282930 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 7 posts

Recent comments XML

new⇒Girls, please don't get breast implants

I got implants this year and it was​the biggest mistake I ever made.  I​am ...

75.156.208.88: Sep 7, 8:03pm

Trogdor tattoo!!

Oh, so cute, wowoowow....

Kathy Mead: Sep 7, 6:07am

I hate Norton Antivirus

Long long live AVG I love you!...

kevin sands: Sep 6, 7:31pm

I hate ASP.NET

CF, why pick that piece of trash?​Cold Confusion. Is it finally​really a OO...

ColdConfusion: Sep 5, 8:36pm

Maps of Iraq

This is for Linda, I will be​visiting that site some time in the​near futur...

Bob: Sep 5, 1:20pm

Spider solitaire

I don't think the question was​necessarily if there are unbeatable​games.  ...

Jared: Sep 4, 12:44pm

Convert Pantone Colors to RGB and Hex - Color Conversion Chart

The colors on those website don't​seem to relate to the pantone data​we hav...

blah: Sep 3, 10:12am

Generated in about 0.195s.

(Used 8 db queries)

mobile phone