In my spare time I’m developing a website based on Zend Framework which I run local, just on my Mac. It’s very fast, I do not need to upload the modified files and folders to the webserver and I’m saving money because I do not need web space right now, I only reserved the domain I’d like to use in the future.
When I add more and more functionality I’m exploring a lot of handy tweaks or commands that are not always just as you see on your webserver. Here are several of this tweaks and I’m sure I’ll explore more in the future. Do you guys have some suggestions?
Virtual host
Setting up a virtual host is very easy and the url is very nice, short and clean if you have set it up. You can get a address like this: http://domainname.local or something like that.
Just add the following lines at the bottom of your .httpconf file that can be found in the folder /etc/apache2/
<VirtualHost *:80>
DocumentRoot “/Users/myusername/Sites/domainname/public”
ServerName mylocaldomain.local
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory “/Users/myusername/Sites/domainname/public”>
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Chmod
For uploading files you’ll have to make the folder writable with the chmod command. Instead of opening your favorite ftp client, just open Terminal and type the following line:
Chmod 777 sites/domainname/etc/images/
MySQL server
Download MySQL Community Server for OSX and have MySQL available in seconds. A nice MySQL status tab is added to the Preferences tab. You can also start the MySQL server on startup.
You can download phpMyAdmin to maintain the database or use another MySQL administration tool.
Google Maps
If you need some Google Maps functionality it can be an outcome to develop on your own machine. I’ve requested my API key with the local addres, http://domainname.local, and this works! I’m glad Google hasn’t blocked this!
NOTE
Google Maps is not available when another user on your network visits your testing server. If you’d like this you’ll need to buy a Google Enterprise license.






