doujia9833 2014-10-28 21:17
浏览 47
已采纳

Apache2 URL使用Joomla重写 - 权限问题? (500内部错误)

I am using LAMP with Joomla 3.3.4 on ubuntu desktop

I am currently using the local ip (192.168.x.x) to access the site as I don't have a domain name yet while I am still developing the web site. I have been struggling with this problem for months, going over forums that have fixes that seem to work for others but not for me.

I am trying to get rid of the 'index.php' that shows in URLs which looks really dumb. Every page that isn't the homepage will look like 'domain.com/index.php/page' which I want to change to domain.com/page.

I have tried all solutions listed in http:// forum.joomla.org/viewtopic.php?t=614279 None seem to work for me while they do work for a lot of other people. This code, top rated, made absolutely no difference to me:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

The command 'a2enmod rewrite' outputs that it's already enabled and so say php and joomla.

My /sites-enabled/000-default.conf contains no <Directory> tags whatsoever, like specified in the 'AllowOverride' solution. When I added those with the code given it made my whole site go 500 internal error.

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>  

When I enable 'use URL rewriting' in Joomla it makes all pages 404 except for the home page (domain.com)

The apache error.log is spammed with the following:

  • A typo that I fixed which still didn't solve anything

  • '/var/www/html/.htaccess: Options not allowed here' (which I don't understand)

  • 'Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. use 'LogLevel debug' to get a backtrace'

I have no idea what's going on here, any ideas?

EDIT:

  • The 'public $live_site =' value in Joomla's configuration.php is currently not set, it is supposed to contain the domain name. When I tried setting 'localhost' it made my whole site template glitch out without solving the problem. Same for '192.168.x.x'

  • error.log is spammed with: PHP Notice: Undefined index: HTTP_HOST in /var/www/html/libraries/joomla/applications/web.php on line X

This is repeated for almost every .php file.

Could this be a permission issue with Ubuntu and Apache2? - I've had permission issues before with software, even joomla, it was unable to modify files until I set the directory permissions. - Normally your host sets permissions correctly, obviously you wouldn't be able to do anything. Though I host it myself.

EDIT 2:

Ubuntu version: 14.04

Apache2 config files: http://pastebin.com/raw,php?i=6H6rP2aY

  • 写回答

1条回答 默认 最新

  • douyasihefu6214 2014-10-31 13:07
    关注

    I found the solution to my own problem.

    I used this guide: http://docs.joomla.org/How_to_check_if_mod_rewrite_is_enabled_on_your_server

    ...to find out if mod_rewrite is functioning; It was not. What this means is that the problem does NOT lie in .htaccess or your joomla settings, but in apache.

    If apache is not configured correctly, .htaccess will be ignored.

    In my configs the AllowOverride was set to target /var/www/ instead of /var/www/html/. Updating that fixed the problem for me.

    I hope this may help other people as well, and if you find that your apache setup passes the guide I mentioned, then your problem lies in your website; your .htaccess or joomla configs.

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

报告相同问题?

悬赏问题

  • ¥15 MATLAB代码补全插值
  • ¥15 Typegoose 中如何使用 arrayFilters 筛选并更新深度嵌套的子文档数组信息
  • ¥15 前后端分离的学习疑问?
  • ¥15 stata实证代码答疑
  • ¥50 husky+jaco2实现在gazebo与rviz中联合仿真
  • ¥15 dpabi预处理报错:Error using y_ExtractROISignal (line 251)
  • ¥15 在虚拟机中配置flume,无法将slave1节点的文件采集到master节点中
  • ¥15 husky+kinova jaco2 仿真
  • ¥15 zigbee终端设备入网失败
  • ¥15 金融监管系统怎么对7+4机构进行监管的