WAMPSERVER 环境架设教程(多站点配置)
wamp用于架设Apache+Php+Mysql空间
下载运行安装,选择安装目录,例F:/PHPWEB/wamp,F:/PHPWEB/wamp/www为网站内容存储路径。运行后可以通过Windows 右下角 “托盘区” 中的wamp图标,来管理wamp 服务状态,可以停止或重新启动 apache,mysql 服务。当改过 conf 配置文件,必须要重新启动才可以生效。右键点击右下的wamp图标,选择language – chinese,即可改为中文界面。
设置:1.允许外网访问apache高版本的WAMPSERVER无需上面步骤直接左键:切换到在线状态即可。wamp 默认是禁止外网访问APACHE的,左键点击右下的wamp图标Apache – httpd.conf ,搜索关键字 “deny from “,会发现一处 “deny from”将其下的一行”Allow from 127.0.0.1″ 之前加一个 #号,表示注释掉,新插入一行,手动输入Allow from all 。保存,重新启动下apache 服务就可以允许外网访问了。
2.apache, mysql 服务的开机自动运行Windows – 开始? – 设置 – 控制面板 – 管理工具 – 服务,找到 wampmysqld, wampapache, 将 “启动类型” 由”手动” 改为”自动” 即可。
3.开启支持rewrite module
#LoadModule rewrite_module modules/mod_rewrite.so
去前面掉#,修改为LoadModule rewrite_module modules/mod_rewrite.so<Directory />Options FollowSymLinksAllowOverride None # 修改为AllowOverride All #Order deny,allowDeny from allSatisfy all</Directory><Directory “F:/PHPWEB/wamp/www/”>## Possible values for the Options directive are “None”, “All”,# or any combination of:# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews## Note that “MultiViews” must be named *explicitly* — “Options All”# doesn’t give it to you.## The Options directive is both complicated and important. Please see# http://httpd.apache.org/docs/2.2/mod/core.html#options# for more information.#Options Indexes FollowSymLinks## AllowOverride controls what directives may be placed in .htaccess files.# It can be “All”, “None”, or any combination of the keywords:# Options FileInfo AuthConfig Limit#AllowOverride None # 修改为AllowOverride All ### Controls who can get stuff from this server.#Order allow,denyAllow from all</Directory>4.php配置查找short_open_tag = Off,把off改成On,注意是前面没有#号的那一排。memory_limit = 128M ;最大内存使用,运行程序提示内存不足时可修改其大小upload_max_filesize = 2M ;附件大小5.多域名配置 在“httpd.conf”文件中查找:Include conf/extra/httpd-vhosts.conf,去掉前面的注释#。
打开extra/httpd-vhosts.conf文件;在最后加入类似内容:
<VirtualHost *:80>#管理员邮箱 ServerAdmin admin@cnmiss.cn#根目录 DocumentRoot “F:/PHPWEB/wamp/www/cnmiss”#默认域名 ServerName cnmiss.cn#用*表示泛域名,如果要接收三级泛域名解析,可以写成这样:*.my.cnmiss.cn ServerAlias *.cnmiss.cn#错误日志 ErrorLog logs/cnmiss-error.log#用户日志 CustomLog “logs/cnmiss-access.log” common#下面为目录权限配置信息,可以省略 <Directory “F:/PHPWEB/wamp/www/cnmiss”> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory></VirtualHost>
