Trying to get my domain to point to /localhost/wordpress

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Trying to get my domain to point to /localhost/wordpress

Postby BADDOG » 20. March 2008 22:07

I have about 20 hosting accounts, but they are shared. So the MySQL is slow. I have a domain baddblog.info (a blog site ~duh~) that I want to host on my local computer, using my local database xampp/MySQL.
So what i have is the domain parked on a host server, the nameservers pointed to ns#.zoneedit.com and ns#2.zoneedit.com and a stealth redirect to my localhost IP address. ex.. www.baddblog.info points to IP address 99.252.22.106 apache is running port 80. I found something in another post on here about the httpd file so I set this:
#
Listen 99.252.22.106:80
#Listen 80

changing #Listen 12.34.56.78
Listen 80
to the above.

In theory, this will cause apache to listen on my ip address (doesn't change) on port 80, so when the nameserver directs to 99.252.22.106 I should get the wordpress installation? I cant really tell, because it works on my local computer and I cant see it on others yet.

Also: is there a way to use my local SQL database from a webhosting platform? I have full root access and access to the cgi and ini files on the shared hosting platform.
The evil that men do lives after them,
the evil of BADDOG is legendary
BADDOG
 
Posts: 4
Joined: 20. March 2008 21:26
Location: http://www.gbalkam.com

Postby Wiedmann » 20. March 2008 22:46

I found something in another post on here about the httpd file so I set this:

You must nothing configure in the "httpd.conf". Apache is accessible from all pc's on the internet (if your pc is directly connected to the internet)

Also: is there a way to use my local SQL database from a webhosting platform?

MySQL is accessible from all pc's on the internet (if your pc is directly connected to the internet). Just make a user which have rights to connect from all hosts ("%").
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

MySQL from the internet

Postby BADDOG » 20. March 2008 23:17

What i mean to do is this,
set up a wp_config.php and use my local database MySQL as the
define('DB_HOST', 'username.hostnamemysql.com') host.
would that be something like this?
define('DB_HOST', 'root.12.34.56.78mysql.com') or
define('DB_HOST', 'root.baddblogmysql.com')?

Or am i totally off the mark?
The evil that men do lives after them,
the evil of BADDOG is legendary
BADDOG
 
Posts: 4
Joined: 20. March 2008 21:26
Location: http://www.gbalkam.com

Postby Wiedmann » 20. March 2008 23:47

would that be something like this?
define('DB_HOST', 'root.12.34.56.78mysql.com') or
define('DB_HOST', 'root.baddblogmysql.com')?

"DB_HOST" is a ip adress or dns hostname from a server with a running MySQL service. Thus you must use the internet ip or dns-name from your "local" MySQl database server.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

webserver to localhost MySQL on Apache

Postby BADDOG » 22. March 2008 03:34

So thanks for the help on this matter.
In case someone else needs to know HOW to do this.. here it is

define('DB_HOST', '99.252.22.106:/tmp/mysql.sock''); // 99% chance you

(from a wp_config.php file)

generates this error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in
/home/content/g/b/a/gbalkam/html/wp-config.php on line 6

BUT it is a data base error. Meaning the web script connected to the local data base. I am waiting for a reply from a php newsgroup.

When i get the solution, I'll add it to the post here for others who might be looking to do the same.
The evil that men do lives after them,
the evil of BADDOG is legendary
BADDOG
 
Posts: 4
Joined: 20. March 2008 21:26
Location: http://www.gbalkam.com

Postby Wiedmann » 22. March 2008 04:43

Code: Select all
define('DB_HOST', '99.252.22.106:/tmp/mysql.sock''); // 99% chance you

DB_HOST can't be a ip and a socket. (and a socket is always local, and you want connect to a remote server). Maybe you want use:
Code: Select all
define('DB_HOST', '99.252.22.106');


Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in
/home/content/g/b/a/gbalkam/html/wp-config.php on line 6

That's because you have start the string ['99.252.22.106:/tmp/mysql.sock''] with one ' and end it with a two ''.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

use IP to connect remote to local

Postby BADDOG » 22. March 2008 08:28

Tried that, as you suggested before. It does not work. "Cannot connect to database" error.

http://testgbalkam.ipower.com/baddblog/

wp-config.php =

<?php
/** WordPress's config file **/
/** http://wordpress.org/ **/

// ** MySQL settings ** //
define('DB_NAME', 'junior'); // The name of the database
define('DB_USER', 'root'); // Your MySQL username
define('DB_PASSWORD', 'mysqldatabasepassword'); // ...and password
define('DB_HOST', '99.252.22.106'); // 99% chance you won't need to change this value

// Change the prefix if you want to have multiple blogs in a single database.

$table_prefix = 'wp_'; // example: 'wp_' or 'b2' or 'mylogin_'

// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-includes/languages.
// For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
// to enable German language support.
define ('WPLANG', '');

/* Stop editing */

$server = DB_HOST;
$loginsql = DB_USER;
$passsql = DB_PASSWORD;
$base = DB_NAME;

define('ABSPATH', dirname(__FILE__).'/');

// Get everything else
require_once(ABSPATH.'wp-settings.php');
?>

Could this be a permissions issue on localhost mysql and how (where) do I change that?
the script is now here. I changed to another hosting platform.
http://testgbalkam.ipower.com/baddblog/

I am 2 things.
define('DB_HOST', '99.252.22.106:/tmp/mysql.sock');
and
define('DB_HOST', '99.252.22.106');
both seem to give the same error. I am beginning to feel like an id10t.
The evil that men do lives after them,
the evil of BADDOG is legendary
BADDOG
 
Posts: 4
Joined: 20. March 2008 21:26
Location: http://www.gbalkam.com

Postby Wiedmann » 22. March 2008 14:24

Tried that, as you suggested before. It does not work. "Cannot connect to database" error.

I see another error message:
"Error establishing a database connection"

Does WP not have a debug mode? Because this is a WP error message, and not the real error message from PHP. IMHO the real error is:
"ERROR 1130 (00000): Host 'example-com' is not allowed to connect to this MySQL server"

Could this be a permissions issue on localhost mysql and how (where) do I change that?

You remember:
Wiedmann wrote:Just make a user which have rights to connect from all hosts ("%").

In phpMyAdmin --> "Privileges"
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: JJ_Tagy and 35 guests