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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?