web server: macports vs. mac osx server
Ryan Schmidt
ryandesign at macports.org
Sun Apr 29 02:26:22 PDT 2007
Hi Michael; welcome.
On Apr 29, 2007, at 03:44, Michael Thon wrote:
> Hi All - I'm setting up my research computing environment at a new
> university and I'm thinking of buying all apple hardware and
> running Mac OS X rather than linux, as I have done in the past. I
> have been tinkering with macports for a while on my macbook and it
> seems to be a great way to manage the open source software I need
> for life science research.
>
> I need to set up a web server with Apache, PHP, Perl, and MySQL and
> I wonder if I should plunk down the extra money for OSX Server or
> install and maintain these applications using macports. I have been
> looking through the macports web site for documentation on
> installing these packages but I can't find any. Is any needed?
> It looks like I will need to have the right set of variants to get
> all these packages installed and talking to one another correctly.
> I also assume that I need to install the macports version of Apache
> and that I can't use the one installed with OS X? Is there a
> tutorial somewhere for setting up a web server with macports?
I don't use perl much, so I won't mention it below. Mac OS X of
course already comes with perl so you don't even need MacPorts to get
it.
If you want Apache, I recommend you use Apache 2 from MacPorts:
sudo port sync
sudo port install apache2
sudo port install mysql5 +server
sudo port install php5 +apache2 +mysql5
I believe for mod_perl support in Apache 2 you would do
sudo port install mod_perl2
If you would like to use Apple's Apache 1 server instead, you can:
sudo port install mysql5 +server
sudo port install php5 +apache +mysql5
I believe this works with the Apache 1 provided with Mac OS X. No
idea whether it works with the Apache 1 provided with Mac OS X Server.
Note that I will rename the "apache" variant soon to something that
more clearly indicates its purpose, such as "apache_apple". At that
time you will need to reinstall php5 with that new variant name. At
that time, the variant "apache" will be changed to use the MacPorts
version of Apache 1.
The mod_perl port exists for the MacPorts version of Apache 1.
I can also highly recommend lighttpd, a lightweight web server that
can outperform Apache and which has some pretty cool built-in load
balancing for server-side scripts like php, and which, quite frankly,
I would find much easier to set up if I didn't already know so much
about Apache configuration files. If you're not yet well-versed with
Apache's configuration, you might find lighttpd considerably easier:
sudo port install lighttpd +ssl
sudo port install mysql5 +server
sudo port install php5 +fastcgi +mysql5
After that, configure the software. Consult the usual documentation.
(Consult the Apache web site for information on configuring Apache,
consult the MySQL developer zone for info on configuring MySQL, etc.)
The advantage of Mac OS X Server is the various Apple services that
are provided (NetBoot, AppleShare, blog server, iChat server) and the
GUI interfaces they've made for various open-source packages (Open
Directory, Apache, Mail, DNS). If you don't need those services, then
Mac OS X Server is less attractive. Consider also that not all Mac OS
X Server components have GUIs. For example, their version of Apache 2
has none. (Their version of Apache 1 does, however.) Personally, if I
were running a mail server, I would want Mac OS X Server because it
does include a very nice GUI for administering that which has been
refined over many years, and I know nothing about mail server
administration otherwise. Same with the DNS server. But for services
like mysql and apache which I already know how to administer, any GUI
is just going to slow me down and restrict what I can do.
That's not entirely true. I do use GUIs to manipulate data in MySQL.
I usually use the web-based phpMyAdmin, but there are native Mac
applications as well which are probably great too. Even MySQL AB
makes one that's free.
So you need to evaluate your needs and your server administration
skillset. But it sounds like you may be able to get by just fine with
Mac OS X client and MacPorts. Now, if you're already buying an
Xserve, no reason not to run Mac OS X Server since it comes with it.
But I would think hard about whether to pay $999 for Mac OS X Server
for another machine, money which might do much more good if spent on
upgraded hardware.
More information about the macports-users
mailing list