环境验证
1、首页验证
使用浏览器打开首页demo:http://IP地址,首页正常显示,则表示环境安装成功。
2、 服务器情况
通过“首页”->“检查服务器情况”/“phpinfo”了解安装软件的详细信息:
3、数据库管理
通过“首页”->“APPLICATIONS”找到phpMyAdmin,进行数据库管理:
注意:为保证数据库安全,不能远程管理数据库,请到服务器本机上通过http://127.0.0.1打开浏览器,进行数据库管理。MySQL数据库默认用户/密码:root/websoft9。
与WAMP不同的是,在WAPP环境中,数据库采用的是postgresSQL,默认用户/密码:postgres/websoft9。
Windows服务器上默认安装了firefox浏览器,可在桌面上使用该浏览器。
服务随操作系统自动启动,如果手工修改配置参数后,需要重新启停服务。
方法一:在“开始”-> “管理工具”->“服务”中重启wampstackApache、wampstackMysql服务。
方法二:在C:\websoft9\wampstack-*中双击打开manager-windows,启停wampstackApache、wampstackMysql服务。
方法三:在“开始”-> “所有程序”->“Bitnami WAMP Stack”中找到“Bitnami WAMP Stack Manager Tool”。
点击“Bitnami WAMP Stack Manager Tool”,打开窗口,启停wampstackApache、wampstackMysql服务。
Mysql管理与两种方式:1、CMD窗口命令行 2、phpMyAdmin图形化界面
方式一:打开CMD命令行窗口,使用 mysql -u用户名 -p密码 登录数据库进行操作。前提:将mysql/bin目录加入到系统环境变量,否则出现mysql命令找不到的提示。
方式二:通过首页打开phpMyAdmin界面,登录后进行数据库管理。
修改root密码、创建删除数据库、创建数据库用户等详细Mysql命令请参考:
注:新安装的MySQL5.7,登录时提示密码错误,安装的时候并没有更改密码,后来通过免密码登录的方式更改密码,输入update mysql.user set password=password('root') where user='root'时提示ERROR 1054 (42S22): Unknown column 'password' in 'field list',原来是mysql数据库下已经没有password这个字段了,password字段改成了
<span style="color:#ff9900;">authentication_string</span>
所以更改语句替换为update MySQL.user set authentication_string=password('root') where user='root' ;即可
DocumentRoot "C:/websoft9/wampstack-5.5.36-0/apache2/htdocs"
<Directory "C:/websoft9/wampstack-5.5.36-0/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3 >
Require all granted
</IfVersion>
</Directory>
DocumentRoot "C:/websoft9/wampstack-5.5.36-0/apache2/htdocs"
SSLEngine on
SSLCertificateFile "C:/websoft9/wampstack-5.5.36-0/apache2/conf/server.crt"
SSLCertificateKeyFile "C:/websoft9/wampstack-5.5.36-0/apache2/conf/server.key"
<Directory "C:/websoft9/wampstack-5.5.36-0/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3 >
Require all granted
</IfVersion>
</Directory>
# Error Documents
ErrorDocument 503 /503.html
# Bitnami applications installed with a prefix URL (default)
Include "C:/websoft9/wampstack-5.5.36-0/apache2/conf/bitnami/bitnami-apps-prefix.conf"
</VirtualHost>
前提条件:国内服务器要进行域名备案,并配置好域名解析到该服务器IP
1、配置HOST文件
首先在系统盘下C:\Windows\System32\Drivers\etc(见下面红色字体)进行配置.
假设要配置的域名为test.websoft9.cn和demo.websoft9.cn:
--------------------------------------------------------------------------------------------------------
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 test.websoft9.cn
127.0.0.1 demo.websoft9.cn
--------------------------------------------------------------------------------------------------------
2、配置vhost文件(配置前注意将原来文件备份,以预防修改失败快速恢复)
1) 快速修改网站根目录,参考前面一节“快速修改网站根目录”即可,如根目录不变则无须修改,本例中假设网站根目录是C:/test
2)配置C:\websoft9\wampstack*\apache2\conf\bitnami下面的bitnami-apps-vhosts.conf文件(见红色字体):
注意:域名对应的网站目录必须是根目录或根目录之下的目录,否则访问会报错。
--------------------------------------------------------------------------------------------------------
# Bitnami applications installed in a Virtual Host
<VirtualHost *:80>
ServerAdmin help@websoft9.com
DocumentRoot "c:/test/test1/"
ServerName demo.websoft9.cn
ServerAlias demo.websoft9.cn
ErrorLog "logs/demo.websoft9.cn-error.log"
CustomLog "logs/demo.websoft9.cn-access.log" common
<Directory "c:/test/test1/" >
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin help@websoft9.com
DocumentRoot "c:/test/test2/"
ServerName test.websoft9.cn
ErrorLog "logs/test.websoft9.cn-error.log"
CustomLog "logs/test.websoft9.cn-access.log" common
<Directory "c:/test/test2/" >
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
--------------------------------------------------------------------------------------------------------
3、重启Apache服务,然后就可以通过域名访问服务器了。