angular - 在 apache 文件夹中部署 Angular 应用程序
问题描述
我有 Apache 服务器,它在/var/www/html/<angular_root>
. 我尝试添加一个文件夹/var/www/html/admin/<angular_root>
,但出现错误Failed to load resource: the server responded with a status of 404 (Not Found)
。你知道我需要实现什么配置吗?
我当前的 apache 配置是:
<Directory /var/www/html/admin>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
解决方案
您的角度项目(s base href 是错误的。当您部署应用程序时,请在 cmdline 上指定 base-href :
ng build --prod --base-href ./
推荐阅读
- database-design - 关系项目/类型学 Laravel 7
- elasticsearch - 在 GCE 入口后面暴露 Kibana(不健康状态)
- php - 如果将指数数传递给它的函数,PHP BCMath 无法处理,PHP BCMath 返回“bcmath 函数参数格式不正确”
- parsing - 如何避免带有可选右手操作数的规则中的歧义?
- excel - Excel 表行在 Power Query 刷新时移动
- c++ - 为什么这两个不同的反向双链表?
- java - 启动 Springboot 应用程序时收到警告:警告:发生了非法反射访问操作
- php - 如何在 Laravel 的 hasMany 关系中使用 groupBy
- url - 从 Googlesheet URL 地址获取电子表格标题
- python - 无法正确读取 python 中的 SQL 表:作为逗号分隔字符/元组导入的 varchar 列