Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: How to test a WordPress website locally?

  1. #1
    Join Date
    Apr 2006
    Beans
    1,896

    How to test a WordPress website locally?

    Hi all,

    I have WP Version 3.5.1 running on Ubuntu 12.04 which is a VM of Oracle VirtualBox. http://localhost can find it working.

    I'm prepared testing a working website on it which is running on Godaddy Server but couldn't figure out how to do it. The aforesaid website can be browsed on Internet with its URL

    Please advise.
    1) Where shall I copy following folders and files to which will be download on Godaddy server?
    Code:
    index.php        wp-blog-header.php    wp-cron.php        wp-mail.php
    license.txt      wp-comments-post.php  wp-includes        wp-settings.php
    readme.html      wp-config.php         wp-links-opml.php  wp-signup.php
    wp-activate.php  wp-config-sample.php  wp-load.php        wp-trackback.php
    wp-admin         wp-content            wp-login.php       xmlrpc.php
    WordPress is installed on;
    /var/www/wordpress/
    ls /var/www/wordpress/
    Code:
    index.php        wp-blog-header.php    wp-cron.php        wp-mail.php
    license.txt      wp-comments-post.php  wp-includes        wp-settings.php
    readme.html      wp-config.php         wp-links-opml.php  wp-signup.php
    wp-activate.php  wp-config-sample.php  wp-load.php        wp-trackback.php
    wp-admin         wp-content            wp-login.php       xmlrpc.php
    2)
    How to test the website? Evoking http://localhost ?

    3)
    What will be the easy way to upgrade Wordpress to the latest version?

    Please advise. TIA

    Rgds
    satimis

  2. #2
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    2,089
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How to test a WordPress website locally?

    My short answers:
    1. Copy them, as long as you use relative links, the folder in which they contain doesn't matter. Be careful that the permissions of files are preserved when you copy. And be sure to check the databases username/passwords on your config.
    2. If http://url_of_server_in_godaddy/ or on your local pc, http//:localhost or if it doesn't work, try adding /wordpress on the end of the URL.
    3. no idea.
    "I learned a lot from repeatedly breaking my system and then reinstalling. Oh, and a lot of GOOGLE searches too!"
    The best Ubuntu derivative: Linux Mint
    Relax. Head to the Community Cafe
    The Philippine Team

  3. #3
    Join Date
    Apr 2006
    Beans
    1,896

    Re: How to test a WordPress website locally?

    Quote Originally Posted by nerdtron View Post
    My short answers:
    1. Copy them, as long as you use relative links, the folder in which they contain doesn't matter. Be careful that the permissions of files are preserved when you copy. And be sure to check the databases username/passwords on your config.
    2. If http://url_of_server_in_godaddy/ or on your local pc, http//:localhost or if it doesn't work, try adding /wordpress on the end of the URL.
    3. no idea.
    Hi,

    Thanks for your advice.

    What I can't resolve is whether create a new folder, say website_name, on my local server under /var/www/wordpress/website_name/ and copy all folders and files from Godaddy server on it? If copy them on /var/www/wordpress/ all existing folders and files will be overwritten.

    I'm prepared performing following test;

    (1)
    Duplicate the website on Godaddy server to local server

    2)
    After testing the duplicate website working, I'll edit the domain setting on Godaddy server, which is registered and hosted there, pointing to the IP address of my local server. I'm subscribing static IP. But I can't run my local server 24x7.

    3)
    After having further tested the duplicate website working without problem I'll map the domain on Godaddy server so that the URL will point to my local server first. If not working it will automatically point to Godaddy server.

    Edit:
    It is quite easy to copy the complete blog of the website on Godaddy with FileZilla to my local server.

    Rgds
    satimis
    Last edited by satimis; December 10th, 2013 at 03:13 PM.

  4. #4
    Join Date
    Nov 2008
    Location
    Storybrooke
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How to test a WordPress website locally?

    Quote Originally Posted by satimis View Post
    Hi,

    Thanks for your advice.

    What I can't resolve is whether create a new folder, say website_name, on my local server under /var/www/wordpress/website_name/ and copy all folders and files from Godaddy server on it? If copy them on /var/www/wordpress/ all existing folders and files will be overwritten.

    I'm prepared performing following test;

    (1)
    Duplicate the website on Godaddy server to local server

    2)
    After testing the duplicate website working, I'll edit the domain setting on Godaddy server, which is registered and hosted there, pointing to the IP address of my local server. I'm subscribing static IP. But I can't run my local server 24x7.

    3)
    After having further tested the duplicate website working without problem I'll map the domain on Godaddy server so that the URL will point to my local server first. If not working it will automatically point to Godaddy server.

    Edit:
    It is quite easy to copy the complete blog of the website on Godaddy with FileZilla to my local server.

    Rgds
    satimis
    3.
    Upload it to a subdirectory so you dont overwrite it (if you want instead, you can just setup virtual hosts, and map the domains to the server in /etc/hosts)
    Check this out http://codex.wordpress.org/Changing_...elocate_method
    Ubuntu Forums Moderation Staff
    Don't waste your energy trying to change opinions ... Do your thing, and don't care if they like it.

  5. #5
    Join Date
    Apr 2006
    Beans
    1,896

    Re: How to test a WordPress website locally?

    Quote Originally Posted by sandyd View Post
    3.
    Upload it to a subdirectory so you dont overwrite it (if you want instead, you can just setup virtual hosts, and map the domains to the server in /etc/hosts)
    Check this out http://codex.wordpress.org/Changing_...elocate_method
    Hi,

    Thanks for your advice.

    Performed following steps:
    1)
    Created a new folder;
    /var/www/domain

    $ sudo chown www-data:www-data /var/www/domain

    2)
    Copied the website to;
    /var/www/domain/

    $ cd /var/www/domain/
    $ sudo chown www-data:www-data * -R
    $ sudo usermod -a -G www-data user

    3)
    edited /etc/hosts

    changed localhost to domain

    4)
    edited /var/www/domain/wp-config.php
    adding following line on it
    Code:
    define('RELOCATE',true);
    5)
    Reboot the VM
    (performing this test on a VM of VirtualBox)

    On browser
    http://domain
    Code:
    IT WORKS
    http://domain/wp-config.php
    Code:
    Error establishing a database connection
    satimis

  6. #6
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    2,089
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: How to test a WordPress website locally?

    Edit your wordpress config for correct database username and password.
    "I learned a lot from repeatedly breaking my system and then reinstalling. Oh, and a lot of GOOGLE searches too!"
    The best Ubuntu derivative: Linux Mint
    Relax. Head to the Community Cafe
    The Philippine Team

  7. #7
    Join Date
    Apr 2006
    Beans
    1,896

    Re: How to test a WordPress website locally?

    Quote Originally Posted by nerdtron View Post
    Edit your wordpress config for correct database username and password.
    On wp-config.php
    Code:
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'domain');
    
    /** MySQL database username */
    define('DB_USER', 'domain_user');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'password');
    
    /** MySQL hostname */
    define('DB_HOST', 'domain.hostedresource.com');
    On installing Wordpress, the database created is for localhost. Whether I have to create a new database for the new domain?

    Thanks

    satimis

  8. #8
    Join Date
    Feb 2008
    Location
    Pelican Bay Correctional
    Beans
    Hidden!

    Re: How to test a WordPress website locally?

    Quote Originally Posted by satimis;12870011
    2)
    How to test the website? Evoking [URL
    http://localhost[/URL] ?
    Code:
    sudo vi /etc/hosts
    ipa.dd.re.ss domain.com
    "poor man's DNS"
    I have 3 brain cells left, and two of them have restraining orders.
    Linux is just "DOS on 'steroids"

  9. #9
    Join Date
    Apr 2006
    Beans
    1,896

    Re: How to test a WordPress website locally?

    Quote Originally Posted by Habitual View Post
    Code:
    sudo vi /etc/hosts
    ipa.dd.re.ss domain.com
    "poor man's DNS"
    Hi,

    Thanks

    I tried your suggestion before without result. I have been searching hard on Internet. There are many similar links but relating to Windows server. The solution is on MySQL. I'll try later.

    satimis

  10. #10
    Join Date
    Feb 2008
    Location
    Pelican Bay Correctional
    Beans
    Hidden!

    Re: How to test a WordPress website locally?

    Quote Originally Posted by satimis View Post
    Hi,

    Thanks

    I tried your suggestion before without result. I have been searching hard on Internet. There are many similar links but relating to Windows server. The solution is on MySQL. I'll try later.

    satimis
    I've used this method for years.
    Define "without result" exactly.
    I have 3 brain cells left, and two of them have restraining orders.
    Linux is just "DOS on 'steroids"

Page 1 of 3 123 LastLast

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
  •