> 当我们需要将框架部署到运行环境中,我们可以在服务器软件环境的配置文件中将网站的目标目录定位至框架的Web目录中,以便我们访问和请求 Nginx 打开`nginx.conf`修改`server`中的`root`配置项: ```nginx root "/var/www/Web"; ``` 虚拟机: ```nginx server { listen 80; server_name www.abc.com; location / { root /var/www/www.abc.com/Web; index index.php index.html index.htm; } } ``` * * * * * Apache 打开`httpd.conf`修改`DocumentRoot`配置项: ```apache DocumentRoot "/var/www/Web" ``` 虚拟机: ```apache <VirtualHost *:80> DocumentRoot "/var/www/www.abc.com/Web" ServerName www.abc.com <Directory "/var/www/www.abc.com/Web"> Options FollowSymLinks ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> </VirtualHost> ```