![]() ![]() My eyesight is precious heaven forbid I waste it-not to mention the three whole seconds of my time-doing that! Far more productive would be to spend a few minutes learning how to set it up to run automatically, in a Leopardy way.Īs Apple’s documentation on System Startup Programming Topics describes, the Leopardy way to start services automatically is via launchd (and the Tigerish way is via StartupItems, also covered in that link). I originally set up my MAMP GUI program to run as a login item for my account in System Preferences, but I got tired of having to switch to it so I could quit it and not have to look at it. Then you can just work from there without having to publish your files out to some directory just so you can test things. If your project doesn’t have a build process that dumps the published files to your virtual host’s DocumentRoot, sometimes it’s useful to create the DocumentRoot as a symbolic link that points to your working copy of the project’s version control repository. Options Indexes FollowSymLinks MultiViews ĭocumentRoot /Applications/MAMP/htdocs/vhost.local/ Probably 90% of mine are just slight variations on this. Sample Virtual Host (/Applications/MAMP/conf/apache/vhosts/) On Tiger, you have to make sure your lookupd is set up to read from /etc/hosts before hitting DNS. ![]() Prefix the filename of the one you want to be the default site with something like 000- to make sure it comes first alphabetically.Īlso note, of course, that if you don’t have a local DNS server, you’ll need to set up a line in /etc/hosts for each virtual host. One exception is that the first one processed becomes the default site served up when you hit 127.0.0.1 or localhost. Generally, other than whatever you set up as your filename inclusion expression above, the filenames of the vhost definitions don’t matter. Feel free to use your own fancy expression here restart MAMP every time to make the changes take effect. conf extension to enable a file remove the extension to disable it. Note that the Include statement makes it easy to turn virtual hosts on and off: just rename files in the vhosts directory. If you didn’t switch to port 80, you can drop the sudo, by the way. ![]() Sudo /Applications/MAMP/bin/apache2/bin/apachectl restart Include /Applications/MAMP/conf/apache/vhosts/*.conf Open /Applications/MAMP/conf/apache/nf and add this to the end:.Mkdir /Applications/MAMP/conf/apache/vhosts Put any virtual host definitions in this directory (see below for a simple virtual host). Create a directory /Applications/MAMP/conf/apache/vhosts.Assuming you’ve installed MAMP at the default location of /Applications/MAMP: Getting more than one site working is pretty simple. Keep that in mind for later when we automate the startup. Moving Apache to port 80 will require that you run it as root or via sudo. What it does is change the port numbers in the Listen directive in nf and the invocation of mysqld_safe in /Applications/MAMP/bin/startMysql.sh. The easiest way to accomplish this is to simply use the MAMP GUI program provided in /Applications/MAMP/MAMP.app, click the Preferences button, and visit the Ports tab. Lots of packages that you might install in your PHP environment default to talking to MySQL on port 3306, so doing this once keeps you from having to specifically configure everything else. ![]() This isn’t absolutely required, of course, but it can make housekeeping simpler-and at the very least, your URLs prettier-if you configure Apache and MySQL to use the standard ports (, respectively) rather than the MAMP defaults of 88. I’d recommend installing that even if you don’t plan on needing the source right away it’s a lot easier to ignore the extra files than it is to try to add them in later. For tasks that are more involved than changing confuration files or creating symbolic links, you’ll find it handy to have the source available source+binary packages are at the bottom of the download page. dmg on the MAMP download site is a binary-only setup. We can set it up to be a little more powerful, yet retain its friendliness.īefore you install: The normal. However, the default configuration can be a touch limiting, so a little surgery is in order. by dragging it around between networked machines to replicate it) rather than having to coordinate the components yourself. Much of this simplicity is baked in at compile time so you can deal with the entire stack as you would a regular Mac OS X app bundle (e.g. Each package in the stack is configured such that it’s easy to drop the MAMP directory into /Applications and serve up a database-backed PHP site. MAMP is an easy way to get a basic MAMP (Mac, Apache, MySQL, PHP) environment running. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |