简体   繁体   English

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

[英]Apache2 URL Rewrite using Joomla - Permission issue? (500 internal error)

I am using LAMP with Joomla 3.3.4 on ubuntu desktop 我在ubuntu桌面上将LAMP与Joomla 3.3.4一起使用

I am currently using the local ip (192.168.xx) to access the site as I don't have a domain name yet while I am still developing the web site. 我目前正在使用本地ip(192.168.xx)访问该站点,因为当我仍在开发该网站时,我还没有域名。 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. 我试图摆脱在URL中显示的' index.php '看起来很愚蠢。 Every page that isn't the homepage will look like ' domain.com/index.php/page ' which I want to change to domain.com/page . 不是主页的每个页面都将看起来像“ domain.com/index.php/page ”,我想将其更改为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. 我已经尝试了http://forum.joomla.org/viewtopic.php?t=614279中列出的所有解决方案,但对于其他许多人却没有帮助。 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. 命令“ a2enmod rewrite ”输出它已经启用,因此说php和joomla。

My /sites-enabled/000-default.conf contains no <Directory> tags whatsoever, like specified in the ' AllowOverride ' solution. 我的/sites-enabled/000-default.conf包含任何<Directory>标记,例如在' AllowOverride '解决方案中指定的标记。 When I added those with the code given it made my whole site go 500 internal error . 当我使用给定的代码添加这些代码时,整个站点都出现了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) 当我在Joomla中启用“使用URL重写”时,它将使除主页(domain.com)之外的所有页面404

The apache error.log is spammed with the following: apache error.log包含以下内容:

  • A typo that I fixed which still didn't solve anything 我修正的错字仍然无法解决任何问题

  • ' /var/www/html/.htaccess : Options not allowed here' (which I don't understand) ' /var/www/html/.htaccess :此处不允许使用选项'(我不理解)

  • 'Request exceeded the limit of 10 internal redirects due to probable configuration error. '由于可能的配置错误,请求超出了10个内部重定向的限制。 Use 'LimitInternalRecursion' to increase the limit if necessary. 必要时使用'LimitInternalRecursion'增加限制。 use 'LogLevel debug' to get a backtrace' 使用“ LogLevel调试”获取回溯

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. 目前尚未设置Joomla的configuration.php中的“ public $live_site = ”值,它应该包含域名。 When I tried setting ' localhost ' it made my whole site template glitch out without solving the problem. 当我尝试设置' localhost '时,它使整个站点模板出现故障,而没有解决问题。 Same for ' 192.168.x.x' 与`` 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 error.log的垃圾内容是:PHP注意:未定义的索引:X行/var/www/html/libraries/joomla/applications/web.php中的HTTP_HOST

This is repeated for almost every .php file. 几乎每个.php文件都会重复此过程。

Could this be a permission issue with Ubuntu and Apache2? 这可能是Ubuntu和Apache2的权限问题吗? - I've had permission issues before with software, even joomla, it was unable to modify files until I set the directory permissions. -在使用软件甚至joomla之前,我都遇到过权限问题,在设置目录权限之前,它无法修改文件。 - Normally your host sets permissions correctly, obviously you wouldn't be able to do anything. -通常,您的主机正确设置了权限,显然您将无能为力。 Though I host it myself. 虽然我自己托管。

EDIT 2: 编辑2:

Ubuntu version: 14.04 Ubuntu版本: 14.04

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

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 我使用了该指南: http : //docs.joomla.org/How_to_check_if_mod_rewrite_is_enabled_on_your_server

...to find out if mod_rewrite is functioning; ...以了解mod_rewrite是否正常运行; It was not. 不是。 What this means is that the problem does NOT lie in .htaccess or your joomla settings, but in apache. 这意味着问题不在于.htaccess或您的joomla设置,而在于apache。

If apache is not configured correctly, .htaccess will be ignored. 如果未正确配置apache,则将忽略.htaccess

In my configs the AllowOverride was set to target /var/www/ instead of /var/www/html/ . 在我的配置中, AllowOverride设置为目标/var/www/而不是/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; 我希望这对其他人也有帮助,如果您发现自己的apache设置通过了我提到的指南,那么您的问题就出在您的网站上。 your .htaccess or joomla configs. 您的.htaccess或joomla配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM