This is a really fantastic work by Andres Borghi which was the winner in Your Big Break. I enjoyed the clip very much.
I recently decided to stop using the web sharing, apache and php server that comes with Mac and instead use XAMPP for the sake of more flexibility. Apparently there are some issues with the default PHP and Apache on Leopard, one being 32 bit and the other 64 bit. I won’t go into the details of this issue.
XAMPP is a really easy to install and free web server package that includes Apache, MySQL, PHP, XDebug and Perl in one package. XAMPP can be obtained from here: http://www.apachefriends.org/en/xampp.html.
After installing XAMPP everything seemed to work fine. I wanted to configure few Name Virtual Hosts and subdomains for my local websites so I could more precisely simulate the production environment. Unfortunately apache documentation, XAMPP documentation and few hours of google search didn’t help. There are some instructions out there in the forums, however they miss one important step. After few hours of fiddling, I noticed that the line that includes the file containing virtual host directives is not actually commented out in the http.conf file. So I thought it would be useful if I let people know of the issue and post the complete instructions here.
Note that these instructions include manipulating system files so it’s a sensible measure to create a backup copy of each file before you make changes so you can restore them in case unexpected happens.
In my instructions, I use nano in terminal for editing text files because I can get root privileges. You can use your favorite text-editor if you wish.
-
Add a host entry for local domains
The first thing you need to do is adding a host for your local domains. I chose .local instead of .com or .org for my top-level domain so there is no mix up with the live websites. Open the Terminal application and type the command:
sudo nano /private/etc/hostsEnter your password if you are asked. The hosts file will show up. Add this line at the end of the file:
127.0.0.1 noutash.local
Instead of noutash.local, type the domain name you want for your site. Press control + O, hit return to save and press control + X to close the file.
-
Add virtual host directives
In the Terminal window type this command:
sudo nano /Applications/XAMPP/etc/extra/httpd-vhosts.confEnter your password if you are asked. The http-vhosts.conf will open. change the line
# NameVirtualHost *:80
to
NameVirtualHost *:80
Use arrow keys to navigate to the very bottom of the file and add a virtual host directive similar to the one below for each of your websites that needs a domain name. DocumentRoot is the absolute path to your site’s folder and ServerName is the domain name you would like to assign to the website. Domain names must end with .local or whatever you used in your hosts file.
<VirtualHost *:80> DocumentRoot "/Users/basirnoutash/Sites/noutash" ServerName noutash.local </VirtualHost>
Press control + O, hit return to save and press control + X to close the file.
-
Uncomment the line for including virtual hosts in the httpd.conf
In the Terminal window run this command:
sudo nano /Applications/XAMPP/etc/httpd.confEnter your password if you are asked. The httpd.conf will open.
Note that the following line is near to the end of the file. You can use arrow keys to navigate or you can press control + W to search for it which may be easier.
Find and change the line
# Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
to
Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
Press control + O, hit return to save and press control + X to close the file.
Reboot your computer and restart XAMPP and you should be all set now. Type one of the domain names you added in your browser to test.
I haven’t tested it but I believe the same instructions will work on windows and linux systems as far as you can find the location of files to edit.
I saw this video on youtube, I found Steve Job’s speech very inspiring and thought I would share it here.
Finally I had a chance to put up my website up and release the Screen Ruler that I have developed a while ago. To learn more about this tool and download it go to http://nruler.noutash.com.
If you have comments or would like to request new features for future releases, please post comments here.




