1.找到apache中httpd-vhosts.conf
Listen 8889
<VirtualHost bfa:8889>
DocumentRoot /Applications/MAMP/htdocs/new_web_pstrom/app/webroot
ServerName bfa
ServerAlias bfa
ErrorLog "/log/httpd/new_default-error.log"
CustomLog "/log/httpd/new_default.log" common
</VirtualHost>
2.hosts
添加
#Apache vhost
127.0.0.1 bfa
3.地址
网站的图片,文件相对路径从DocumentRoot 下开始寻找
本文详细介绍了如何在Apache HTTPD中配置虚拟主机和地址绑定,包括编辑httpd-vhosts.conf文件、添加hosts记录以及理解网站图片、文件的相对路径寻址方式。
1081

被折叠的 条评论
为什么被折叠?



