Another user email prompted this post so if you have a question feel free to drop me a line.
The following directions mirror how I have Mobile Web OSP set-up on my own Mac. It's pretty straightforward to set-up.
Special Note: The default install of PHP on Mac OS X may not support short tags (e.g. <? ?>
) wrapping PHP code and rather expect <?php ?>
. Short tags are used quite a bit so you will want to turn short tags on. This is something I need to address in a future update to the system.
Downloading Mobile Web OSP
I'm not going to go into too much depth with this. Use the solution that best suits you. Just make sure you know where you installed it. You should also finish configuring the project at this time as well.
Setting Up m.test.edu
I like to set-up custom hostnames on my machine for my projects. It's just easier for me to remember. Also, since all of our projects are delivered on their own subdomains I know all the paths and what not will work correctly. To add a custom hostname for your project do the following:
- Open "Terminal" (it's in Applications > Utilities)
- Type:
sudo pico /etc/hosts
- When prompted type in the password you log into your Mac with
- Add the following to the end of the file:
127.0.0.1 m.test.edu
- Type:
control+x
- Type
y
to save the changes
You've just added the hostname m.test.edu to point at your local machine.
Configuring Apache
Now that you have a custom hostname you have to make sure that Apache will answer to the added hostname on your machine. To do so do the following:
- Open "Terminal"
- Type:
sudo pico /etc/apache2/extra/httpd-vhosts.conf
- If prompted type in the password you log into your Mac with
- Add this gist to the end of the file. Make sure the path to the project for DocumentRoot and the Directory directive are correct.
- Type:
control+x
- Type
y
to save the changes - Type
sudo apachectl restart
to restart Apache - Go to http://m.test.edu in your browser
So now you should be all set with a test instance of Mobile Web OSP answering to it's own hostname on your Mac.