在Ubuntu 12.04中启动apache失败

时间:2014-04-11 12:56:32

标签: apache ubuntu lampp

我已经安装了新的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>

2 个答案:

答案 0 :(得分:0)

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

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

此处有更多信息:https://httpd.apache.org/docs/trunk/upgrading.html

答案 1 :(得分:0)

您应该看到与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