Customize the root directory of wamp_server - Mrxn's Blog
«

Customize the site root directory of wamp_server

admin Published on Reading: 14115 Technical Articles


0x0

Mrxn reminder ,DIY Risk , Please back up the data ! Before you modify a file , Please copy a backup first , It's always good !

0x1

First, you need to know the root directory path of the website you want to set , I won't describe this , Don't know , Then there is no need to look down .

0X2

On the basis of the first step , How can we let the server find the root directory of the website we set ? Please follow me :

We know ,PHP The file is Apache Executed , Then we need to modify Apache Configuration file for httpd.conf As shown in the figure one As shown in :

 3.png



open httpd.conf after ,Ctrl + F search : DocumentRoot Find the line with the drive letter to install the road reinforcement , For example, mine is : c:/wamp/www/ It mainly depends on your installation wamp_server Installation path when , 1.png ; hold c:/wamp/www/ Change to the path where you place the website program , The blogger has changed to f:/web

Then you can see about a few lines down : <Directory "c:/wamp/www/" Also change Lujin to the path where you place the website program ,

Ctrl + S preservation , Then close , sign out . Here ,Apache Setting is complete . But the overall settings have not been completed , Please look down ;

0x3

Restart wamp_server ( After the configuration file is repaired, it is better to restart the server , In case of ineffectiveness ), method : click wamp_server Icon , choice < Restart all services >

After restart , Check whether the configuration is effective , method : Create a new one in the website program folder PHP file , Write <? php echo”success !”;?> And named test.php.

Open Browser , Enter in the address bar : http://localhost/test.php After Enter is opened , notice php Executed , Return to the effect shown in Figure 2 , Is successful :


 2.png


0x4

After setting these , You can start to stack bricks ^_^ !

But I'm a bit of a perfectionist - _- !

As shown in Figure 3 ,www catalog It should be click to enter the directory we set , But now after clicking , Enter the directory that the system started to set !

 3.png



ok , Let's begin to modify it !

get into wamp_server default directory : c:/wamp Find two files in the red box as shown in Figure 4 : wampmanager.ini & wampmanager.tpl

 4.png



open wampmanager.ini   Ctrl + F search menu.left   Find Figure 5 (Please click to view the large picture) Shown with ”www catalog Content section of words


 5.png


“www catalog See Figure 3 www catalog We can change it to the name of the website root directory set by ourselves , for example “Web catalog ”( Without quotation marks )

Put the back c:/wamp/www Modify it to the directory where we place website programs , For example, the blogger's : f:/Web After modification ,Ctrl + S preservation ,

Then open wampmanager.tpl   Ctrl + F search menu.left Find the area shown in Figure 6 (please click to view the larger picture) :

 6.png



take "${w_wwwDirectory}" Modify to "Web catalog " , "${wwwDir}" Modify to "f:/Web"   Then restart it wamp_server The server ; You can see the effect , We click www Directory to enter the set website root directory . As shown in Figure 7 :

 7.png



Please leave me a message if you don't understand , Blog message board : https://mrxn.net

Here is the word version: Click Download You can follow me !



share wamp


Scan QR code and read on mobile phone

Recommended reading:

Received 2 comments
 avatar
Xyz software 2015-11-03 15:29
Thanks for sharing!
reply
 commentator
Mrxn 2015-11-03 17:21
@Xyz software: You're welcome
reply