SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Jun 2012
    Location
    Bangladesh
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy I've Great Problem With my Localhost Server Configuration Please Help Me.

    Hi EveryOne
    Please Anyone help me.
    I have a web site based on wordpress software (http://my-complain.com). Now I have downloaded my SQL database and configure with my localhost server (Offline). I can open my siteís home page on my localhost server. But Iíve a problem when I click the any post or try to login or other links then it redirect me to online site (http://my-complain.com). Now how can I operate my site with my localhost server (Offline)? I mean I want to view my all post with localhost server. Is it possible? If anyone help me this is great pleasure to me. Please help me. Please............

  2. #2
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    6 Thread(s)
    Hi,


    You need to set a local host file:


    Windows:


    Edit c:\windows\system32\drivers\etc\hosts file: like
    Code:
    127.0.0.1      my-complain.com
    This means that when you browse to my-complain.com you will route to the machine where the local host file is set. If you need to route to a different machine on your internal network then an example is:
    Code:
    172.16.2.34      my-complain.com

    On Windows 7 and Vista you may need to be administrator to do this.


    Macintosh:


    Set a local host file in Mac OS X

    Linux:

    Edit the /etc/hosts file:

    Code:
    127.0.0.1      my-complain.com
    Regards,
    Steve

  3. #3
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,650
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)

    Exclamation

    WAIT! DON'T DO THAT!

    With deference to Steve, that will disable your viewing your online website which, IMHO, is a horrid thing to do!

    The way I've setup my test server is to remove the domain extension (.tld) OR merely use my own acronym for my online domains. Yes, update the hosts file (using 127.0.0.1) and your httpd-vhosts.conf with the extensionless domain name or acronym.

    THEN you will have to alter your test server's WP configuration file (by removing the .tld or replacing with the acronym). After that, you'll be set to duplicate and properly test on your own server.

    FWIW, Steve's comment about Win7/Vista is golden but doesn't go far enough. I've installed my PHP and Apache on a drive partition to keep as far away from WinDoze's "protection" so that I can actually test my files on my test server and recommend that (with the obvious exception of the the WinDoze hosts file which requires Admin access to save any changes you make there).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  4. #4
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by dklynn View Post
    WAIT! DON'T DO THAT!

    With deference to Steve, that will disable your viewing your online website which, IMHO, is a horrid thing to do!

    The way I've setup my test server is to remove the domain extension (.tld) OR merely use my own acronym for my online domains. Yes, update the hosts file (using 127.0.0.1) and your httpd-vhosts.conf with the extensionless domain name or acronym.
    Its been a long time since I've done this as I run an Internal DNS and forwarder so your suggestion of using a host alias ie. my-complain minus the .com and the same correction in the virtual host and WP is a good solution. Thanks DK
    ictus==""

  5. #5
    SitePoint Member
    Join Date
    Jun 2012
    Location
    Bangladesh
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all of you. But Which suggestion right for me. Please. I am using Win Vista. I need right suggestion. Please.

  6. #6
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    6 Thread(s)
    Hi ronisdj,

    DK is suggesting and I agree that setting a local host is the right idea, so here is what to do:

    1. set your windows host file here - c:\windows\system32\drivers\etc\hosts to
      Code:
      127.0.0.1 my-complain
      do not use .com, simply use my-complain
    2. open your httpd-vhosts.conf file (if using XAMP this will be found inside the XAMP directory); or wherever you installed Apache, and add a virtual host using my-complain as an extension-less domain
    3. in Wordpress edit the configuration to use the extension-less name.
    4. restart apache


    DK also recommended that you don't have your Apache environment running with your OS drive and instead install and run it from a separate drive. If your Apache was installed using the default install then your Apache will be inside your OS drive, so don't bother changing it now.

    Steve
    ictus==""

  7. #7
    SitePoint Member
    Join Date
    Jun 2012
    Location
    Bangladesh
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear ServerStorm Sir
    I can't configure httpd-vhosts.conf file. Please tell me details. How can I do this. Please. Please.

  8. #8
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by ronisdj View Post
    Dear ServerStorm Sir
    I can't configure httpd-vhosts.conf file. Please tell me details. How can I do this. Please. Please.
    Why can't you configure this file. Do you not know where to find it or don't know what to put into the vhosts file?

    take a look at this Creating virtual hosts on Apache 2.2 article that gives a pretty good walk-through of the entire process.

    Steve
    ictus==""

  9. #9
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,650
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Steve,

    He can't edit the httpd.conf without opening his editor with Run As Administrator BECAUSE he's installed it in Program Files (ergo, my admonition to install it elsewhere). Being stuck with his installation, he can use a good text editor (by definition, that excludes NotePad) by right clicking it's icon and selecting Run As Administrator. Then, from the editor's menu, Open httpd.conf, httpd-vhosts.conf and/or hosts in their directories (c:\Program Files\Apache Foundation\Apache 2.2\conf(\extras for the vhosts file) or the file location you specified above for hosts. DON'T FORGET TO SAVE the file after editing! For me, the PITA that WinDoze is forcing with its "protected directories" is enough reason to uninstall and reinstall in a different drive partition - but, as a professional webmaster, I edit frequently.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •