Wamp uninstallation, installation and configuration & Apache configuration pseudo-static

Source: Internet
Author: User

Precautions for uninstalling and installing Wamp (Please bypass integration)

Precautions for uninstalling Wamp:


Close the application and stop the service. In cmd, SC Delete MySQL SC Delete apache2.2


Notes for copying PHP:


None of the files copied from PHP are PHP. INI but PHP. ini-embedded lopment and a PHP. ini-production we usually change the former name to PhP for development. configure PHP using ini


Notes for installing MYSQL:


Set the data directory to the installation directory, and set the default character encoding to utf8


Configure Wamp after installation


Apache connection to PHP:


Load the PHP module:


Loadmodule php5_module "D:/Wamp/PHP/php5apache2_2.dll"


Compile the PHP file adaptation Tag:


<Filesmatch>


Sethandler application/X-httpd-PHP


</Filesmatch>


Set the php. ini path:


Phpinidir "D:/Wamp/PHP"


PHP connection to MySQL:


Set the PHP extension path:


Extension_dir = "D:/Wamp/PHP/EXT"


Enable MySQL extension:


Extension = php_mysql.dll

Apache configures a virtual host in three steps:


Windows System Configuration:


Modify the file C:/Windows/system32/Drivers/etc/hosts


(If you do not have the permission to modify it, perform the following configuration: Right-click Properties-> Security-> select your permission user edit-> hide full control-> application-> okay)


Add at the end of the file:


127.0.0.1 www.sina.com


Here www.sina.com is the domain name of the virtual host I set.


Apache Server Configuration:


Enable rewrite module:


Loadmodule rewrite_module modules/mod_rewrite.so


Load the VM configuration file:


# Virtual Hosts


Include CONF/extra/httpd-vhosts.conf


Apache Virtual Host file Configuration:


Open and edit the file according to the path of the virtual host configuration file in the Apache Server Configuration:


Set the virtual host, set the document root path, and set the server name and the virtual host name in windows to be consistent:


<Virtualhost *: 80>


DocumentRoot "D:/Wamp/mysina"


Servername www.sina.com


</Virtualhost>


Restart Apche.

Apache configuration pseudo-static:


Configure the directory label in the corresponding Virtual Host module in the Apache Virtual Host file, set the permission, and determine the type of commands allowed to exist in the. htaccess file .:


<Virtualhost *: 80>


DocumentRoot "D:/Wamp/mysina"


Servername www.sina.com


<Directory "D:/Wamp/mysina">


Order deny, allow


Allow from all


AllowOverride all


</Directory>


</Virtualhost>


Write a distributed configuration file in the application. htaccess file (including enabling the rewrite engine, setting rewrite rules with regular expressions, setting the welcome interface of directories, setting the incorrect redirection mechanism of documents, and checking whether the directories are displayed ):


<Ifmodule rewrite_module>


Rewriteengine on


Rewriterule ([A-Z] +)-ID (\ d1_0000.html $ 1.php? Id = $2 & type = $1


Directoryindex hello. php


Errordocument 404/err404.html


Options + Indexes


</Ifmodule>

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.