doupang5433 2014-02-01 21:11
浏览 28
已采纳

/ home / user / Projects中的PHP项目 - 如何配置apache?

I have a PHP project located at:

/home/hommer/Projects/Joomla

I know that if I place the project itself in /var/www/Joomla it would work, but how can I tell Apache to go and look in that directory, or if in the future I have another directory, to look into that other directory too?

I am under Ubuntu 12.10.

  • 写回答

3条回答 默认 最新

  • dounan4479 2014-02-01 21:30
    关注

    You could use a symlink (symbolic link) in /var/www to point to /home/hommer/Projects/Joomla.

    $ cd /var/www
    $ sudo ln -s /home/hommer/Projects/Joomla Joomla
    

    Then you will have to configure the right permissions.

    Also, if you want to do that, check that your Apache configuration allows this, by adding FollowSymLinks in /etc/apache2/sites-available/000-default.conf (or the config file you're using for /var/www):

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        ...
    </Directory>
    

    Eventually, the complete path must be executable by Apache, so you can do that:

    $ sudo o+x chmod /home /home/hommer /home/hommer/Projects /home/hommer/Projects/Joomla
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料