wamp db in external HD
Posted by: ryanxcom (---.com)
Date: June 25, 2012 01:40PM

Hi,

I'm just wondering if its possible to link the database (from external device) to the locally installed WAMP?

WAMP installed on local drive and all the web pages including database in external drive.

Using virtual host can redirect the landing page to the designated location (ie: external drive) but how about the database?

Is this possible?

I'm asking this because i would like to carry my DB along with me.
What i need
1) website still accessible via LAN when the external drive is connected to the PC.
2) database is stored in the device
3) web pages are stored in the device
4) WAMP is installed locally on the PC.

Currently my website is accessible over LAN from any PC using local IP. All the files and db are stored in my pc. If i Move the files and db to the external device, can i still access the website and db via the same IP if my device is connected to my PC?

Please advice.

Hope i did not confuse you guys.

Options: ReplyQuote
Re: wamp db in external HD
Posted by: RiggsFolly (---.as13285.net)
Date: June 25, 2012 10:26PM

Have a look in your mysql.ini

find this line inside the [wampmysqld] section:

datadir=C:/wamp/bin/mysql/mysql5.5.8/data (version of mysql may differ )

Change that to point to a folder on your external drive and move your existing data folder contents to the folder on the external drive.

that should do it

Options: ReplyQuote
Re: wamp db in external HD
Posted by: ryanxcom (---.com)
Date: June 26, 2012 03:03AM

Thanks RiggsFolly.

Will try that out and post the result.

Options: ReplyQuote
Re: wamp db in external HD
Posted by: ryanxcom (---.com)
Date: July 20, 2012 10:47AM

IT WORKS!!!!! thanks RiggsFolly.

I did some tweaks myself too. I was able to accomplish all the 4 above.

For those who also Googled for a solution this is what I did and it works for multiple website together with Database in external device and accessible via LAN.

1) Copy your files into your external device (i.e G:/mydevice/folder/website-name)
2) Change "Listen localhost:80" to "Listen *:80" in httpd.conf
3) change "ServerName localhost:80" to "ServerName *:80" in httpd.conf
4) under the <directory> tag
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from 111.111 #ip address range
Satisfy all
</Directory>

5) Create a virtual host (within the httpd.conf file at the bottom)

NameVirtualHost *:80

<VirtualHost *:80>
ServerName website-name
ServerAlias website-name *.website-name
DocumentRoot "G:/mydevice/folder/website-name"

<directory "G:/mydevice/folder/website-name">

Options Indexes FollowSymLinks

AllowOverride all

Order Allow,Deny

Allow from all


</directory>
</VirtualHost>

6) In wamp\bin\mysql\mysql-version folder edit file my.ini (as per RiggsFolly's reply above)
look for datadir=.... and change it to datadir=G:/mydevice/folder/website-name

7) Put in your website-name in windows host file
click start>run > edit c:\windows\system32\drivers\etc\hosts
ADD NEW LINE
127.0.0.1 website-name

as for me i have a copy of httpd.conf and my.ini in my device to so any new PC i install WAMP i'll just need to copy this two files into respective folders

Options: ReplyQuote


Sorry, only registered users may post in this forum.