Ok, so this is basically a conversation between perk and me. Anyone else feel free to chime it, but basically perk is playing Yoda to my Luke.
We had been talking about my Linux woes, and that maybe the mac mini is the better way to go as a server. Partly because you are talking about a small, cheap, easily replaceable, consistent hardware, and a pretty solid OS. The other reason is what I thought of, which is, I know my way around a mac desktop. Yea sure, I should learn the shell and do everything from the prompt. Pfft eat me. Im a windows tard, who swims in the mac tard pool. I have enough windows server knowledge to fill the bucket half way, and when you include my wife's mac needs, i dont have half a bucket left for linux. At least I can do alot from the desktop if need be, and perk is avoiding my calls.

So... without further ado... WTF now?
So perk,
Bought a mini today. Figured I would get started, while waiting for the RAM to come in a few days. Initial peeve is why did they use 2 freaking sticks of 512... ugh. anyways...
all setup, turned off some duh things like bluetooth and wifi, never screensaver, never sleep, never hard drive off, etc. turned up the security to what seemed to make sense to me, like no autologin. But now what?
first thing I have learned, its bash. meh whatever, I have no preference, so great, at least now I know its Bash when I need to lookup something online.
But how do you install services like apache or php or mysql? Is there an apt-get/yum/rpm type deal, or is it a little more hands on?
oh yea, and how do you add multiple IPs?
that i think is a good start... nothing big... lol
#############################################
# pasting the brief steps here for future reference #
#############################################
This is a post to consolidate some steps into 1 post for reference
install OSx clean.
turn off all the extra applications that are not needed.
when it finally finishes and boots...
###Via the GUI
install xCode tools - was on install CD/dvd #2 for me. this puts the compiler tools into linux for you.
in system settings -> sharing
turn on screen sharing for vnc, and click computer settings. set a password if you need VNC
Turn on remote login for SSH
Make sure web sharing is off.
set screen saver and power features to never, and hard disk checkbox as well.
set security to disable automatic login, log out after X minutes, Require password to unlock system prefs pane, disable infrared.
turn off blue tooth if you dont need it.
turn off wifi if you dont need it.
under users, change to display login as Name and Password, to reduce external knowledge. turn off everything under guest.
download mysql,php, and apache sources into your downloads folder (default).
uncompress each of those, and delete the compressed files.
###via terminal or SSH
to make life easier so you dont have to worry about stuff while getting set up, do: sudo su
First lets make sure that apache isnt running, because if it is, the rest of this might not go well...
ps aux
if you see anything at all in the list that is httpd, your pooched. websharing must be on, or something went bad.
I had to reinstall.
cd /usr
mkdir local
cd local
mkdir installs
mv /users/whateveryourshortnameis/downloads/mysqlORphpORapache /usr/local/installs/mysqlORphpORapache
your user directory is whatever your login name was you set during install of OSx.
mysqlORphpORapache is each folder of those. you will do that 3 times obviously...
mv /usr/bin/php /usr/bin/php-leopard
mv /usr/bin/phpize /usr/bin/phpize-leopard
you are just relocating the original OSx versions to get them out of the way, just in case.
###setting up apache
cd /usr/local/installs/yourapacheinstallfolder
vi configure.XX
XX is your initials
in VI, you press i to insert, ESC to get out of insert, :w to save :q to quit.
enter this (or whatever custom settings you want)
./configure \
--enable-rewrite \
--enable-ssl \
--enable-proxy \
--enable-so
save and quit :wq
chmod 777 configure.XX
./configure.XX
now it will run the configuration. wait until its done.
make
wait until its done
make install
wait until its done and they yeay, apache is installed.
###setting up mysql
cd /usr/local/installs/yourmysqlinstalldirectory
we will just use the default config, but otherwise, do the same as above, but with your settings.
./configure --prefix=/usr/local/mysql
wait....
make
wait....
make install
wait.... Done with mysql
cp support-files/my-medium.cnf /etc/my.cnf
cd /usr/local/mysql
bin/mysql_install_db
chown -R root .
chown -R mysql var
chgrp -R mysql .
bin/mysqld_safe & <<< Dont forget the ampersand
bin/mysqladmin -u root password NEWPASSWORD
###setting up PHP
cd /usr/local/installs/yourphpinstalldirectory
vi configure.XX
enter this, or your own custom version
./configure \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-pear \
--disable-cgi \
--enable-ftp \
--enable-soap \
--enable-sockets
exit by typing :wq
chmod 777 configure.XX
./configure.XX
wait....
make
wait....
make install
wait.... PHP is now installed
Woot! all the junk is installed, now to make stuff go.
/usr/local/apache2/bin/apachectl start
apache should now start, and if you "ps aux" after a minute or two, you should see a few httpd processes running.
if it seems to be the default directories, and not /usr/local/apache2/bin/httpd
then do apachectl stop
wait a minute or two
/usr/local/apache2/bin/apachectl start
wait a minute then
ps aux
it should now show the correct path.
the reason this is a problem is because apparently if you just type "apachectl start" from anywhere,
including your apache dir, it will still use the default OSx install of apache... dumb.
So you HAVE to use the full path to call it, or i guess you could cd to your dir and do ./apachectl start
which i think will work as well now that I think about it.
because you have no hosts set yet, you need to create a virtual host. for now you probably get the apache test page if you do
http://localhost or hit the IP of the machine from another.
so... now on to hosts.
I am not going to cover how to change your hosts file or dns on your desktop machine. if you dont know how to do that, frankly this thread is probably a bit beyond you. but if you are not familiar with it from memory, here you go
http://en.wikipedia.org/wiki/Hosts_filecontinuing in terminal on the OSx web box.
cd /
mkdir www
cd www
mkdir sites
cd sites
mkdir test.com
cd test.com
create a simple index.html file and a php file which has <?php phpinfo(); ?> in it
cd /usr/local/apache2/conf/extra
vi httpd-vhosts.conf
it should be pretty straight forward.
you can set a specific IP, or just leave it *
set the server name you want, the aliases like www, and the document root.
change the document root to /www/sites/whatevertestdomainyouareusing
set the servername and alias to whatevertestdomainyouareusing
quit and save
cd .. so you are now back in /conf
vi httpd.conf
change the DocumentRoot to "/www/sites" or where ever you chose to put your sites. its kind of like a "you can work here" directive.
change <Directory "/whatever/path/was/here"> to have the same path you set in DocumentRoot
go to the bottom of the file
uncomment (remove the #) from the line under #virtual hosts. This allows apache to load the virtual hosts file which will allow you to run your website empire.
add these 3 lines, technically anywhere, but put below the Dynamic Shared Object (DSO) Support comment block
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
save and exit :wq
restart apache