Super detailed wampserver configuration graphic tutorial and multi-site construction

Source: Internet
Author: User
Tags memory usage php server php code mysql database phpmyadmin

To configure wampserver in windows, follow these steps:


1. Install wampserver


The installation of wampserver is simple. You only need to click next to complete the installation:


7. In the figure above, select the default browser tool "browse", which is the default one. Click "open.

8. As shown in the figure above, a window will be prompted for entering the administrator's mailbox and SMTP server mailbox. If you are willing to enter this window, you can fill it out. However, you can simply click next, installation is not affected.


OK. The installation is successful! Easy!
10. After the installation is complete, a tag is displayed in the lower right corner of the screen. Right-click the tag and select Language-Chinese in sequence,


Check again


11. Click left-click and click "www directory" to open the default web page folder where wampserver is installed. However, most of the time, the folder where the web page is stored is not in that directory, how can we get rid of this directory? Of course, there is a way to open the installation directory of wampserver, open the "script" folder in it, and use notepad to open the config. inc. php, find "$ wwwDir = $ c_installDir. '/www'; ", just change it to the desired directory. For example, change it to D: \ website and the corresponding code is $ wwwDir = 'd:/website '. (note, in windows, the path "\" must be changed to "/"). Disable wampserver, and then open the www Directory. The configured D: \ website is displayed. (Note: only a link on the wampserver is modified here. <we do not recommend that you change it if it is not necessary. The actual Apache Directory is not here, please don't worry about the change. Continue to read it .)

II. Configuration of MySQL and PhpMyAdmin
If you have installed MySQL separately, you will surely find a problem. In the past, you had to configure a root password when installing MySQL. However, when installing wampserver, there is no password configuration step from the beginning to the end. Isn't MySQL a blank password? The answer is yes. It is indeed a blank password. Isn't it unsafe? Yes, so we need to change the password.
1. Click left and select "phpMyAdmin". The phpMyAdmin management page is displayed. Click "permission" in the upper-right corner. Generally, the table shown in the figure is displayed, all we need to do is click on the right side of each row whose username is root.


2. Click it, find the change password area shown in Figure 2, fill in the password to be modified, and then click execute in the lower right corner. A prompt is displayed at the top of the page, indicating that the change is successful, every root user needs to perform this operation. If a good password is unexpected at half past one, you can also use the "generate password" function to generate a random password, but remember this password, if you forget the trouble, it will be too much.


Note: after changing the password, you can see that the password bar of the corresponding account changes from "no" to "yes", as shown in the figure above, circled in green. Then add a new user (which will be detailed later) and delete the user, as marked in red in the figure above, to complete the operation!
3. After completing the preceding operations, restart the MySQL service and refresh the page. The error shown in the figure is displayed. Why?

This is because we modified the MySQL password but did not change the password for communication between phpMyAdmin and MySQL. How can we change it? Open the wampserver installation directory, open \ wamp \ apps \ phpmyadmin3.3.9 in sequence, and open the config in Notepad or DW software. inc. php, find "$ cfg ['servers'] [$ I] ['password'] =''; ", and enter the password you just modified in the last two single quotes, save and refresh the phpMyAdmin page after the operation is completed. Is it back to normal?

4. After completing the above configuration, we need to create a user and the database corresponding to the user for the MySQL database. Similarly, click the permission button in the upper right corner, find a "add new user" link in the lower-left corner, create a user and the corresponding database as shown in the figure, and grant the management permission of a single database, the following resource restrictions can be entered according to the actual situation. In general, the default region can be retained for personal use, and then click the "execute" button in the lower right corner, the corresponding users and databases are created.


 
III. Apache configuration
Although wampserver has already helped us integrate Apache, we still need to complete some details. Let's improve Apache that comes with wampserver one by one.
1. After installing wampserver, friends who are impatient may try to access the configured wampserver through the Internet, but may find that the access via the Internet will prompt insufficient permissions. Why? The reason is that wampserver only allows access to 127.0.0.1 by default, that is, only local access is allowed. How can this problem be modified? Click-Apache-httpd.conf in turn, find the place shown in the figure, about 234th rows, delete "Deny from all", and then change "Allow from 127.0.0.1" to "Allow from all ", you can.



2. Continue searching and find the two locations shown in the figure (approximately 190th rows and 225th rows respectively ), change "AllowOverride None" to "AllowOverride All" (This step is intended for friends who use the URL Rewrite function. If not, do not modify this step, because after this change, Apache's security will be slightly reduced .)

3. Enable the URL rewriting function. Of course, if you think the URL rewriting function is unnecessary, you can ignore it directly. However, the second one must be done, otherwise it is easy to cause errors. Follow the above method to open httpd. in the conf file, find # LoadModule rewrite_module modules/mod_rewrite.so, and then delete the previous "#". Of course, if you want this change to take effect, you also need to restart the apache service immediately.

4. I believe you will remember the above method to change the "www directory" of wampserver to the path? I once said that this method only changed the "www directory" link in wamp. How should we change it if we want to modify it? It's easy to open httpd. conf: find "DocumentRoot" in about 178th rows, change the following value to the path required by our actual website, and then find "<Directory" c:/wamp/www/"> ", change the following value to the actual address stored on our website.


4. Configure PHP-important

PHP configuration is relatively simple, just need to modify some of the basic settings can be, in turn click-PHP-php.ini, find these three places: short_open_tag = Off (can I use the abbreviation of the PHP code start sign (<? ?> ).);

Memory_limit = 128 M (maximum memory used );

Upload_max_filesize = 2 M (maximum number of uploaded attachments ),

The first one needs to be changed to on. Otherwise, many php programs will not run, and the next two items will be changed according to your actual needs.


V. Conclusion

So far, our wampserver configuration has come to an end. Now, you can upload a set of PHP programs to enjoy the success. Of course, the function operations of wampserver and its append components are far more than that simple. The purpose of this article is to allow everyone to use wampserver to build a PHP server environment, next, we need to figure out O (∩ _ ∩) O ~


WampServer multi-site environment setup configuration tutorial

Settings:
1. Allow Internet access to apache
For a higher version of WAMPSERVER, you do not need to perform the preceding steps to directly click the left button: switch to the online status.


By default, wamp prohibits Internet access to APACHE. Click the wamp icon Apache in the lower right corner? Httpd. conf,

Search for the keyword "deny from" and you will find a "deny from" that adds a # sign before the line "Allow from 127.0.0.1" to indicate comment out,

Insert a new row and manually enter Allow from all. Save and restart the apache service to allow Internet access.

2. apache and mysql services run automatically upon startup
Windows? Start? ? Set? Control panel? Administrative tools? Service, find wampmysqld and wampapache, and change "startup type" from "manual" to "automatic.

WampServer multi-site environment setup configuration tutorial-diagram-MySql service


3. Enable pseudo-static support for rewrite module

# LoadModule rewrite_module modules/mod_rewrite.so

Remove # from the front and change it

LoadModule rewrite_module modules/mod_rewrite.so

In httpd. conf, find

AllowOverride None

Modify all

AllowOverride All


4. php configuration
Search for short_open_tag = Off and change off to On. Note that there is no # in front of the row.
Memory_limit = 128 M; maximum memory usage. You can modify the memory size when the running program prompts insufficient memory.
Upload_max_filesize = 2 M; Attachment size


5. Configure multiple domain names (important)

Find in the "httpd. conf" file:

Include conf/extra/httpd-vhosts.conf

Remove the comment #.
Open the extra/httpd-vhosts.conf file; add similar content at the end:

<VirtualHost *: 80>
# Administrator email
ServerAdmin webmaster@dummy-host.localhost
# Root directory
DocumentRoot "E:/Web/wwwroot /"
# Default domain name
ServerName blog.emtalk.net
# Use * to indicate a wildcard domain name. If you want to receive a third-level wildcard domain name resolution, you can write it as follows: * .emtalk.net
ServerAlias * .emtalk.net
# Error log
ErrorLog "log/kqw_svn.localhost-error.log"
# User logs
CustomLog "logs/kqw_svn.localhost-access.log" common
# The following table lists the directory permission configuration information, which can be omitted.
<Directory "E:/Web/wwwroot/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow, deny
Allow from all
</Directory>
</VirtualHost>


Ps: "httpd-vhosts.conf" file content can be all cleared, rewrite your own, will not affect the use;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.