【问题标题】:Starting apache failed in Ubunru 12.04在 Ubuntu 12.04 中启动 apache 失败
【发布时间】:2014-05-25 15:30:25
【问题描述】:

我也全新安装了 Ubuntu 12.04 和 LAMPP。

当我尝试启动/重新启动lampp时,它显示启动apache失败的消息。日志粘贴在下面。

root@cclab:~# /opt/lampp/lampp start
Starting XAMPP for Linux 1.8.3-3...
XAMPP: Starting Apache...fail.
AH00526: Syntax error on line 26 of /opt/lampp/etc/extra/httpd-xampp.conf:
order takes one argument, 'allow,deny', 'deny,allow', or 'mutual-failure'
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
root@cclab:~# 

以下是显示错误的 /opt/lampp/etc/extra/httpd-xampp.conf。

#<IfDefine PHP4>
#LoadModule php4_module        modules/libphp4.so
#</IfDefine>
#<IfDefine PHP5>
#LoadModule php5_module        modules/libphp5.so
#</IfDefine>

# We will enable it by default
#<IfDefine PHP>
   LoadModule php5_module        modules/libphp5.so
#</IfDefine>

LoadModule perl_module        modules/mod_perl.so

Alias /phpmyadmin "/opt/lampp/phpmyadmin"
Alias /phpsqliteadmin "/opt/lampp/phpsqliteadmin"

# since XAMPP 1.4.3
<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Require all granted
</Directory>

<Directory "/opt/lampp/phpsqliteadmin">
    AllowOverride AuthConfig Limit
    Order allow, deny
    Require all granted
</Directory>

# since LAMPP 1.0RC1
AddType application/x-httpd-php .php .php3 .php4

XBitHack on

# since 0.9.8 we've mod_perl
<IfModule mod_perl.c>
        AddHandler perl-script .pl
    PerlHandler ModPerl::PerlRunPrefork
    PerlOptions +ParseHeaders
        PerlSendHeader On
</IfModule>

# demo for mod_perl responsehandler
#PerlModule Apache::CurrentTime
#<Location /time>
#      SetHandler modperl
#      PerlResponseHandler Apache::CurrentTime
#</Location>

# AcceptMutex sysvsem is default but on some systems we need this
# thanks to jeff ort for this hint
#AcceptMutex flock
#LockFile /opt/lampp/logs/accept.lock

# this makes mod_dbd happy - oswald, 02aug06
# mod_dbd doesn't work in Apache 2.2.3: getting always heaps of "glibc detected *** corrupted double-linked list" on shutdown - oswald, 10sep06
#DBDriver sqlite3

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Order deny,allow
        Allow from all
    Allow from ::1 127.0.0.0/8
    ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>

【问题讨论】:

  • 你的 apache 版本是多少? 2.2 还是 2.4?
  • Apache 版本为 2.4.7

标签: apache ubuntu lampp


【解决方案1】:

删除Directory 指令中的Order 语句,它们不适用于2.4 版。

你正确地设置了Require all granted,这就是你所需要的。

更多信息在这里:https://httpd.apache.org/docs/trunk/upgrading.html

【讨论】:

    【解决方案2】:

    您应该会看到与 APACHE 版本相对应的语法。

    vi /etc/httpd/conf.d/roundcube.conf 
    

    nano /etc/httpd/conf.d/roundcube.conf 
    
    #
    Alias /webmail /usr/share/roundcube 
    <Directory /usr/share/roundcube/> 
        AddDefaultCharset ISO-8859-1 
        Options None 
        AllowOverride None 
        Order Allow,Deny 
        Allow from all 
    </Directory> 
    
    root@server# service httpd restart 
    
    Arrêt de httpd :                                           [  OK  ]
    Démarrage de httpd :                                       [  OK  ]
    

    更多详情见this

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-26
      • 2023-02-14
      • 2014-04-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多