1、在httpd.conf文件中打开Include conf/extra/httpd-vhosts.conf
2、在httpd-vhosts.conf文件中添加如下
<VirtualHost *:80>
DocumentRoot "D:/AppServ/www/workspace/library/public"
ServerName library.com
DirectoryIndex index.php
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>