2013-05-19 14 views
5

Khi cố gắng để bắt đầu apache vớiphpmyadmin.conf và apache.conf thiếu

sudo /etc/init.d/apache2 restart 

tôi nhận được lỗi

apache2: Syntax error on line 260 of /etc/apache2/apache2.conf: Could not open 
configuration file /etc/apache2/conf.d/phpmyadmin.conf: No such file or directory 
Action 'configtest' failed. 
The Apache error log may have more information. 
...fail! 

Tôi nên làm gì? Khi đọc trên internet tôi cũng nên có một tập tin gọi là apache.conf trong/etc/phpmyadmin nhưng tôi không.

+0

Tôi không có bất kỳ tệp mẫu nào. Hiện tại, không có vấn đề làm thế nào tôi thay đổi mọi thứ nó hoặc là apache.conf thiếu trong phpmyadmin hoặc phpmyadmin.conf mất tích trong apache2/conf.d – TheMeisterSE

+0

https://help.ubuntu.com/10.04/serverguide/phpmyadmin.html http://packages.debian.org/experimental/all/phpmyadmin/filelist –

+0

http://ubuntuforums.org/archive/index.php/t-1613290.html –

Trả lời

9

Chỉ cần gặp sự cố này trên Debian 7, trình cài đặt và dpkg-reconfigure phpmyadmin tạo liên kết bị hỏng "/etc/apache2/conf.d/phpmyadmin.conf" trỏ đến tệp bị thiếu "../../ phpmyadmin/apache.conf ". Đã phải kéo một bản sao ra khỏi một cài đặt cũ hơn, đăng bài dưới đây. Piotr, ý kiến ​​của bạn không hữu ích, không gây ô nhiễm.

phpMyAdmin mặc định cấu hình Apache

Alias /phpmyadmin /usr/share/phpmyadmin 

<Directory /usr/share/phpmyadmin> 
    Options Indexes FollowSymLinks 
    DirectoryIndex index.php 

    <IfModule mod_php5.c> 
     AddType application/x-httpd-php .php 

     php_flag magic_quotes_gpc Off 
     php_flag track_vars On 
     php_flag register_globals Off 
     php_value include_path . 
    </IfModule> 

</Directory> 

# Authorize for setup 
<Directory /usr/share/phpmyadmin/setup> 
    <IfModule mod_authn_file.c> 
    AuthType Basic 
    AuthName "phpMyAdmin Setup" 
    AuthUserFile /etc/phpmyadmin/htpasswd.setup 
    </IfModule> 
    Require valid-user 
</Directory> 

# Disallow web access to directories that don't need it 
<Directory /usr/share/phpmyadmin/libraries> 
    Order Deny,Allow 
    Deny from All 
</Directory> 
<Directory /usr/share/phpmyadmin/setup/lib> 
    Order Deny,Allow 
    Deny from All 
</Directory> 
+0

đây là tệp cấu hình tuyệt vời. Tôi đã thử rất nhiều trong quá khứ, không ai trong số họ làm việc đúng cách. – unixmiah

+0

Tôi đã có ' BeRocket

1

Kiểm tra nếu /etc/apache2/conf.d thư mục tồn tại, nếu không tạo ra nó.

mkdir -p /etc/apache2/conf.d/ 

Tệp Apache2.conf bao gồm tất cả các tệp từ thư mục này vào cấu hình, nếu thư mục này không tồn tại, nó sẽ hiển thị lỗi.

[email protected]:~$ cat /etc/apache2/apache2.conf | grep conf.d 
Include conf.d/ 

Từ: https://askubuntu.com/questions/365454/apache2-error-could-not-open-configuration-file-etc-apache2-conf-d-no-such-fi

Sau đó, thay thế dòng này:

LockFile ${APACHE_LOCK_DIR}/accept.lock 

với một này:

Mutex file:${APACHE_LOCK_DIR} default 

trong file apache2.conf.

Đã phân loại nó cho tôi.