建立网上项目站点。
1.虚拟域名解析
http://www.flower.cn
打开c:\windows\system32\drivers\etc\hosts文件
127.0.0.1 localhost
127.0.0.1 www.zhou.com
127.0.0.1 www.webphp.cn
2.指定网站所有位置G:\zhou
3.apache服务器在哪里,它可不可以执行php程序。
e:\apache
找到e:\apache\conf\httpd.conf 在这个文件,开启虚拟域名解析
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
改成
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
找到e:\apache\conf\extra\httpd-vhosts.conf 在这个文件中,配置域名解析,添加如下配置
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webrx@126.com
DocumentRoot "G:/flower"
ServerName www.flower.cn
DirectoryIndex index.html index.php
<Directory "G:/flower">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost> ///////////////////apache版本不一样 配置可能不同!!
4. 建立G:\flower目录下,建立index.php,并在根目录下,放一个网站的图标,名称是favicon.ico 大小是:8bit 16*16 32*32 48*48
<?php
phpinfo();
5. 输入http://www.flower.cn 查询网站效果。
6. dreamweaver 建立站点
如果用wamp建立站点后localhost不能打开,需要为localhost建立一个新的站点
把<VirtualHost *:80>
ServerAdmin localhost
DocumentRoot "D:/wamp/www"
ServerName localhost
ServerAlias www.localhost
ErrorLog "logs/local.com-error.log"
CustomLog "logs/local.log" common
</VirtualHost>
加入到httpd-vhosts文件中,即可!!