Slashdot Mirror


Apache 1.3.x vs. 2.0.x: The Debate Returns

darthcamaro writes "internetnews.com is running a story about the new Apache 2.0.49 release. They actually got a hold of a pair of Apache Software Foundation members and got them to speak out about the 1.3.x vs. 2.0.49 debate! Also Apache Director Sander Striker told internetnews.com that he expects the Apache 1.3.30 release cycle to begin this week... I still use 1.3.x because I've been using the Apache 1.x series 'forever' and I've never found a solid reason to change. Also, as pointed out in this article, the official PHP documentation clearly states, 'Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows.'"

41 of 95 comments (clear)

  1. PHP link is for Canada Mirror by a.koepke · · Score: 4, Informative

    The PHP manual link posted is a direct link to one of the Canada mirror servers. The PHP site is mirrored around the world and it automatically selects your nearest mirror server.

    Use http://www.php.net/manual/en/install.apache2.php instead so that it can select the nearest mirror server and save us slashdotting this one Canadian server :D

    --


    (\(\
    (^.^)
    (")")
    *This is the cute bunny virus, please copy this into your sig so it can spread
    1. Re:PHP link is for Canada Mirror by great_snoopy · · Score: 2, Interesting

      I run apache 2.x with mod_php in production (apache,php and oracle database backend) for some time, and I can't see any problem by now.

  2. Arrrghhh!!! My eyes! by Anonymous Coward · · Score: 5, Funny

    Purple and mustard yellow? What the hell were you people thinking?!

    1. Re:Arrrghhh!!! My eyes! by name773 · · Score: 2, Insightful

      What the [heck] were you people thinking?!
      we were thinking it would be cheaper if we did the color schemes ourselves instead of hiring a design consultant.

    2. Re:Arrrghhh!!! My eyes! by Quobobo · · Score: 2, Funny

      No way, the Slashdot Games section looks practically beautiful compared to the Apache section. Never thought I'd use "Slashdot Games" and beautiful in the same sentence though...

  3. I've been running PHP/Apache 2 for a while... by leviramsey · · Score: 4, Interesting

    ...and haven't noticed any problems. Why is this advised against?

    1. Re:I've been running PHP/Apache 2 for a while... by Dr.Dubious+DDQ · · Score: 4, Interesting

      It seems to be not the 'core' of PHP, but several of the modules that go with it aren't thread-safe.

      Apparently, this really only shows up in the real world under heavy usage, and using the prefork "multi-processing module" should reduce or eliminate the potential problems. I think.

      It SOUNDS like the warnings about not using PHP with Apache2 is mainly overcautiousness - every time one of these stories comes up, a few people pop up and say it's working fine for them, and I don't remember seeing anyone pop up and say "yeah, every time I get more than (x) connections at a time everything fails" or anything of the sort.

      I'm planning to try it out myself sometime soon...

    2. Re:I've been running PHP/Apache 2 for a while... by T-Ranger · · Score: 3, Informative
      There are regular reports on the Horde/IMP lists that PHPs gettext component is broken. As the other poster says, this is some how thread related; PHP not being thread safe. There is at least one report of languages that change within a single page... But it seems that this only happens under heavy load.

      It would be interesting to know if PHP 5 will be thread safe, and this usable in production with Apache 2.x

    3. Re:I've been running PHP/Apache 2 for a while... by Inominate · · Score: 2, Informative

      PHP will probably NEVER be thread safe.

      Even if PHP were 100% threadsafe, it generally uses too many libraries for it to be practical to make sure they're ALL threadsafe.

    4. Re:I've been running PHP/Apache 2 for a while... by sumbry · · Score: 5, Informative

      Even if PHP were 100% threadsafe, it generally uses too many libraries for it to be practical to make sure they're ALL threadsafe.

      Actually the PHP core is 100 percent threadsafe now, it is only specifically the external libraries which aren't.

      If you use PHP w/FastCGI support you wont run into these issues. If you only compile MySQL or Postgres support into your PHP you wouldn't either. But many users frequently also compile in other external libs for things like graphics generation, url manipulation, etc and its these libraries which aren't thread safe and specifically can cause problems in high use environments.

      While you could specifically use PHP and Apache2 in total prefork mode, this basically makes it run exactly like the 1.3 series, so then the real question is what's the point of upgrading at all and not just sticking w/1.3?

    5. Re:I've been running PHP/Apache 2 for a while... by JoScherl · · Score: 3, Interesting

      I known quite some cases where PHP/Apache2 won't really work together since Apache2 begins to segfault, but I was never able to reproduce it mysqlf, all I have are segfaults in the logfiles - and I can't run the whole Apache on my production system within gdb to see where the problem is. I've you ask the PHP guys for help for such a problem, they aren't very cooperative and tell that Apache 2 is not supported...

    6. Re:I've been running PHP/Apache 2 for a while... by mivok · · Score: 2, Informative
      While you could specifically use PHP and Apache2 in total prefork mode, this basically makes it run exactly like the 1.3 series, so then the real question is what's the point of upgrading at all and not just sticking w/1.3?


      Because some servers like the subversion apache module require apache2, and I'd like to not have to run both apache1.3 and 2 in parallel. I am curious as to why the php documentation doesn't mention that using the prefork mpm and php would work fine however.
    7. Re:I've been running PHP/Apache 2 for a while... by gabe · · Score: 3, Informative

      Since PHP 4's inclusion of the Zend Thread-Safe engine, PHP itself has been thread-safe. It is the third-party libraries that extensions link to that are non necessarily thread-safe.

      There's a list of libraries and whether or not they are known to be thread-safe here: http://httpd.apache.org/docs-2.0/developer/thread_ safety.html#liblist

      --
      Gabriel Ricard
    8. Re:I've been running PHP/Apache 2 for a while... by xneilj · · Score: 3, Informative
      The subject of Apache 2/PHP was raised in the Slashdot discussion of the PHP5 beta RC a few days back. One comment from a PHP dev (Rasmus) was:

      Apache2 has a number of different modes it can work in. These modes are called MPM's. The default MPM is called Worker which is a multithreaded model. PHP, mod_perl, mod_python, and any other similar technology which links directly into the httpd processes will need to be perfectly threadsafe and reentrant to work effectively with a threaded Apache2 mpm. This is doable for the core of PHP, but there are literally hundreds of 3rd party libraries that can be linked into PHP and nobody whether or not these libraries are threadsafe. And figuring out if a specific library is threadsafe or not is non-trivial and it can very from one platform to another. And just to make it even harder, this stuff will appear to work fine until you put it under load or hit very specific race conditions which makes it nearly impossible to debug.

      So, since we can't tell you for sure that a threaded Apache2 mpm + PHP will work we do not suggest you use it for a production server. And since we can't know for sure, none of the main PHP developers use this combination for our own servers which compounds the problem because it is not receiving anywhere near the amount of realworld testing required to work out all the little issues above and beyond this threading unknown.

      There is an Apache2 mpm, called "prefork", which isn't threaded and basically makes Apache2 look like Apache1. But hey, we have a very good server already that looks like Apache1.

      In the end I don't see Apache2+PHP ever becoming a production platform with the current architecture. The only way I see it ever working is to pull PHP out of Apache and use a fastcgi approach. Or, with time, perhaps we will learn how to make sure a library is perfectly threadsafe and safe to use in a multithreaded Apache2.

      For now, I really see no reason not to simply use Apache1 if you want a robust, fast and stable web server.

      One of the posters found this more recent comment from Rasmus as well:

      We are not talking about just Apache2 here. We are talking about Apache2+an MPM+PHP+3rd Party Libs. The folks at apache.org are only concerned with Apache2 itself, and for serving up static files it is better than Apache1 in many respects. However we have to worry about a lot more stuff here. In fact, we couldn't care less about serving up static files. The main issues as I see them are:

      1. Thread safety issues. - It is very difficult to track down threading problems and we don't have decent tools to help us. The thread safety of many 3rd party libraries are unknown quantities and can depend on the OS, libc and even compile flags. - Many distributions seem to ship with the Worker MPM as the default and that is the MPM that gets the most attention. This is a hybrid multi-process, multi-threaded MPM.

      2. You can eliminate the threading problem by running the prefork MPM which effectively makes Apache2 behave just like Apache1 in the way it forks processes and serves one request at a time per process. Issues here: - Apache2 itself is rather fringe still. It has approximately a 5% marketshare vs. 65% for Apache1 at the time of this and out of that I would guess the majority are running the Worker MPM. So we are talking about a fringe MPM in a fringe server. This means it has not had anywhere near the attention from people running large production web server farms that it needs for me to comfortably say that this is a solid piece of code with all the kinks worked out. - The benefits of moving to Apache2+prefork are questionable. The new filter API would be one of the benefits, but it sti

      --
      rm -rf / is the evil of all root
    9. Re:I've been running PHP/Apache 2 for a while... by Knowbuddy · · Score: 4, Informative

      Just to be the voice of dissention ... I'm apparently the one person in the world for whom the PHP+Apache2 combo doesn't actually work right. Yes, it mostly works, but I'm constantly having to close out the windows that pop up when a thread goes boom. Yes, I am running it on XP (with all of the necessary service packs and hotfixes), but that shouldn't invalidate the fact that PHP+Apache2 isn't production-quality stable. And yes, I am 100% sure it is PHP causing the problem, as the errors only started when I started using PHP, and they increase as I convert more and more of my site to PHP.

      Now, if I'm getting all these errors, why am I using it? Because it's still better than the alternative. When any DLL goes pop under IIS you get really flaky and esoteric things that start happening. Under Apache2 it just nukes a thread, which Apache2 diligently respawns and goes on with life. I can deal with clicking OK on a dozen windows a day if it means I don't ever have to worry about restarting my web service.

      PHP+Apache2 isn't perfect, but it's good enough for what I need.

    10. Re:I've been running PHP/Apache 2 for a while... by Christopher_G_Lewis · · Score: 2, Funny

      mysqlf?
      Too funny!

    11. Re:I've been running PHP/Apache 2 for a while... by Christopher_G_Lewis · · Score: 2, Funny

      Still, I think you've coined a new phrase, or at least a fork :-)

  4. Re:1.3.29 by trompete · · Score: 2, Interesting

    The one thing that is pushing me to upgrade is Subversion. According to Subversion's website, you need a 2.X binary to run the Apache plugin. This may be the first really big push for 2.X.

  5. I run apache 2 and PHP in production by Anonymous Coward · · Score: 4, Interesting

    I did this after figuring out that no one really knew why you shouldn't. I haven't had any problems. Occasionally someone cites that quote on the comp.lang.php newsgroup, but they never have any reasons to back it up. This is 3 machines, 5 websites between them, that see daily use of an extensive custom written CRM app that is all in PHP. MySQL is the database.

    1. Re:I run apache 2 and PHP in production by jmt9581 · · Score: 2, Informative

      From what I understand, It's all about the performance. Apache 1.3.x supposedly has better performance with PHP when compared to the corresponding Apache 2.0.x release.

      --

      My blog

    2. Re:I run apache 2 and PHP in production by justMichael · · Score: 3, Insightful

      And how many releases of each have we gone through since June 2002?

      PHP was at 4.1.2, it is currently at 4.3.4

      Apache was at 2.0.39, it is currently at 2.0.49

      I have a feeling there have been some significant changes over the past (almost) 2 years.

      If I had a spare box around here I would do some testing. I have been using Apache2 and PHP4 exclusively for over a year and have seen no problems.

  6. Reference a little stale by ttfkam · · Score: 2, Informative

    It's almost two years old.

    Taken with a grain of salt of course, but I heard that the issue was about 2.0's use of threading whereas 1.3 was always a prefork model. mod_php made certain assumptions in their implementation for the Apache 1.3 version that didn't turn out to be threadsafe -- an obvious problem for Apache 2.0. But then I would tend to say it was a PHP problem rather than an Apache2 problem.

    It doesn't surprise me that 1.3 would be the performance winner at first. 2.0 was concentrating efforts on the worker (multi-process/multi-thread) model. Then again, it's been two years since that performance reference was written. Is the performance gap still that wide?

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
  7. i've been using both by dcocos · · Score: 3, Informative

    I've been using both 1.3.x and 2.x with Tomcat and I have yet to really notice a difference except that the config files for 2.x seem to be laid out in a more sane order though it took a while to adjust. (I can't speak to PHP usage as the only time I touch it is for running squirrelmail)

    1. Re:i've been using both by dcocos · · Score: 2, Informative

      On the Debian box I'm using 1.3.29 with mod_jk 1.2 with Java 1.4.0
      on the Gentoo box I'm using 2.0.48 mod_jk2 2.0.2 with Java 1.4.2_04

  8. I'll move to 2.0.x when... by afabbro · · Score: 3, Insightful

    ...mod_perl does ;) Seriously. I (like many others) love HTML::Mason. HTML::Mason doesn't work with mod_perl 1.9.x and masonhq isn't going to make it work with mod_perl 1.9.x because they don't want to invest the energy in a pre-production release. I can't blame them. Until mod_perl goes to 2.0, I'm not going to ;)

    --
    Advice: on VPS providers
    1. Re:I'll move to 2.0.x when... by Jerf · · Score: 3, Informative

      It can be done, but it is a little touchy. Check the Wiki.

      Once I've gotten it running, though, it has worked correctly, so the hard part seems to be just getting it running. I'm actually using it in a 'production' environment, too, perhaps a little bravely, but it's better then the alternatives.

    2. Re:I'll move to 2.0.x when... by gtrubetskoy · · Score: 2, Informative

      mod_python has been on Apache 2.0 for almost 2 years now.... :-)

    3. Re:I'll move to 2.0.x when... by Shipwright · · Score: 2, Informative

      I have been using it for a year or so too but the same Perl, DBD::Pg and HTML::Mason code that ran for hundreds of days of uptime in 1.3 now have major memory leaks that freeze the machine unless I reboot daily. Luckily I have 9-5 East Coast users so I can get away with it.

  9. The article also clearly states... by magnum3065 · · Score: 2, Interesting

    ..."Bowen disagrees with the PHP documentation however, noting that actual users report that they are using PHP with Apache 2.0.x without problems."

    A while back on Windows I had some issues getting the PHP module to load in Apache 2.0 when I was trying to use the latest releases available for each. However, I believe it was in the beta days of PHP4 and I'm not a fan of PHP anyways, so that doesn't concern me.

    Now I use Apache 2.0 because that's what Subversion works with.

  10. Re:1.3.29 by nthomas · · Score: 4, Informative
    The one thing that is pushing me to upgrade is Subversion. According to Subversion's website, you need a 2.X binary to run the Apache plugin. This may be the first really big push for 2.X.

    As another user pointed out, you don't need to have Apache 2 running as your webserver if you want to access Subversion. You can do one of the following:

    • Run Apache 1.x as your webserver on port 80, and then have Apache 2.x running side-by-side as a separate server and have it listen on port 3690, the port that IANA has reserved for the Subversion protocol.
    • Instead of Apache, run the lightweight Subversion server svnserve. It's quite simple to set up compared to Apache, but can only grant blanket read/write permissions. Also, you can't fine-tune permissions on a per-directory basis like you can with Apache.
    • If you have pre-existing accounts on your system, you can tunnel through ssh via the svn+ssh://host/path/to/repo pragma which will authenticate itself via ssh and use the Unix file permissions on the repository.
    • If you are the only one accessing your repository, you can even use the file:///path/to/repo pragma and forego a server altogether.
    Each method has its benefits and disadvantages, you will want to evaluate all of them and choose one best suited to your business logic. Also, you definitely want to read over the upcoming O'Reily book Version Control with Subversion (see Chapter 6, "Server Configuration"). Good luck.

    Thomas

  11. RedHat ES 3.0? by rawg · · Score: 2, Informative

    I'm using RackSpace and the only way I can get PHP 4.3 and Postgresql 7.4 is if I use RedHat ES 3.0. It uses Apache 2. The only other option is to use PHP 4.1 and Postgresql 7.1. Stupid RackSpace. I would have used FreeBSD except they don't support it as they do with RedCrap.

    --
    The above is not worth reading.
  12. inertia... by borgdows · · Score: 2, Insightful

    I still use 1.3.x because I've been using the Apache 1.x series 'forever' and I've never found a solid reason to change.

    I still use Windows/IE/Office because I've been using the Windows/IE/Office series 'forever' and I've never found a solid reason to change. :/

    1. Re:inertia... by PReDiToR · · Score: 2, Funny

      Look harder, or to be really blinded, open your eyes.

      * This post is aimed at a Funny mod, not a Troll/Flamebait, no matter how close to the truth the joke is.

      --

      Do not meddle in the affairs of geeks for they are subtle and quick to anger
  13. Modules! by davegaramond · · Score: 2, Interesting

    Basically, the upgrade inertia is largely due to modules. For me here's the list of modules that are currently 1.3.x only: * ChiliASP/mod_casp. I don't know whether they have supported Apache2 now, but frankly I intend to get rid of it of mod_mono (which already supports Apache2). I truly hate this piece of crap! * mod_frontpage. Also haven't checked out lately. * a couple of C modules I wrote. I really hate C though, and I intend to rewrite these in Ruby/mod_ruby.

    1. Re:Modules! by Raxxon · · Score: 2, Informative

      Just was tinkering with mod_frontpage and it's now basically Apache2 only. They still have support for 1.3x, but it's being phased out from what I can tell.

      And installing it under 2.0.49 wasn't too bad after I realized that it REQUIRES the 'bin' user. :p It runs as well as anything MS related can under linux... ;)

  14. Mason does work under Apache 2 by simonff · · Score: 3, Informative

    Check out the guide. I've been running it like this for over a year.

  15. Cool names by Hard_Code · · Score: 4, Funny

    Ransom Love
    Havoc Pennington
    Sander Striker

    Geez, what books were your parents reading you to give you such cool names.

    I think I'll change my name to "Gusto McAction".

    --

    It's 10 PM. Do you know if you're un-American?
  16. v2 won't get enough testing by gilesjuk · · Score: 2, Insightful

    If everyone sticks to 1.x then 2.x won't get enough testing and bug reports. Of course you'd be silly to deploy 2.x if it's going to fall over miserably, but developers should have a box with 2.x installed for testing it and possibly assisting with bug reports.

  17. The guys with the hats colored red by jaylee7877 · · Score: 2, Insightful

    they've been using 2.0 with php since Sept. 30th 2002. They're pretty smart guys, real nice to. I trust em, So I've been using PHP with Apache2, no problems yet...

  18. Apache2 Apache1 by man_ls · · Score: 2, Interesting

    I switched from using Apache 1.3.28 with PHP for my business (running on Windows) to using Apache 2.0.48.

    With *no other configuration changes*, web pages were rendered and sent out to the clients *literally 3-5 times faster* than they previously had been. A site that took 11 seconds to load and display on Apache 1 took 4 seconds with Apache 2.

    This was over a 100 mbit LAN connection; so the bottleneck was definately server-side, not client side.

    (the entire thing is reduced to 1 second now...btw)

  19. How to use Apache 2 with PHP by dananderson · · Score: 2, Informative
    Apache 2 works for me with PHP. YMMV. The trick is to not use an external library that is thread-unsafe. I have instructions and troubleshooting information at http://dan.drydog.com/apache2php.html

    For Redhat 9 and probably other distributions, Apache 2 and PHP are supported out of the box.