Apache server?

Discussion in 'Mac Programming' started by toddburch, Jun 23, 2007.

  1. toddburch
    Expand Collapse
    macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #1
    I am so ignorant in this area of servers and networking, but I want to get up to speed leveraging a server from an application development perspective.

    Did I read somewhere that Apache Server comes standard on a MacPro (or with OS X)?

    Todd
     
  2. janey
    Expand Collapse
    macrumors 603

    janey

    Joined:
    Dec 20, 2002
    Location:
    sunny los angeles
  3. CoreWeb
    Expand Collapse
    macrumors 6502

    Joined:
    Mar 2, 2007
    Location:
    Edge of reason
    #3
    It does come standard on Mac OS X. It can be enabled through System Preferences, by enabling web sharing.

    Personally, I tend to build Apache from scratch, along with PHP.
     
  4. toddburch
    Expand Collapse
    thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #4
    OK, perfect. This is good.

    Now, I would like to go through a good exercise to start getting familiar with using it.

    I would like to write a web form that gathers data from the user, sends it to the web server, a script on the web server (preferably ruby) processes the data, and sends a new page to the user. Basic stuff.

    If it's OK, I'll start on the HTML for the web page, and when I get the form like I like, I'll post it here and perhaps you all can help me get this going.

    Thanks! Todd
     
  5. jsw
    Expand Collapse
    Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #5
    As recommended above, I also think you'd be well-served to download, build (optional), and install the latest Apache version. The OS X one is a bit older and more limited than the latest, and you'll be more able to mess with configurations without worrying about messing up OS X in some way.
     
  6. jeremy.king
    Expand Collapse
    macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
    #6
    You don't need Apache for Ruby...You can run something like LightTPD or WEBrick.

    See http://developer.apple.com/tools/rubyonrails.html

    Of course you could run Perl or PHP
     
  7. toddburch
    Expand Collapse
    thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #7
    Activating Apache Web Server on OS X has got to be one of the easiest things I've ever done on a computer... duh. I see its only 1.3. I can upgrade that later.

    I'm approaching this effort at a cross-platform perspective on my new MacBook. I've already installed Bootcamp Beta 1.3 and Win XP Pro (and Java SE 6u1, Ruby, MS Visual Express C++, Visual Basic Express)

    On the Mac side, I started Personal Web Sharing. Going to the url specified in System Preferences in Safari, I get the "It works!" message.

    On the Windows side, I downloaded and installed Apache httpd server 2.2.4. I can navigate to http://127.0.0.1:8080/ and I get the default page. I then installed PHP 5.2.3 on Windows as well.

    A couple questions... does PHP come on the Mac? And, I'll probably use MySQL as my backend database. I figure I'll have to download it for Windows for sure. What about the Mac?

    I realize there are other servers (like WEBrick), but I'll start with Apache first, get comfortable with it, and then perhaps investigate others. Also, I understand Perl is a great language, but it's just another syntax I don't want to learn right now, so if I can use Ruby for server-side scripting, which I think I can, I'll be a happy camper.

    I've not used PHP before, nor MySQL (But I got a book!) PHP, as I understand it, is implemented an extension to HTML. As far as MySQL goes... I've been working with DB2 for 23 years, and I imagine I can figure it out ok enough. ;)

    Y'all are great! Thanks. Todd
     
  8. janey
    Expand Collapse
    macrumors 603

    janey

    Joined:
    Dec 20, 2002
    Location:
    sunny los angeles
  9. HiRez
    Expand Collapse
    macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #9
    PHP 4.4.4 is built into OS X 10.4 by the way (it may be installed with the Developer Tools instead of the standard install though, I'm not sure since I installed the dev tools immediately). MySQL you'll have to install separately but it's not hard (although I had some issues trying to configure it and get the permissions set up right with the GRANT statements, etc., although this was some time ago).
     
  10. ChrisA
    Expand Collapse
    macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #10
    Without messing up Mac OSX? Either way it's exactly the same. Simply edit /etc/httpd/httpd.conf
    For the stated purpose of handling simple HTML forms any version of Apache is as good as the next.

    The default install on Mac OSX will run a low volume server even off a G4 Mac.
     
  11. ChrisA
    Expand Collapse
    macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #11
    You might be a bit disappointed with MySQL. By default transactions are not even atomic. Locks work the the table level and so on. Pretty primitive. You can configure it so it works like a "real" dbms. Take a look around there are some free dbms' that are comparable in features/quality to what you are used to with DB2.
     

Share This Page