: How to Change the www root directory on WampServer How can i change the root directory of the currently installed wampserver to some other directory.
How can i change the root directory of the currently installed wampserver to some other directory.
More posts by @Kaufman445
8 Comments
Sorted by latest first Latest Oldest Best
If the only thing that joesk needs is to have its www directory on another disk, you just have to create a virtual host using localhost/add_vhost.php?lang=english
And there is some more to do (WAMP version 3.0.6, 64bit) to avoid some other error-messages do following changes to the wamp/scripts/config.inc.php:
Change all relative-paths to absolute-paths, like
"../"-entries to eg. "c:/wamp64/"
from
$configurationFile = '../wampmanager.conf'
to
$configurationFile = 'c:/wamp64/wampmanager.conf';
If 'c:/wamp64/' is your install-dir. Helped me a lot. Somewhere devs did a mess there ..
Click on Green Wamp Icon (Taskbar right Notification Icons) > Apache > httpd.conf > Replace all ${INSTALL_DIR}/www with your directory. Take care to use / instead of
Click on Green Wamp Icon > Apache > httpd-vhosts.conf > Replace again the existing "www"-Directory with yours
Click on Green Wamp Icon > "Restart All Services"
(Tested on Windows 10, Wampserver 3.0.6 64 Bit)
I tried doing this, but found that it got overwritten upon wamp restart. You can fix it for good by editing the $wwwDir variable in wamp/scripts/config.inc.php
For wamp 2.5 on Windows, use a text editor, e.g. notepad++ to edit c:wampbinapacheapache2.4.9confhttpd.conf
Change DocumentRoot "c:/wamp/www" to DocumentRoot "c:/my/new/path" (Note slash direction). This will change the location where files are served from (~Line 230).
Change <Directory "c:/wamp/www"> to <Directory "c:/my/new/path"> (Note slash direction). This applies permissions from the old directory to the new one (~Line 252).
Copy all content from c:wampwww to your new directory (c:mynewpath), including index.php
Edit c:mynewpathindex.php and change line 40 $server_dir = "../"; to $server_dir = "C:/wamp/"; This changes the location where config files etc. for wamp are read from. Change $suppress_localhost = false; to correct projects links (~Line 30).
After doing the above, you can also change the:
in the of wamp directory (wampmanager.ini, wampmanager.conf).
php.ini
my.ini
Save your changes and close Wampserver.
I found these simple steps helping,
Click on WampServer icon in taskbar
Select Apache > httpd.conf from the pullup
Search for the term “DocumentRoot”
Change the DocumentRoot path to your custom directory
Search for your DocumentRoot path
again same procedure
Save your changes and “Restart All Services”
Edit the httpd.conf file and/or the vhosts.conf file for the site wish to change. The Directory directive will let you specify where the files for this site are to be located.
For more info on httpd.conf see: httpd.apache.org/docs/2.2/configuring.html
And specifically: httpd.apache.org/docs/2.2/mod/core.html#directory
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.