zoukankan      html  css  js  c++  java
  • 半吊子菜鸟学Web开发5 -- PHP开发环境配置

    本文参考自:http://blog.csdn.net/angon823/article/details/54415855

    Ubuntu16.04 默认 apt-get install apache2 安装的apache2.4
    apache2.4配置根目录文件在 
    /etc/apache2/sites-available/000-default.conf
    默认是 var/www/html
    可以改成想要的目录,比如/home/judge/etc/web
    sudo vim /etc/apache2/sites-available/000-default.conf

    默认主页的配置在
    /etc/apache2/mods-available/dir.conf
    可以为如下格式:index.html  index.cgi  index.pl  index.php index.xhtml index.htm
    可以修改为 ***.html等
     
    修改默认根目录之后会报两个错误

    AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.158.209. Set the 'ServerName' directive globally to suppress this message

    以及
    访问localhost:80 报 404 You don't have permission to access / on this server.
    解决办法:
    sudo vim /etc/apache2/apache2.conf 
    第一个问题: 其实提示中已经说了让set ServeerName,所以
    在/etc/apache2目录下,打开apache2.conf文件,
    加一句:ServerName localhost:80
     
    第二个问题:
    网页上显示404说没有权限访问这个服务器
    还是apache2.conf文件,找到
    <Directory />
            Options FollowSymLinks
            AllowOverride None
            Order deny,allow
           Require all granted
            #Require all denied
    </Directory>
     
    把Require all denied这一句注释掉,加上 allow from all

    最后重启apache,
    service apache2 restart
    发现已经正常了。
  • 相关阅读:
    菜鸟看懂算法以后之一:头痛的64次左移
    C语言通过指针数组和二维数组读取文件
    C++中构造函数调用构造函数
    bnuoj53075 外挂使用拒绝
    [CodeForces]String Reconstruction
    BNU-2017.7.4排位赛2总结
    BNU-2017.7.5排位赛3总结
    BNU-2017.7.3排位赛1总结
    微软大楼设计方案(困难)
    最长公共子序列针对小字符集的算法
  • 原文地址:https://www.cnblogs.com/daibigmonster/p/8032472.html
Copyright © 2011-2022 走看看