Mamp pro gives blank page after Migration

Discussion in 'Web Design and Development' started by sweet160, Aug 15, 2008.

  1. sweet160 macrumors regular

    sweet160

    Joined:
    Oct 2, 2006
    Location:
    Ecuador
    #1
    Hey,

    I have a problem.

    Yesterday I migrated from my old iMac to a new Macbook, using Apples Migration tool.

    All went well. Everthing works all the applications work.

    Only I couldnt get my webpages to show in my browser using Mamp Pro.

    I got a message during startup that I could'nt use two identical names for my computers on my network. So it changed the name automaticly.

    On the new comp my webpages showed blank using Mamp Pro, on the old one everthing worked as normal.

    But I had to fiddle with the name of the old computer. So now I have blank pages on both computers.

    Its probably something simple but how do I get my browser to show http://localhost:8888/ again like it used to do?
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    You're actually accessing 127.0.0.1 for the "localhost" domain.

    If I am following the problem correctly, you resolved the public domain name for each machine but you actually develop using a MAMP sandbox. If so:

    Make sure Apache is set to listen to the correct IP and port, i.e.

    Listen 127.0.0.1:8888

    And make sure if you setup any virtual hosts in Apache they also include the port, i.e.

    NameVirtualHost *:8888

    <VirtualHost *:8888>
    ...your stuff here...
    </VirtualHost>

    Restart Apache (through MAMP)

    That's all that's necessary for the URL you gave to work, aside from any firewall blocking you didn't mention.

    Hope this helps

    -jim
     
  3. sweet160 thread starter macrumors regular

    sweet160

    Joined:
    Oct 2, 2006
    Location:
    Ecuador
    #3
    Hey thanks for the help!

    I am not firewallblocking that port so thats not it.

    I changed my localhost name so now my pages show blank, but my Mamp pro is working properly.

    You know I am a newb so what exactly do you mean with Setting up Apache to listen to the correct IP and port? How do I do that?

    When i go to my browser and enter the 127.0.0.1:8888 I get the same as localhost:8888

    Thanks for helping me...

     
  4. sweet160 thread starter macrumors regular

    sweet160

    Joined:
    Oct 2, 2006
    Location:
    Ecuador
    #4
    hey sir webdesigner, I found the problem
    it was just my template of my joomla page that was not loading

    thanks for the help!
     
  5. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #5
    Glad you figured it out.

    I responded with web server configuration since you mentioned domains and hostnames, and usually MAMP Pro does that for ya but during migrations things often go askew with the server setup. In your case MAMP Pro did fine, but if you're interesting in learning about Apache, listen directives and virtual host setup (so you can run multiple domains, some real, some fake for sandbox development) the visit http://httpd.apache.org/docs/1.3/misc/tutorials.html

    If you're not into that stuff, don't worry and nevermind!

    -jim
     
  6. sweet160 thread starter macrumors regular

    sweet160

    Joined:
    Oct 2, 2006
    Location:
    Ecuador
    #6
    Actually thats very good!

    Because I would like to learn how I can setup my system so I can work on different sites at the same time. Because now I am always switching my htdocs folder. Which is harder and maybe a little dangerous....

    Anyway thanks again, and maybe I will have more questions about the subject...!

    Jo
     
  7. sweet160 thread starter macrumors regular

    sweet160

    Joined:
    Oct 2, 2006
    Location:
    Ecuador
    #8
    scripting

    Hi Sr, webdevelpr?

    Can I ask you something about scripting, I am making a form and I have a question about that.

    Thanks,
    Jo
     
  8. sweet160 thread starter macrumors regular

    sweet160

    Joined:
    Oct 2, 2006
    Location:
    Ecuador
    #10
    Hi,

    I made a webpage in Joomla and Installed a module where some scripting is needed. So I am in trouble :rolleyes:

    http://www.mooncities.com/elhape3/component/option,com_facileforms/Itemid,115/

    Here is the example of my question, on the bottom of the form if you click "vriendelijke groeten kaarten"
    the text "aantal exemplaren and the input field to the left should appear.

    I already can make the selectlist dissapear and appear but....

    Now I would like to have the additional static html text field "aantal exemplaren" and input field (to the right)
    also to hide and show with the state of that same checkbox.

    Code:
    function ff_ass_groeten_init(element, condition)
    {ff_getElementByName('ass_groetenkl').style.visibility = "hidden";//for the box
    }
    
    {
        switch (condition) {
            case 'formentry':
                break;
            default:;
        } // switch
    } // ff_ass_groeten_init
    
    this was to make the Selectlist Hidden initially
    how can I make a textfield and input field hidden as well in this code?

    then

    Code:
    function ff_ass_groeten_action(element, action)
    {   sl=ff_getElementByName('ass_groetenkl'); 
       if (element.checked)
       {
          sl.style.visibility="visible";
       }
       else
       {
          sl.style.visibility="hidden";
       }} // ff_ass_groeten_action
    to show the selectlist I have this code....

    How can I make the additional static text field
    and input field to be shown as well in this code?

    after that it would be great to have this shown selectlist and input field validated but only in case their visisbility is visible.


    Does my question make any sense to you ??

    Thanks for the help,
    and thanks for bearing with me !
    Jo


    [/quote]
     
  9. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #11
    Just wrap a DIV with an ID assigned to it around all of the form elements you want to hide/display associated with that checkbox, then hide/display that entire DIV based on checkbox "checked" status.

    For example (untested):

    Code:
    function ProcessCheckBox(divid,checked) {
    
      if (checked)
         document.GetElementByID(divid).style.visibility="visible";
     else 
        document.GetElementByID(divid).style.visibility="hidden";
    
    }
    HTML:

    HTML:
    <div id="form_block">
      <input type="checkbox" name="mycheckbox" value="1" onClick="return ProcessCheckBox("form_block",this.checked);"> Yes
      ...other input fields related to this checkbox...
    </div>
    In your validation script, which I assume is another function since you didn't include it above, add in a condition as follows:

    Code:
    if (document.GetElementByID('mycheckbox').checked) {
    
     ... validation code for input fields displayed when checkbox is checked ...
    
    }
    -jim
     
  10. sweet160 thread starter macrumors regular

    sweet160

    Joined:
    Oct 2, 2006
    Location:
    Ecuador
    #12
    This looks good.

    I will try it when I have some time. Hopefully tomorrow! Thanks for helping me, I will let you know how this turns out!

    thanks Man!

     
  11. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #13
    I forgot to mention, maybe it's best to put the input type field for your checkbox outside the div so it doesn't disappear when checked. That way it will be visible all the time to users and reference is possible your code without having to test if the object exists. I wrote that fast!

    -jim
     
  12. Daringescape macrumors regular

    Joined:
    May 7, 2003
    Location:
    CA
    #14
    Just a bit of helpful advice - you can have as many folders in your htdocs as you would like, and they can all contain different sites - your url will look like this: http://localhost:8888/website1 Just replace website1 with whatever the folder name is that you want to use. That way you can work on several different sites without changing your htdocs folder. I have about 12 sites I am working on locally right now.
     
  13. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #15
    That's a nice way of setting up multiple sandboxes, certainly easier.

    The only issue with that method is that's not the true document root in the production version. I'm not referring to the simple uploading of files from ./websiteX into the web server's actual document root, I'm referring to paths being different. There might be issues with abolute paths needing to be changed due to the mismatch between the sandbox and production document root.

    Here is another approach commonly used, a more complex setup of course, but also why to try it:

    For sandbox setup of multiple domains edit /private/etc/hosts file and add in fake domains and exploit the localhost class C, i.e. 127.0.0.2 associated with fakedomain1.com, 127.0.0.3 for fakedomain2.com, etc., then setup Apache as discussed earlier so each domain has its own virtual host and document root path, just like in a production environment.

    i.e. http://www.fakedomain1.com:8888 and http://www.fakedomain2.com:8888 will both work in your Mac's browser. The key is the different IP's, multiple domain names and unique absolute document roots that will match the production setup. No need to register domain names for sandboxes, these resolve locally.

    -jim
     
  14. sweet160 thread starter macrumors regular

    sweet160

    Joined:
    Oct 2, 2006
    Location:
    Ecuador
    #16
    Hey this looked really promising. But It give a blank page.
    I Copied a complete joomla website in my htdocs folder in a website1 folder, then went to http://localhost:8888/website1 but it didnt work.

    Do I have to change something to Mamp pro to make this work?
     
  15. sweet160 thread starter macrumors regular

    sweet160

    Joined:
    Oct 2, 2006
    Location:
    Ecuador
    #17
    Hi Sr Webdeveloper,

    Do you mean that you links to images ect. might get broken if you upload to a server when using this method?
     
  16. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #18
    Not the simple act of uploading, I focused on absolute paths being used in the scenario being discussed here (multiple sites in multiple folders off the document root for sandboxes).

    For example ("Webhost" refers to the actual LIVE web site the public uses, one unique domain name per site):

    Mac sandbox site 1 path: /usr/yourname/public_html/testsite1/
    Mac sandbox site 2 path: /usr/yourname/public_html/testsite2/
    Webhost path (site 1 or 2): /usr/yourname/public_html/

    Here's what you'd set the the src attribute in the image tag to if using absolute paths to display an image on any of the site, for example:

    Mac sandbox site 1: /testsite1/images/whatever.gif
    Mac sandbox site 2: /testsite2/images/whatever.gif
    Wehbost (site 1 or 2): /images/whatever.gif

    Which is why its suggested to use relative paths whenever possible.

    I have to mention that many included libraries, frameworks, config files, XML files, upload and download paths that exist below the document root level are often accessed using the absolute path method especially on sites with alot of scripting involved. If so, you might have to change the paths one way or another which was my stated concern. I didn't say this was a major issue affecting all sites.

    -jim
     

Share This Page