Slashdot Mirror


Running a Web Server on Mac OS X: Apache Made Simple

An anonymous reader writes "Having recently moved over to Mac OS X, I decided to look into running my own Web and FTP servers again from home. To my surprise, I discovered what many already know... that bundled into the underpinnings of Jaguar's networking framework was a distribution of Apache that appears as simple or robust as I want it to be."

44 comments

  1. Yea? by jonknee · · Score: 5, Informative

    If you didn't know Apache lives on X you may not know is PHP is installed too, it's just not activated. In the terminal: change two lines in /etc/httpd/httpd/conf (you'll have to sudo). When you find the lin #LoadModule php4_module libexec/httpd/libphp4.so (or something close) uncomment it (take away the pound). Do the same for #Add module mod_php4.c Now you have to add in the mime types, when you see the line AddType application/x-tar .tgz add these two below: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps now save the file. You can use emacs or something but I'm usually lazy and use pico. You can even use BBedit if you want, but that takes more explaining... have fun! You can also download a binary for MySQL (one click and you're databasing).

    1. Re:Yea? by HotButteredHampster · · Score: 3, Informative

      If you're going to be databasing with PHP and MySQL, make sure you get phpMyAdmin. This is easily the most useful software I've ever downloaded.

      It takes the software you already have: Apache and a browser, and turns it into an awesome admin tool for MySQL. Add databases, create tables, import/export data, browse data, you name it. Once you've got PHP, Apache and MySQL running, make this your next stop.

      --
      "Smart is sexy." -- D. Scully ("War of the Coprophages")
  2. This is why XRaid is so important by BoomerSooner · · Score: 5, Insightful

    It will make the XServes truly ready for the big time (SCSI instead of IDE).

    With the G5's from IBM, an increased bus (900MHz is what I've been reading for a 1.8GHz 64bit processor), and an easy migration path for legacy (3 years is legacy now!) apps to move from 32 to 64bit (a la SPARC), and Oracle 9i. Apple is positioning itself to be a major player. I know my company is taking notice.

    All I want from Apple is a Apple PDA (I hate Palms) and a Tablet PC (screw MS). I build Healthcare software and both these products are a necessity.

    1. Re:This is why XRaid is so important by Oculus+Habent · · Score: 2

      Real RAID would really help the Xserve. Right now it's a great toy, but the only things it offers that a PM G4 doesn't are a serial port, and hot-plug drives. Meanwhile, the G4 can offer real RAID through a PCI card, faster processors, and more.

      --
      That what was all this school was for... to teach us how to solve our own problems. -- janeowit
    2. Re:This is why XRaid is so important by BoomerSooner · · Score: 4, Informative

      XRaid is real raid. It will connect via a scsi cable to the XServe box. I'm missing where you say it's not real raid.

      I run IDE Software RAID on my Linux boxes and it's extremely fast. You can also run software RAID on the IDE drives in an XServe. However, eterprise apps need SCSI performance. XRaid is what will deliver that performance.

    3. Re:This is why XRaid is so important by Oculus+Habent · · Score: 3, Insightful

      I was thinking of internal hardware RAID as opposed to external solutions. Software RAID isn't bad, but it isn't as fast or as fault-tolerant.

      Also, with external storage, you lose the (minor) benefit of the 1U server, which isn't a problem in most situations.

      In conclusion, nevermind.

      --
      That what was all this school was for... to teach us how to solve our own problems. -- janeowit
    4. Re:This is why XRaid is so important by dalamcd · · Score: 1
      BTW: All this pico stuff your doing makes me wonder where all that "mac ease of use" has gone?

      Anything in /etc/ (and other dirs, like /usr/ and whatnot) is Darwin, not MacOS X (that would be /System/ and /Library/). This is not a precise measure by any means, but roughly how I think of it.

      I know I'm answering a (bad) troll, but I still feel this is an important distinction to make.

      dalamcd

      --
      moer liek CELtroid prime!!@1!
  3. Don't forget to shut it down before you reboot by Anonymous Coward · · Score: 5, Funny

    See here for more details, #10 in the linked article. Otherwise, your mac will go beep beep beep and devour your webpages. It's like.....a total bummer and stuff.

    1. Re:Don't forget to shut it down before you reboot by rampant+mac · · Score: 1

      Reboot? I almost forgot what that's like...

      --
      I like big butts and I cannot lie.
    2. Re:Don't forget to shut it down before you reboot by skinfitz · · Score: 5, Funny

      Reboot? I almost forgot what that's like...

      So you don't use software update then?

    3. Re:Don't forget to shut it down before you reboot by nuckin+futs · · Score: 0

      you know you don't have to reboot everytime you use software update right?

    4. Re:Don't forget to shut it down before you reboot by mbbac · · Score: 1

      Software Update only requires a reboot when stuff makes changes to the kernel.

      --

      mbbac

    5. Re:Don't forget to shut it down before you reboot by skinfitz · · Score: 1

      Software Update only requires a reboot when stuff makes changes to the kernel.

      So why does installing Quicktime 6.0.2 require a reboot? Is Quicktime support built into the Kernel??

    6. Re:Don't forget to shut it down before you reboot by mbbac · · Score: 1

      I think there are QuickTime kernal extensions. QuickTime is part of the overall Mac OS X foundation as well as being a player application.

      --

      mbbac

    7. Re:Don't forget to shut it down before you reboot by skinfitz · · Score: 1

      I think there are QuickTime kernal extensions. QuickTime is part of the overall Mac OS X foundation as well as being a player application.

      ...and iTunes? and Airport software?

    8. Re:Don't forget to shut it down before you reboot by mbbac · · Score: 1

      I think iTunes installs k-exts for the iPod.

      --

      mbbac

  4. Umm, Xserve RAID is also IDE by daveschroeder · · Score: 5, Informative

    Two problems with your post:

    1. Xserve RAID runs IDE drives internally, just as the Xserve itself does (albeit with hardware RAID capability).

    2. You have always been able to get an Apple-supported Ultra160 SCSI card, and add any external SCSI disk array you wish.

  5. Could you give a link. by BoomerSooner · · Score: 2

    All I've been reading says XRaid will be an Apple delivered SCSI solution.

    Yes you can install a Ultra160 but running a Dell in a rack of Apple XServes kind of defeats the purpose of trying "switch" to all Apple HW/SW.

    1. Re:Could you give a link. by Alan+Partridge · · Score: 1

      and why on EARTH would you choose Dell as your storage solution? Force of habit?

      --
      That was classic intercourse!
    2. Re:Could you give a link. by Anonymous Coward · · Score: 5, Informative

      Then you've only been reading posts from people who didn't pay attention when the XServe an the XServe RAID were announced. The XServe RAID uses the same drives and the same drive trays as the XServe does. It will have an independent IDE bus for each drive just as the XServe does. Apple expects this to provide superior performance to what would be achieved with a bunch of SCSI drives sharing one buss.

      The XServe RAID to XServe connection will be by fiber channel as Apple also announced.

      This story talks about the fiber channel connection on the xServe RAID:
      http://news.zdnet.co.uk/story/0,,t269-s2110 207,00. html

  6. a question about trailing slashes by stego · · Score: 4, Interesting

    On some of the OS X/Darwin machines I've put pages on, the URL must have the trailing slash to work. An example would be something like http://site/~usrname/ would work, but http://site/~usrname does not. Can anyone suggest how/where this behavior is set?

    1. Re:a question about trailing slashes by Anonymous Coward · · Score: 4, Informative

      Usually this is a configuration issue. When you set up Aliases and the like in Apache, if you include the trailing slash in the path, Apache will require it in requests. If you leave off the slash, Apache will not require it, but will append it to the request when appropriate.

      Check your Alias, ScriptAlias and Directory directives and remove trailing slashes from them. And since you mention the ~username example, don't forget to check under the mod_user area.

    2. Re:a question about trailing slashes by goon+america · · Score: 5, Informative
      I had the same problem. The problem is your hostname is not configured properly. When you send a request for http://site/~whatever, or any other directory without a trailing slash, Apache will send a 302 Found response and redirect the user to http://site/~whatever/ .

      However, unless you configure it yourself, Apache on Mac OS X does not know what hostname it is running on so it can't redirect properly, and will send a redirect to the user to a url with the wrong site.

      You can fix this either by changing the ServerName directive in /etc/httpd/httpd.conf or by formally changing your machine's hostname using NetInfo (some instructions here).

    3. Re:a question about trailing slashes by goon+america · · Score: 2

      Correction: Apache actually sends a 301 Moved Permanently response code, not a 302. (Not that there's any functional difference.)

  7. thanks by stego · · Score: 3, Interesting

    That is a wonderfully informative and concise response...

    1. Re:thanks by goon+america · · Score: 3, Insightful

      np ya I went through a fair amount of frustation figuring out that problem myself. Use curl -I http://site/~whatever to look at the headers the server is sending for a particular url, that's part of how I figured it out.

  8. PDA by Anonymous Coward · · Score: 0

    I still have my Newton Messagepad 2000. It has basically the same processor as the iPaq... the main difference is: it works.

    The Newton OS is still years ahead of Palm and PocketPC. The second-generation handwriting recognition doesn't require you to write one letter at a time, is faster and more accurate that the system in Pocket Windows (and better integrated into the apps). Apple should revisit the Newton -- today they could put it in a shirtpocket.

  9. http://www.apple.com/quicktime/qtv/xserve/ by daveschroeder · · Score: 5, Insightful

    You'll have to watch the rollout, but when Jobs talks about Xserve RAID, he touches on the fact that it's hardware RAID, and uses the same disk packs as the Xserve (i.e., IDE). This DOES NOT, however, mean that it's "slow", just because it's not SCSI. As for adding your own Ultra160 SCSI-connected disk array, I'm lost on why you think that it must be Dell? All I'm saying is that if people are hell-bent on running SCSI for some reason, they're more than welcome to. If you're actually "thinking different" by switching to an all Apple solution as you indicated, you'd do well to consider the IDE-based Xserve RAID when it's available...because its performance will be very impressive.

    1. Re:http://www.apple.com/quicktime/qtv/xserve/ by Shanep · · Score: 2

      All I'm saying is that if people are hell-bent on running SCSI for some reason, they're more than welcome to.

      SCSI has the ability to queue commands and re-order the pending commands in such a way as to reduce head movement. They can also read and write to the SCSI bus while they are carrying out received commands and share the SCSI bus bandwidth with more SCSI devices on the same bus.

      An IDE bus can only service one command and one device at a time.

      If a SCSI drive was working on one command fetching data and another four commands were pending: 1st near the start of the disk, 2nd near the end, 3rd near the start and 4th near the end, instead of the head movement going, start-end-start-end in the order that the commands were received by the drive, the drive could re-order the commands while it waits for the current command to complete so that the commands would be carried out: 1st, 3rd, 2nd then 4th so the head movement would go: start-start-end-end, reducing time to fetch the data due to reduced head movement. 1 full stroke versus 3.

      For desktop apps, this doesn't matter so much. But for database servers which can tend to send lots of small requests scattered randomly around the disk, this can have a huge performance gain over IDE drives, many many times.

      Perhaps Apple can remedy this a little with many drives. Maybe they can perform the re-ordering in their SCSI interface?.

      --
      War crimes, torture, lies, illegal spying... Would someone give Bush a blowjob, already, so he can be impeached?
  10. Xserve RAID is NOT SCSI by daveschroeder · · Score: 5, Informative

    It is IDE.* It is also hardware RAID. Being IDE does not preclude it from also being hardware RAID. Xserve RAID is a 2Gbps FCAL-connected IDE-based hardware RAID array. Get it? If you think you need SCSI, get an Ultra160 SCSI card from Apple, and get a SCSI-based array from some other vendor. *For reference, see http://www.apple.com/quicktime/qtv/xserve/

    1. Re:Xserve RAID is NOT SCSI by bursch-X · · Score: 1

      Don't confuse Xserve with X-RAID. Xserve is the server which an use the internal IDE disks to build a RAID.

      X-RAID is a full-blown SCSI-RAID for the Xserver from Apple that will be announced soon (Apple mentioned it when they announced the Xserve).

      --
      There are two rules for success:
      1. Never tell everything you know.
  11. It's IDE: Transcript of Xserve RAID introduction by daveschroeder · · Score: 5, Informative

    From http://www.apple.com/quicktime/qtv/xserve/

    [Steve Jobs:]
    01:19:15

    So, you've just heard all about Xserve, and what we'd like to also do is give you a little technology preview of something that we're going to be rolling out around the end of this year, and that is a companion product called Xserve RAID. So, this is Xserve and Xserve RAID is an amazing companion storage product, and it looks like this. I'd like to invite Alex Grossman from Apple up to give us a preview of Xserve RAID. [Alex Grossman, Director, Hardware Storage Marketing, Apple]:
    01:19:50

    Thanks, Steve. Okay. I'm really excited to give you a technology preview of our rack-optimized storage, and rack-optimized storage is the perfect complement to the server. What we've done is developed a very high density, 3U height rack-optimized storage device that has 14 drive bays. And with that density, we're able to put 14 120GB hard drives in the same Apple carriers that we use in the server, and deliver 1.68TB of storage, and that's massive. But to get that storage to the server, we had to choose a high-speed interconnect. We chose what we think is the best, which is 2Gb fibre channel. But we went one step further, and we put dual 2Gb fibre channel on the system. That gives us 400MB/sec of storage throughput. That's just incredible. And that is the latest and the greatest fibre channel out there. But RAID systems are all about data protection and to achieve data protection, we put dual RAID controllers in the system, and we put all the critical components as redundant components. In fact, the drives, the power, and the cooling are redundant in the system. And they're hot swappable. The way we achieved this was through a brand new Apple design architecture. And let me take you through that really quickly. The architecture has 14 independent hard drives and each RAID controller connects to 7 of these hard drives. The hard drives have independent ATA controllers that go to the heart of the system, and the heart of the system is the RAID processor. The RAID processor is very fast, and it's powerful. And we've added 128MB of processor cache to it for even better performance. Up on the top of the diagram, there's a little blue icon, probably not familiar to all of you, but that's the icon for 2Gb fibre channel. So our 2Gb fibre channel controller actually has its own dedicated PCI bus to the RAID processor. And that gives us substantial throughput, really really high throughput. This thing was designed for max throughput. Off to the side of that, you'll see what we call the RAID Environment Manager, and that's a tool - it's actually an embedded coprocessor - that gives us the ability to manage these RAID systems remotely. So we can set them up, we can manage them, and we can monitor them, very similar to what we do with Xserve. If we put the whole thing together and look at the entire diagram, we see that on each side, we have redundant power, we have redundant load-sharing power supplies, and in the center we have redundant cooling. And just like Xserve, the cooling is smart, so if one of the cooling systems fails, the other one will take up the speed. You'll also notice the little green bars up on top. Those are redundant drive cache, so, actually, we cache the processor memory. And overall, this makes a very fault tolerant system with very high throughput. Xserve RAID is going to be available, as Steve said, by the end of calendar year 2002. So let me just sum it up for you real quickly. 14 drive bays, very high density 3U enclosure, 1.68TB of massive storage online, and 2Gb fibre channel. That's Xserve RAID. And this is only a technology preview, we're going to announce this later in the year. Thanks, Steve.

    [applause]

  12. PerfCache & Restarts etc by Anonymous Coward · · Score: 0

    Been running since the OS X betas, now on Server X 10.2.1, and the only issue that I have seen (for a very high hit web site (10 connections/sec sometimes, more this week, up in the 100s per second) is that sometimes it won't start up.

    The solution is to go to one web site, turn off the PerfCache, hit start, then stop it, turn it back on and restart. I am not exactly sure why it is doing it, anyone else seen this? ;-) Any ideas on it?
    Thanks

  13. Now you can easily run SlashCode etc. by 47Ronin · · Score: 4, Informative

    Well, now that the poster has discovered that OS X includes all the usual stuff like Apache, PHP, Perl, etc.. He can just as well install and host:
    -- SlashCode (moderate difficulty)
    -- GeekLog (pretty darn easy and very flexible)
    -- phpBB (very easy, not too customizable)
    -- WebMin (very easy, can use SSL & its own miniserv)

    In addition, with a minor tweak or two he can run:
    -- Resin JSP servers
    -- ATG Dynamo e-commerce development platform (Java)

    There are many possibilities, in fact quite a few of these run well out of the box on Mac OS X... just browse around sourceforge.net!

    I've gotten a few sites running off Jaguar right now.. Here's a geeklog site running off a 266MHz G3-upgraded PowerTower Pro mac clone:
    http://geeklog.47ronin.kicks-ass.net:8001

    --
    Those who laugh at you for you having a Mac.. are the people who constantly call you to fix their PC.
    1. Re:Now you can easily run SlashCode etc. by snStarter · · Score: 1

      I thought there were serious problems getting current SlashCode to run under OS X. Isn't this the case?

  14. Connecting to the web on OSX: Browsing made simple by Anonymous Coward · · Score: 0, Redundant

    Having recently moved over to Mac OSX, I decided to look into connecting to a website again from home. To my surprise, I discovered what many already know... that bundled into Jaguar was a web browser that appears as simple or robust as I want it to be.

    I was like no way! I would have never guessed. It's almost as if I have not been around computers for the last several years.

  15. Running a Web Server on OSX: Apache Made Simple by Anonymous Coward · · Score: 0

    Having recently moved over to Mac OSX, I decided to look into running my own Web and FTP servers again from home. To my surprise, I discovered what many already know... that bundled into the underpinnings of Jaguar's networking framework was a distribution of Apache that appears as simple or robust as I want it to be. But then everyone was like "umm... yeah?" What a... bummer. My name is anoymous reader and I haven't been around computers for the past several years.

    The users Apple hopes never get into their ads...

  16. No by daveschroeder · · Score: 3, Insightful

    No, you're completely and totally wrong.

    1. There is no such product as "X-RAID" from Apple, nor will there ever be. It is called "Xserve RAID".

    2. Xserve RAID is ***NOT*** SCSI. It is connected via 2Gbps fibre channel (not SCSI), and its internal disks are ATA (not SCSI).

    See this post for the transcript of the Xserve RAID introduction:

    http://apple.slashdot.org/comments.pl?sid=43540& ci d=4549231

    1. Re:No by stux · · Score: 2

      I was under the impression that 2gbps FCAL *was* SCSI...

      But then again, 'scsi' isn't the be all and end all, after all, FireWire is also *scsi*

      --

      ---
      Live Long & Prosper \\//_
      CYA STUX =`B^) 'da Captain,
      Jedi & Last *-fytr
    2. Re:No by jimbolaya · · Score: 2

      Neither Fibre Channel nor FireWire are SCSI. While I admit to not knowing much about Fibre Channel, I do know that SCSI is a parallel interface while FireWire is a serial interface. And I'm sure the differences go much deeper than that.

      --

      There ain't no rules here; we're trying to accomplish something.

    3. Re:No by stux · · Score: 2

      They're a form of SCSI.

      SCSI is a protocol, it just so happens that you're thinking of an older version of SCSI which had a specific physical cabling.

      FireWire is book E of the SCSI spec... or something... look it up ;)

      FireWire is a form of serial scsi

      --

      ---
      Live Long & Prosper \\//_
      CYA STUX =`B^) 'da Captain,
      Jedi & Last *-fytr
  17. Tagged command queing and connect/disconnect by wchin · · Score: 1

    Yes, these are advantages of the current SCSI over ATA/ATAPI standards. However, if you have a single disk on a single bus connected directly to a host bus adapter with identical drive mechanisms, which is faster... SCSI or ATA? Actually, ATA will win most of the time - the lower overhead overcomes the advantage of tagged command queuing most of the time. Further, if you I/O workset is comprised mostly of large files stored sequentially, then tagged command queuing isn't a factor at all. The Xserves use two Promise Technology ATA controllers, each with two ATA busses. So each drive is alone on a bus - connect/disconnect is then factored out.

    There is still a big difference - you can get high performance 10 to 15krpm drive mechanisms with SCSI CAM or FC-AL interfaces, but not with ATA drives. The SCSI/FC mechanisms often come with better warranties too. However, they tend to run hotter which makes cooling critical. At least the Xserve takes advantage of SMART to monitor the drives, so failure can possibly be predicted in advance.

    One has to zoom out a bit to take this into perspective. If you want 60gb of storage on-line with resiliency from single drive failure, you can choose several different tactics. On an Xserve, you can choose RAID 1 with two 60gb ATA 7200rpm IBM drives implemented in software with a little bit of hardware. Many server attached internal SCSI RAID solutions deployed in the x86 world use RAID 5 on 3-4 SCSI drives. Let's choose 3 10krpm 36gb SCSI drives. What kind of write through put can you expect with 3 10krpm SCSI drives in RAID 5 with a decent hardware RAID controller... say, something like a Mylex ExtremeRAID with a 200+mhz StrongARM and 128mb on-board cache vs. 2 7200rpm ATA drives in software RAID 1? Actually, the software RAID 1 will win a lot times. Why? Overhead of RAID 5 means that 50% more data has to be written, plus that CRC data has to be calculated, and the SCSI bus arbitration and the like. The Xserve with dual processors and software RAID 1 can simultaneously write from the exact same buffer to platter at the same time, driven by two CPU's. This is not like many software or hardware RAID 1 implementations. That means that the Xserve dual processor configuration can write as fast a single disk (about 40-45mb/sec). Again, we're talking sustained write speed as a lot of benchmark numbers I've seen don't sufficiently factor out the effects of cache. Then you factor in cost, and the software RAID 1 in the Xserve is very competitive. You could of course choose to run RAID 1 in hardware with 2 72gb SCSI drives. But then the cost hits you. :) This is coming from a ex-SCSI bigot and a huge Fibre Channel/SAN fan.

    For Apple's target market, the software RAID implementation makes sense. If you need more than that, you can always choose external RAID solutions. If you have serious storage needs you should be talking Fibre Channel SANs anyways, regardless of platform.

    1. Re:Tagged command queing and connect/disconnect by Shanep · · Score: 2

      Hi,

      I don't disagree with any of your points. I just wanted to state the major advantages SCSI has over IDE, answering the "why would anyone use SCSI over IDE" type question.

      Different horses for different courses. I wouldn't waste the money of a SCSI drive on a video editing workstation but I also would not choose IDE for a busy database.

      --
      War crimes, torture, lies, illegal spying... Would someone give Bush a blowjob, already, so he can be impeached?