dsb12300 2015-12-27 03:57
浏览 51
已采纳

Symfony框架安装406不可接受的错误w / CPanel和WHM

So I am trying to get Symfony working on my server by following these install instructions.

http://symfony.com/doc/current/book/installation.html#book-installation-permissions

I got to the part where I ran this command in console in the directory where I wanted the framework to be installed.

symfony new my_project_name

I then followed these instructions to set my web root directory to /web as I believe I'm supposed to do?

It installed all the files correctly since I can see them in the folder. I made sure to restart apache and I'm positive document root is in the correct location.

http://tecadmin.net/how-to-change-document-root-of-primary-domain-in-cpanel/#

Once I did this I was supposed to be able to test the installation, but nothing seems to happen except that 406 error?

This is the exact error I get.

An appropriate representation of the requested resource /app.php could not be found on this server.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I'm not sure what else to do.

Please note, that since I'm using CPANEL I can't change the virtual host configurations of apache if that is the issue, so I'm looking for a CPanel specific answer. Thank you!

  • 写回答

1条回答 默认 最新

  • douwen9534 2015-12-27 05:54
    关注

    Okay so I finally figured out what to do, I had 2 problems. Because I installed as the 'root' user I had to run the following command on the symfony installation.

    chown -R devdistribution:devdistribution .

    In my case, my username is devdistribution but you would just put your own. Make sure to do this on the top level not just the /web folder.

    I knew this was one of the errors because the apache log said something along these lines

    Mismatch between target UID (520) and UID (501) of file "/home/devdistribution/public_html/distribution_tech/web/app.php"

    This fixed the 500 error, but not the 406. To fix the 406 error you need to login into WHM and type modsecurity to find it in the search field.

    go to the configuration option for it, you will see this.

    Rules Engine SecRuleEngine 
    This setting controls the behavior of the rules engine.
     Process the rules.
     Do not process the rules.
     Process the rules in verbose mode, but do not execute disruptive actions.
    

    Select 'Do not process the rules'. Then save at the bottom. This fixed the issue for me and I was able to see the opening symfony screen!

    However, this I'm sure leaves security vulnerabilities now...so I still need help on the proper way to handle mod security with symfony in this case if anyone knows? I'll make a separate question for this.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line