`
wx1569110409
  • 浏览: 18651 次
文章分类
社区版块
存档分类
最新评论

Fixing Apache (13)Permission denied: access to / 403 Forbidden

 
阅读更多

Every so often I run into a 403 Forbidden response when I'm setting up something in Apache, checking the log files will yield something like:

(13)Permission denied: access to /

There are a few things that could be the problem:

Make sure it's not denied by Apache

Most apache Configurations have something like this in there:

<Directory />
    Order deny,allow
    Deny from all
</Directory>

The above will block access to all files. You should also see something like this:

<Directory /path/to/webroot>
    Order allow,deny
    Allow from all
</Directory>

So if you have created a VirtualHost or an Alias that does not fall under this /path/to/webroot apache will have denied access to it. The solution in that case is to add another Directory entry in your httpd.conf to allow access to that directory.

Make sure Apache has Read, Execute Permissions

The next thing to check is that Apache has read and execute permission (rx) on directories and read permission on files. You can run chmod 750 /dir (to give -rwxr-x--- permission) or chmod 755 /dir (to give -rwxr-xr-x permission), etc.

Make sure that the Directory Above has Execute Permission

This is the one that tends to get me. Suppose you are creating an Alias like this:

Alias /foo /tmp/bar/foo

Now you have made sure that apache can read and execute /tmp/bar/foo by running chmod 755 /tmp/bar/foo, but you also need to give Apache execute permission to /tmp/bar/ otherwise it cannot traverse the sub directory foo.

If Running Security Enhanced Linux (SELinux)

Another possibility for this error is that you are running SELinux (Security Enhanced Linux), inwhich case you need to use chcon to apply the proper security context to the directory. One easy way to do this is to copy from a directory that does work for example /var/www/

chcon -R --reference=/var/www /path/to/webroot

转载于:https://my.oschina.net/mote001/blog/1536720

分享到:
评论

相关推荐

    Visual Studio

    After fixing these issues, please restart Visual Studio to ensure that changes have been applied. Software/Tool Issue Android SDK The software is missing from your system. You may also have to...

    encodef:在 Unix/Linux/POSIX 中简化文件名处理的程序-开源

    此问题在“修复 Unix/Linux/POSIX 文件名:控制字符(例如换行符)、前导破折号和其他问题”(http://www.dwheeler.com/essays/fixing-unix-linux-filenames. html)。 “Shell 中的文件名和路径名:如何正确执行”...

    hadoop 2.7.6 eclipse插件

    Fixing permissions to correct value rwx------ 18/05/25 19:51:34 INFO input.FileInputFormat: Total input paths to process : 3 18/05/25 19:51:35 INFO mapreduce.JobSubmitter: number of splits:3 18/05/25...

    为什么每次开机总是检查D盘_如何解决(免费下载)

    ### 知识点一:Windows系统磁盘检查机制 #### 1.1 CHKDSK命令简介 - **CHKDSK** 是一个用于检测并修复文件系统错误的强大工具,尤其是在Windows操作系统中。它能够扫描指定的磁盘分区或卷,并报告发现的任何文件...

    lwip-2.1.3.zip

    This is again a bugfix-only release on the 2.1.x branch fixing numerous smaller bugs. For a changelog, see the git log here: https://git.savannah.nongnu.org/cgit/lwip.git/log/?h=STABLE-2_1_3_RELEASE ...

    Keil.STM32F1xx_DFP.2.3.0.pack(STM32F1xx系列最新固件库for Keil MDK 5)

    Corrected MessageSend function to only access required data for sending Corrected abort message send functionality Corrected SetBitrate function EMAC: Corrected ETH DMA initialization. Now done when ...

    iginite-challange-fixing-the-code:这是路径节点中Ignite的Bootcamp的第三个挑战

    $ git clone https://github.com/gabrielcancio/iginite-challange-fixing-the-code.git 安装依赖项(您需要安装或 ): $ yarn 或者 $ npm install :high_voltage: 跑步 您可以运行以下命令来运行API: $ yarn...

    awesome-go-style:Go风格指南集合

    // For TODOs, BUGs, and NOTEs please use the standard form://// // TODO(username): ...//// The username (generally yours) means "for more information see", not// "I claim responsibility for fixing ...

    ubuntu ref

    Fixing Broken Packages** - **Command**: `apt-get -f install` - **Purpose**: Try to fix broken packages. **8. Configuring Packages** - **Command**: `dpkg --configure -a` - **Purpose**: Try to fix...

    visualgdb 5.1r5 正式版 破解

    Added a workaround do the 'run-as' permission bug Added support for fixing broken NDK r11c gdb binaries 另:有些童鞋在实际使用中会出现跟番茄语法打架的情况,请到VISUALGDB项目配置里把CLANG解析的选项...

    Django 1.1 Testing and Debugging.pdf

    Configuring Apache to serve static files 391 Testing multithreaded behavior 396 Generating load with siege 397 Load testing the results recording code 399 Fixing the results recording code 404 ...

    cJSON-master.zip

    Makefile support is limited to fixing bugs. If you don't have CMake available, but still have GNU make. You can use the makefile to build cJSON: Run this command in the directory with the ...

    angular4+bootstrap4 admin模板

    Fixing bugs and reported issues &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a&gt; Providing updates to ensure compatibility with new software versions &lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; Item support does not include: &lt;/p&gt; &lt;ul&gt;

    服装英语学习资料.pdf

    * COLOR FIXING:固色 * AFTER FINISH / AFTER TREATMENT:后整理 * HEAT SETTING:热定型 * RESIN FINISH:树脂整理 三、织物类型 * LINING:产品名称里料 * FABRIC:面料 * TAFFETA:帄纹 * TWILL:斜纹 * SATIN...

    Flutter_MusicPlayer

    audio_player Flutter音乐播放器//音乐播放器具有...对于此项目,我们必须迁移到AndroidX链接: ://medium.com/@carlosAmillan/fixing-androidx-error-in-flutter-f35e18d5925 从Andriod Studio的第二个窗口进行迁移

    Apache Maven Dependency Management

    Chapter 4: Migration of Dependencies to Apache Maven Chapter 5: Tools within Your IDE Chapter 6: Release and Distribute Appendix: Useful Public Repositories Book Details Title: Apache Maven ...

    cp201x资源启动程序

    Reference: Fixing the cp210x open - Unable to enable UART Error When you plugin your USB-UART converter, and run "&gt; ls /dev/tty*", if you don't see the /dev/ttyUSB0 (or similar), your Linux does not ...

    EasyGUI:在 MATLAB 中快速轻松地构建 GUI-matlab开发

    阅读有关初始修复的信息: http : //blog.vadimfrolov.com/fixing-easygui-toolbox/ 。 以下是原始库的描述: EasyGUI 允许您为 m 文件快速创建图形“前端”,以便用户可以交互操作参数。 它提供: * 一组带有简单...

    hydra 7.2 win32

    access from remote to a system. THIS TOOL IS FOR LEGAL PURPOSES ONLY! There are already several login hacker tools available, however none does either support more than one protocol to attack or ...

Global site tag (gtag.js) - Google Analytics