MyBB Community Forums

Full Version: Install Local Copy of MyBB Website on WAMP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey all,

I want to install a copy of my website (http://www.ozesports.net.au) on my local copy of wamp. Wamp is installed correctly. I want to install locally so I can test an upgrade to 1.8 and make sure all my theme and everything is in order before I upgrade on my actual web server.

This is what I have done so far:

1. Log into myPhpAdmin on my web server, and exported a copy of my database.
2. Via ftp, copied the entire contents of my public_html/www directory to my computer (this contains all my forum files) into a foler called 'ozesports'.
3. Create database, same name as on my web server (matches /inc/config.php details). Verified contents and everything
4. Create user + password, same as on web server (matches /inc/config.php details).
5. Copied the 'ozesports' folder created in step 2, to C:/wamp/www/

Annnnd I'm stuck now. If I go to http://localhost, under 'Your Projects' there is a folder called ozesports. When I click this I'd imagine it should take me to the forum (Http://localhost/ozesports/index.php) instead I just get a page "This web page is unavailable". If I manually type in Http://localhost/ozesports/index.php I get the error:

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log."

Following are the details in C:/wamp/www/ozesports/inc/config.php:

$config['database']['type'] = 'mysqli';

$config['database']['database'] = '**matches db name**';

$config['database']['table_prefix'] = 'mybb_';



$config['database']['hostname'] = 'localhost';

$config['database']['username'] = '**matches db username**';
$config['database']['password'] = '**matches db password**';

Can anyone help? Big Grin

Thanks!


PS. I have found plenty of instructions regarding installation of a fresh myBB installation on wamp, and have actually done this before (during initial setup of my forum several years ago), however, nothing on migrating from a Web Server back to localhost.
Quote:I want to install a copy of my website (http://www.ozesports.net.au) on my local copy of wamp. Wamp is installed correctly. I want to install locally so I can test an upgrade to 1.8 and make sure all my theme and everything is in order before I upgrade on my actual web server.
Good for you! This is the right way to do things!

Something is going wrong with Apache or PHP. Check the contents of the apache error log (somewhere in C:\wamp\logs) and paste anything that looks like it may be relevant here.
Thanks Josh... Here are the log messages:

php_error.log:
[19-Nov-2015 03:58:46 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.5.12/ext/php_ldap.dll' - The specified module could not be found.

in Unknown on line 0

apache_error.log (only appears when trying to access directly via http://localhost/ozesports/index.php, if I go through the my projects folder in the localhost index, no error):
[Thu Nov 19 16:05:36.770945 2015] [core:alert] [pid 9948:tid 824] [client ::1:59612] C:/wamp/www/ozesports/.htaccess: Invalid command 'RewriteOptions', perhaps misspelled or defined by a module not included in the server configuration

UPDATE: first line of .htaccess is "RewriteOptions inherit"

I put a # infront to comment out, and now get:

[Thu Nov 19 16:07:42.942162 2015] [core:alert] [pid 9948:tid 796] [client ::1:59736] C:/wamp/www/ozesports/.htaccess: Invalid command 'AddOutputFilterByType', perhaps misspelled or defined by a module not included in the server configuration

I played arpound with my .htaccess file a while back (can't remember why) to get something working, so I may have to revisit that..

I removed the .htaccess file and now get an sql error:

MyBB has experienced an internal SQL error and cannot continue.
SQL Error:1045 - Access denied for user '**username***'@'localhost' (using password: YES)Query:[READ] Unable to connect to MySQL server
Please contact the MyBB Group for support.

OK:

So the issue was, when I created the user in PhpMyAdmin, I had host dropdown as Any host and Textbox as %

I deleted the user, recreated, and used Host: Local, text box localhost

Still having issues, cant navigate to any links from my homepage, issues signing into admin console, leaving open as not resolved. Think it has something to do with me removing my .htaccess file, I had some stuff implemented to shorten URLs and make them match thread names etc...

Will continue to document my findings, input is still greatly appreciated

This is my htaccess file:

RewriteOptions inherit
#AuthType Basic  
#AuthName "restricted area"  
#AuthUserFile /home/ozesport/public_html/.htpasswd
#require valid-user

# EXAMPLE .htaccess FOR MYBB WITH GOOGLE SEO URL
# -------------------------------------------------------------------
# This file is identical to MyBB's htaccess.txt example file,
# with rewrite rules for a standard Google SEO install added.
#
# Before using this file please make sure to:
#
#   - replace /MyBB/ with your forum folder, e.g. / or /forum/
#   - replace yoursite/MyBB with your forum URL
#   - name the file '.htaccess' (starting with the dot, no .txt)
#
# Alternatively you can add the required rewrite rules to your
# existing .htaccess, the specific rules required will be displayed
# on the plugin status page once Google SEO URL is enabled.
# -------------------------------------------------------------------

Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
	# Turn off mod_security filtering.
	SecFilterEngine Off

	# The below probably isn't needed, but better safe than sorry.
	SecFilterScanPOST Off
</IfModule>

#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess
#
<IfModule mod_rewrite.c>
	RewriteEngine on

	# Some hosts need a RewriteBase specification.
	RewriteBase /

	# Google SEO workaround for search.php highlights:
	# Make this rule the first rewrite rule in your .htaccess!
	RewriteRule ^([^&]*)&(.*)$ http://www.ozesports.net.au/$1?$2 [L,QSA,R=301]

	# Google SEO Sitemap:
	RewriteRule ^sitemap\-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]
	
	# Google SEO URL Forums:
	RewriteRule ^Forum\-([^./]+)$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]

	# Google SEO URL Threads:
	RewriteRule ^Thread\-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]

	# Google SEO URL Announcements:
	RewriteRule ^Announcement\-([^./]+)$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]

	# Google SEO URL Users:
	RewriteRule ^User\-([^./]+)$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]

	# Google SEO URL Calendars:
	RewriteRule ^Calendar\-([^./]+)$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]

	# Google SEO URL Events:
	RewriteRule ^Event\-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]

	# Google SEO 404:
	ErrorDocument 404 /misc.php?google_seo_error=404
	
	

	# Default MyBB Rewrite Rules:
	RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
	RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]

	RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA]
	RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA]
	RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA]
	RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA]

	RewriteRule ^post-([0-9]+)\.html$ showthread.php?pid=$1 [L,QSA]

	RewriteRule ^announcement-([0-9]+)\.html$ announcements.php?aid=$1 [L,QSA]

	RewriteRule ^user-([0-9]+)\.html$ member.php?action=profile&uid=$1 [L,QSA]

	RewriteRule ^calendar-([0-9]+)\.html$ calendar.php?calendar=$1 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)\.html$ calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]

	RewriteRule ^event-([0-9]+)\.html$ calendar.php?action=event&eid=$1 [L,QSA]

	<IfModule mod_env.c>
		SetEnv SEO_SUPPORT 1
	</IfModule>
</IfModule>

#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
	AddOutputFilterByType DEFLATE application/x-javascript text/css text/html text/xml
</IfModule>
RewriteCond %{HTTP_HOST} ^ozesports\.net\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ozesports\.net\.au$
RewriteRule ^ozesfl$ "http\:\/\/www\.daddyleagues\.com\/ozesfl" [R=301,L]

RewriteCond %{HTTP_HOST} ^ozesports\.net\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ozesports\.net\.au$
RewriteRule ^worldcuptipping$ "http\:\/\/www\.ozesports\.net\.au\/misc\.php\?page\=2014WorldCupTippingResults" [R=301,L]

# BEGIN REQUIRED FOR WEBFONTS

AddType font/ttf .ttf
AddType font/eot .eot
AddType font/otf .otf
AddType font/woff .woff

<FilesMatch "\.(ttf|otf|eot|woff)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
    </IfModule>
</FilesMatch>

# END REQUIRED FOR WEBFONTS

RewriteCond %{HTTP_HOST} ^ozesports\.net\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ozesports\.net\.au$
RewriteRule ^chat$ "http\:\/\/www\.ozesports\.net\.au\/misc\.php\?page\=genchat" [R=301,L]

RewriteCond %{HTTP_HOST} ^ozesports\.net\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ozesports\.net\.au$
RewriteRule ^twitchtv$ "http\:\/\/www\.ozesports\.net\.au\/misc\.php\?page\=twitchtv" [R=301,L]

RewriteCond %{HTTP_HOST} ^ozesports\.net\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ozesports\.net\.au$
RewriteRule ^ozesportscfm$ "http\:\/\/www\.daddyleagues\.com\/ozesportscfm" [R=301,L]

RewriteCond %{HTTP_HOST} ^ozesports\.net\.au$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ozesports\.net\.au$
RewriteRule ^nflpredictionscomp2014$ "http\:\/\/www\.ozesports\.net\.au\/misc\.php\?page\=NFLPredictionsComp2014" [R=301,L]

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?daddyleagues.com/ozesportscfm.*/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?daddyleagues.com/ozesportscfm.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?ozesports.net.au/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?ozesports.net.au$      [NC]
RewriteRule .*\.(gif|jpg|png|jpeg|js|css|ttf|eot|woff)$ http://www.ozesports.net.au/daddyleagues/images/angry2.png [R,NC]

AuthUserFile "/home/ozesport/.htpasswds/public_html/passwd"
AuthType Basic
AuthName "restricted area"  "
require valid-user
I have removed htaccess file again to test... Not sure whats happening with paths... There is an image not showing pointing to /images/twitch_offline.png on index.php

when I visit http://localhost/ozesports/images/twitch_offline.png I can see the image...

(2015-11-19, 05:39 AM)Dr_The_One Wrote: [ -> ]Is there Wamp for following configuration available?

Apache Version 2.2.29
PHP Version 5.4.42
MySQL Version 5.5.45-37.4-log
Architecture x86_64
Operating System linux

Or i have to do modification?

Not sure what you mean??? My Wamp on localhost index shows:
Apache: 2.4.9
PHP Version: 5.5.12
My SQL Version: 5.6.17
Im on Windows 7 64bit


OK so, I modified the cookie setting in inc/settings.php, and then changed the board settings... I deactivated my Google SEO plugin and now I can navigate around my site, however, I cannot login as a user.
Lol I still have no idea what you mean, I think there must be a translation issue...

I have my forum working pretty well now, I can log in as a user etc, except some images arent showing.

Anything in images/oze is working, aswell as ./uploads/avatars/ (but this is defined in settings.php anyway). I think it seems to be images that aren't part of the theme or explicitly defined in settings etc arent appearing Sad

Example, I have a broken image: /images/twitch_offline.png

If I navigate to http://localhost/ozesports/images/twitch_offline.png I can see the image. If i manually modify the code using Chrome developer tools to the full path, it shows (obviously)... Im convinced this is a setting/cookie/cache issue... I tried deleted the contents of /wamp/www/ozesports/cache but this broke everything and I had to  restore it

update: those certain images not appearing because their path has a preceding /  - if I remove this the image shows... Not sure why this happens, the path is the exact same on my live site and works fine. Forum is pretty much working perfect now locally except for this, so maybe not a huge issue, but I'd still like to clear it up... Following are my settings:

/inc/settings.php:
$settings['cookiedomain'] = ".";
$settings['cookiepath'] = "http://localhost/ozesports/";
$settings['cookieprefix'] = "";

Admin Control Panel > Configuration > General Configuration:
Board URL = "http://localhost/ozesports"
Cookie Domain = "."
Cookie Path = "http://localhost/ozesports/"
Cookie Prefix = ""

Any help for the last issue greatly appreciated Big Grin
@applaps - Try following the guidance in http://docs.mybb.com/1.8/faq/login/ to fix the login/admin issues, then you may need to change the board URL and stuff for your local environment. Note that for localhost, cookie domain should be blank.
(2015-11-19, 07:02 AM)Dr_The_One Wrote: [ -> ]when i try to import database it give following error.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1

Oh I see, you aren't helping me, you are hijacking my thread lol... try export your database via phpmyadmin and not via the admin control panel.
Hijack dealt with.
(2015-11-19, 07:08 AM)Josh H. Wrote: [ -> ]@applaps - Try following the guidance in http://docs.mybb.com/1.8/faq/login/ to fix the login/admin issues, then you may need to change the board URL and stuff for your local environment. Note that for localhost, cookie domain should be blank.

Hey, login issues are fixed now, its jus the images one i mentioned in post #7
Does your board URL happen to contain a trailing slash?
Pages: 1 2