简体   繁体   English

403 Apache2的禁止错误

[英]403 Forbidden Error with Apache2

I am trying to set up Apache2 on my Ubuntu system. 我试图在我的Ubuntu系统上设置Apache2。 It's has been installed and working. 它已经安装并可以工作。 The problem is that I'm working on an AngularJS project and I need a server for my html pages. 问题是我正在AngularJS项目上工作,并且我的html页面需要服务器。 Right now the directory is set to: 现在,目录设置为:

   <Directory /var/www/html>
   Options FollowSymLinks
   AllowOverride None
   Require all granted
   </Directory>

When ever I try to change it to a specific path I always get the 403 Forbidden error. 每当我尝试将其更改为特定路径时,总是会收到403 Forbidden错误。 The path I want it changed to is: 我想要更改的路径是:

/home/michael/dev/JavaScript/AngularJS/Quiz App

When the system is set to the default path and I reload my html page using Sublime Text and I get a 404 error. 当系统设置为默认路径并且使用Sublime Text重新加载html页面时,出现404错误。 The html page is: html页面是:

http://localhost/01_01/index.html

I've been up all night trying to fiqure this out and did the best I could to resolve it. 我整夜都在努力解决这个问题,并尽我所能解决。 I'm open to any possible solutions you guys may have. 我愿意接受你们可能提出的任何可能的解决方案。

It is because Apache2 does not have permission to access path within your home directory. 这是因为Apache2没有访问主目录中路径的权限。 One thing you can do is to create a symbolic link in /var/www/html and pointing it to your code directory. 您可以做的一件事是在/ var / www / html中创建一个符号链接,并将其指向您的代码目录。

ln -s "/home/michael/dev/JavaScript/AngularJS/Quiz App" /var/www/html/quizApp

No open the browser and type localhost/quizApp and you should be able to open your app in the browser 否打开浏览器并输入localhost / quizApp,您应该可以在浏览器中打开应用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM