apache無權限訪問(You don't have permission to access /docs/index.html on this server)


       在ubuntu下用apache配置ext的api,按照網上的教程弄好后會出現訪問權限問題 Forbidden You don't have permission to access /docs/index.html on this server,將此問題谷歌百度,問題還是沒解決,最后的原因竟然是這樣:從硬盤上的其他磁盤拷貝ext文件夾到ubuntu磁盤后,其權限的其他選項的訪問權限是“無”,至少將其改成“訪問文件”才可以被apache訪問

       上面是我遇到問題的解決方案,這里順便說下用apache配置ext的api的幾個步驟:

  • 添加監聽端口
    #cd/etc/apache2
    #sudo vim ports.conf
    #監聽3800端口,添加下面代碼:
    NameVirtualHost*:3800
    Listen 3800
  • 配置目錄
    #cd /etc/apache2/sites-enabled
    #在該目錄下新建一個文件,名稱任取,不需后綴名(如:ext-4.1)
    #sudo gvim  ext-4.1
    #文件內容如下,幾個:
    
    <VirtualHost*:3800>
        ServerAdminwebmaster@localhost
    
        DocumentRoot /home/jing/ext-4.1
        <Directory/>
           Options FollowSymLinks
           AllowOverride None
        </Directory>
       <Directory /home/jing/ext-4.1>
           Options Indexes FollowSymLinks MultiViews
           AllowOverride None
           Order allow,deny
            allow fromall
        </Directory>
    
    
       ErrorLog /var/log/apache2/error.log
    
        #Possible values include: debug, info, notice, warn, error, crit,
       # alert, emerg.
        LogLevel warn
    
       CustomLog /var/log/apache2/access.logcombined
    
    </VirtualHost>
  • 重啟apache服務器
    sudo /etc/init.d/apache2 restart

     


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM