MAMP Virtual Hosting Primer Tutorial

MAMP Virtual Hosting Primer Tutorial

MAMP Virtual Hosting Primer Tutorial

Yesterday we talked about a Linux idea for backup on a MacBook Pro laptop with our Linux Backup via rsync Primer Tutorial as shown below.

Today we are going to talk about virtual hosting on a MAMP Apache local web hosting arrangement.

These two ideas are linked. Go figure …

Did you come up with 42? Never mind ….

The work from yesterday with the Linux rsync command opens the door to a new separated disk/device “area” of use on a MacBook Pro using a Mac OS X operating system. We should not waste this opportunity to now, perhaps, be offering you some new ideas, purrrrhaps, regarding Virtual Hosting with Apache, a fairly big subject we try to encapsulate in a single image we’d like you to examine on a practical viewpoint for how to ease your way into Virtual Hosting, which is an area of knowledge you should follow up more, meowhaps, with pointers from today’s work … which is …

  1. change Apache’s httpd.conf configuration file to add new configuration data, if never put in beforehand, for Virtual Hosting … our example being the addition of …

    NameVirtualHost *
    <VirtualHost *>
    DocumentRoot "/Applications/MAMP/htdocs"
    ServerName localhost
    </VirtualHost>

    <VirtualHost *>
    DocumentRoot "/Volumes/Laura/MAMP/htdocs"
    ServerName seagate.backup
    Alias /seagate.backup "/Volumes/Laura/MAMP/htdocs"
    <Directory "/Volumes/Laura/MAMP/htdocs">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>

    … the ideas for which we got great help from this WordPress forum link … thanks heaps
  2. change hosts file in /private/etc to have the new “seagate.backup” domain be recognized by adding the record …

    127.0.0.1 seagate.backup

    … at the end of the hosts file
  3. rebooted (or restarted) the MacBook Pro (to flush the DNS)
  4. started up MAMP local Apache web server again
  5. in Firefox (web browser) typed in address bar URL of …
    HTTP://seagate.backup:8888/word_association.php
    … which is the execution of some PHP (associated with Language Word Association Game Tutorial) that would not have worked as of yesterday (and which we did try, unsuccessfully, yesterday … but did, try, with success, today)
  6. in Safari (web browser) typed in address bar URL of …
    HTTP://localhost:8888/word_association.php
    … which is the execution of some PHP to sanity check that what we have done has not harmed anything pre-existing … and so it came to pass

The Virtual Hosting has meant that the one MAMP install can be configured to have several DocumentRoot definitions as per, for our local MacBook Pro setup here, two of which are …

DocumentRoot URL DocumentRoot Path
HTTP://localhost:8888/ /Applications/MAMP/htdocs/
HTTP://seagate.backup:8888/ /Volumes/Laura/MAMP/htdocs/

… with that last one being a backup of the first, created on a Seagate Backup Plus Portable Drive.

If this whole big topic of web servers interests you, you might also want to have a read of our Cassini++ WebServer Primer Tutorial.


Previous relevant Linux Backup via rsync Primer Tutorial is shown below.

Linux Backup via rsync Primer Tutorial

Linux Backup via rsync Primer Tutorial

On a Macbook Pro laptop you can use the Mac OS X Time Machine approach to backing up your data, as we talked about with Mac Backup Tutorial. However, a Mac OS X laptop has access to an underlying Linux operating system, that has had great software, including backup software, written for it over many years.

What would be the advantages of using a Linux method of backing up on a Macbook Pro laptop? Can think of …

  • Linux processes are not in your face … while you get on with other things in the usual GUI environment
  • able to be run at a time of your choosing (via shell scripting with crontab, or at login via a .profile arrangement, perhaps), even interactively … though Time Machine can do some of this too
  • the backup can run in the background … though Time Machine can do this too
  • the backup process could easily leave you a log
  • Linux backups are capable of handling remote backup tasks and scenarios

Today’s slideshow presentation starts off with a photo of our …

  1. … Seagate Backup Plus Portable Drive โ„น hooked up to our Macbook Pro via a black USB lead plugged into one of the Macbook Pro USB ports
  2. we start up the Macbook Pro application called Terminal in the Utilities folder of the Applications folder
  3. the Linux command

    df -k

    will show you the disks and removables (of which our Seagate Backup Plus is one), the latter of which normally get a name starting with “/Volumes/” as for our “/Volumes/Laura”

  4. we are going, today, to backup the local MAMP server to the Seagate Backup Plus via

    rsync -r /Applications/MAMP /Volumes/Laura/

    as you can see with โ„น (and on)

  5. now to indicate some success with this to you, we turn the Firefox web browser to Open File one of the backup HTML files (because it is a step too far to think you will be able to run PHP from the backup disk … perhaps tomorrow) … maybe you remember india_map.html from the series of blog postings ending with PHP Geographical Image Map Yet More Google Charts Tutorial ? … you can see with โ„น
  6. okay, that works, and so now, what about if india_map.html changes back at the Macbook Pro hard disk’s MAMP’s htdocs folder … we make a change to the <h1>India</h1> heading to <h1>India Map</h1>
  7. so now we are going to incrementally backup the local MAMP server to the Seagate Backup Plus via

    rsync -ruv /Applications/MAMP/ /Volumes/Laura/MAMP/

    as you can see with โ„น

  8. now to indicate some success with this to you, we turn the Firefox web browser to Open File that same india_map.html HTML file … as you can see with โ„น

Of course, as with all Linux a

man rsync

command โ„นโ„น helps explain things further, and we hope this tutorial and Linux.com’s useful link is of some help for you too.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Operating System, Tutorials and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

26 Responses to MAMP Virtual Hosting Primer Tutorial

  1. deliver says:

    yes, analysis is having to pay off. So content to have identified this publish.. Adoring the page.. all the best My personal web surfing seem complete.. thanks.

  2. What your saying is completely proper. I know that all individuals must say the incredibly exact similar issue, but I just presume that you put it in a way that everyone can totally grasp. I also really like the photographs you position within the adhering to. They match so nicely with what youre attempting to say. Im guaranteed youll accomplish so pretty a couple of males and females with what youve acquired to say.

  3. You might be my inspiration , I possess few internet logs and sometimes run out from to post : (.

  4. The video card (often referred to as the GPU) is 1 much more significant element in any gaming rig, as it handles just about all of the graphics for your online games. A person with the difficulties with movie cards – particularly the middle and low conclusion ones – is that they tend to turn out to be obsolete quicker than the other elements of a gaming computer system. Usually, acquiring a substantial stop video card when you are upgrading or constructing your gaming rig is vital as it gives you breathing region in advance of it really is time to upgrade once a lot more.

  5. laptop says:

    I thought it was heading to become some dull previous publish, nevertheless it truly compensated for my time. Iรขโ‚ฌโ„ขll publish a hyperlink to this internet page on my weblog. I’m positive my visitors will uncover that extremely valuable.

  6. pursue says:

    My searches seem full.. thanks. Supporting the document.. gives thanks of course, research is paying off. certainly, research is paying off.

  7. Thank you for producing my individual students have access for your site post. Your kindness will likely be drastically appreciated. Iโ€™ve got some ongoing projects and I wanted all these students help me with it. The only way they could do that was carry out some exploration online so as to help make my perform quicker. They came across your website along with the content on it, specially this blog post, seriously assisted them to come to very good conclusions on issues we required to carry out. Not surprisingly, I will continue to pay a visit to the site for new updates on this key and other challenges helpful.

  8. Bonjour ! LOL ! J’aime bien comme site

  9. I would like to thank you for the efforts you’ve put in writing this website. I’m hoping the same high-grade website post from you in the upcoming as well. In fact your creative writing skills has encouraged me to get my own web site now. Really the blogging is spreading its wings quickly. Your write up is a great example of it.

  10. spam scam says:

    Wonderful beat ! I wish to apprentice whilst you amend your site, how can i subscribe for a blog site? The account aided me a appropriate deal. I have been tiny bit familiar of this your broadcast offered bright clear concept|

  11. Definitely, what a fantastic site and educative posts, I surely will bookmark your site.All the Best!

  12. Dr. Grossman says:

    hello!,I really like your writing so a whole lot! percentage we keep up a correspondence extra about your write-up on AOL? I demand an expert on this region to unravel my dilemma. Maybe that’s you! Taking a appear ahead to appear you.

  13. I’m entirely concur with your claim or the things that you have actually discussed below in this site.

  14. buy online says:

    Useful information. Fortunate me I found your website accidentally, and I am stunned why this accident did not took place earlier! I bookmarked it.

  15. handyman says:

    Well I truly liked studying it. This article procured by you is very useful for accurate planning.

  16. credit union says:

    Thanks for sharing superb informations. Your site is so cool. I’m impressed by the details that you have on this web site. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for extra articles. You, my pal, ROCK! I found just the information I already searched everywhere and simply couldn’t come across. What an ideal website.

  17. sincerity says:

    Supporting the posting.. thanks a lot Isn’t it fantastic once you come across a great publish? My internet browsings seem complete.. thank you. So pleased to have located this submit..

  18. As a Newbie, I am continuously exploring online for articles that can benefit me. Thank you

  19. Siti says:

    I believe that a simple and unassuming manner of life is greatest for everyone, very best both for the body and the mind.

  20. Of course, what a great blog and enlightening posts, I definitely will bookmark your blog.Best Regards!

  21. naturally like your web-site however you have to take a look at the spelling on quite a few of your posts. Many of them are rife with spelling issues and I in finding it very troublesome to tell the reality however Iยกยฆll surely come back again.

  22. over here says:

    I simply want to mention I’m newbie to blogging and actually liked this page. Probably Iโ€™m want to bookmark your website . You amazingly have excellent writings. Bless you for sharing with us your web site.

  23. I gotta bookmark this website it seems extremely helpful very helpful

  24. Hello very cool blog!! Guy .. Beautiful .. Wonderful .. I’ll bookmark your web site and take the feeds alsoยกKI am happy to search out numerous useful info right here within the put up, we’d like develop extra techniques on this regard, thanks for sharing. . . . . .

  25. Wonderful site. Lots of helpful information here. I am sending it to some buddies ans additionally sharing in delicious. And of course, thanks for your effort!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>