MiniIndy 4 wheeler give-a-way
adding virtual hosts in when using MAMP
I use MAMP Pro for my freelance work and its awesome, it takes care of my virtual hosts for me inside of MAMP. MAMP Pro has a slick interface (not the best, but it works) for adding virtual host and the related document root.
Fast forward 10 minutes, my morning commute time, and I’m at my regular 9to5er job where I’m in charge of programming/building and maintaining our exteral website, philanthropic websites, and bunch sites we use for internal use. So I download MAMP and wait a sec, you mean to tell me that the company that I work for that has more money than me wont spend $60 for me on a tool that makes at least one aspect of my job easier?
Fine then, I’ll get the free version, I don’t mind that much (if anyone wants to donate to a good cause, now would be a good time).
When I’m testing sites though, I like to have a clean URL like golf.localhost, not 127.0.0.1/golf/index.php or localhost/golf/index.php, so anyways, I found that it is fairly simple to use virtual hosts with the free version of MAMP.
So I’m assuming you have MAMP installed and ready to go.
- Make sure you set MAMP to use the default ports 80/3306 (apache/mysql)
- open Terminal.app (I’m on a mac remember?)
- type: sudo cp /etc/hosts /etc/hosts.bak
- type: sudo emac /etc/hosts
- using your keyboard, arrow down to the bottom of the file, or last line of the file
- add: 127.0.0.1 myTestSiteName.localhost
- while holding ctrl, press x then s (saves file)
- while holding ctrl (again), press x then c (closes file)
- stop holding breath for two seconds
one more thing to do…
- open httpd.conf in /Applications/MAMP/conf/apache/ (use your favorite text editor)
- at the very bottom of the file add this:
NameVirtualHost * <VirtualHost *> DocumentRoot "/Applications/MAMP/htdocs/testFolder" ServerName myTestSiteName.localhost </VirtualHost>
- save and close httpd.conf
- restart the MAMP servers (stop then start)
Then when you navigate to myTestSiteName.localhost/ in your web browser you have your test site. Sweet! A little more work if you don’t have MAMP Pro, but in the end it works.
So I’ve just started using SVN (about a week ago) and I’m starting to like it. I’ve used GIT before, but for my current project, a simple website, and only one other collaborator, we figured it would be easy to use svn.
svn is short for Subversion, which is basically a repository for files so others can work on stuff at the same time and you don’t overwrite someone else’s work.
Anyways, svn is really easy to use, but I’ve come across a little problem, my CMS (silverstripe) can create folders for me on the fly when I upload images. Well, who knew that svn doesn’t like that too much. I didn’t. All of a sudden a bunch of ‘~’ started showing up in my project and I couldn’t commit changes to the svn server. After a few seconds of sadness, I to ally with google and figure this out.
My Error was “svn: myFoldername is not a working copy.”
20 minutes later and following other people’s example on how they fixed it, I was no closer to fixing this problem, I was able to find this solution by Ken Arnold on stack overflow. I’m adding it here so I can reference easier next time it happens.
$ mv myPhotos myPhotos_ $ svn cleanup $ svn revert myPhotos Reverted 'myPhotos' $ mv myPhotos_/ myPhotos $ svn add myPhotos
So simple! Thank you Ken, for helping me out on this issue.
Silverstripe Remember me checkbox
For those that use silverstripe, and try to use the checkbox “Remember me next time?”, you’ll notice that it doesn’t work straight out of the box.
Note, I’m using version 2.4.5 and in the last 3 or 4 sites that I’ve built have had this problem.
Even though you have to edit one core file, its a really easy fix, and we can hope its fixed in the next update.
So to fix it go into your sappire/security folder and open up Member.php.
On line 402 change the variable $token to $member->RememberLoginToken
save the file and you now when you log into your account and check that box, it will remember you for 90 days.