我的机器上安装了wampp服务器,我用它来运行php应用程序。
在我的项目中的htdocs中有许多文件夹,我可以在浏览器的url中看到这些文件夹: localhost/ folder -name/。
我想看到每个项目在一个自定义的网址: dev.name-folder.com
使用IIS很容易做到这一点,有人能解释一下如何使用wampp服务器在Apache中做到这一点吗?
谢谢。
发布于 2011-04-11 21:49:04
您可以更改C:\Windows\System32\drivers\etc\hosts文件,以将dev.name-folder.com之类的域名映射到本地系统。(否则您将不得不使用DNS服务器)。
要在apache中配置vhost,请为您希望提供服务的每个域/项目创建一个文件:
<VirtualHost *:80>
ServerAdmin email@domain.tld
ServerName domain.tld
DocumentRoot /var/www/htdocs/domain.tld/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/htdocs/domain.tld/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>ServerName是您希望为您的文件提供服务的域名。DocumentRoot必须设置为文件的绝对路径(这里取自linux系统)。
https://stackoverflow.com/questions/5622153
复制相似问题