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

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.

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

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?