Apache 2.4は再ロードされません。構成に問題がありますか?

Apache 2.4は再ロードされません。構成に問題がありますか?

Apache 2.4で動作するようにApache 2.2で書かれたファイルを取得しようとしましたが、VirtualHostファイルをいくつか変更しましたが、Apacheを通過できませんでしたconfigtest。アイデアは、ウェブサイトをローカルでテストすることです。 Apache 2.2で動作するように見えるソースファイルは次のとおりです。

<VirtualHost local.in2014.mini.debconf.org:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/in2014.mini/website/

    <Directory />
        Options +FollowSymLinks +Includes
        AllowOverride None
    </Directory>

    <Directory /var/www/in2014.mini/website/>
        Options +Indexes +FollowSymLinks +MultiViews +Includes
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Apache 2.4に変更するために行った変更は次のとおりです。

$ cat /etc/apache2/sites-enabled/minidebconfindia.conf
<VirtualHost mini:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html/in2014.mini/website

    <Directory />
        Options FollowSymLinks +Includes
        Require all granted
    </Directory>

    <Directory /var/www/html/in2014.mini/website/>
        Options Indexes FollowSymLinks MultiViews +Includes
        Require all granted
    </Directory>
</VirtualHost>

これで、ホスト名を大きな名前から小さな名前に変更したことがわかりました。私も/etc/hostsその中の名前を変更/編集しました。

$ cat /etc/hosts
127.0.0.1    localhost
127.0.1.1    debian mini

私のシステムのホスト名:

$ hostname
debian

configtest私はどこが間違っているかを正確に調べるためにそれを実行してみました。

$ sudo apachectl configtest
AH00526: Syntax error on line 6 of /etc/apache2/sites-enabled/minidebconfindia.conf:
Either all Options must start with + or -, or no Option may.
Action 'configtest' failed.
The Apache error log may have more information.

6行目は次のとおりです。

Options FollowSymLinks +Includes

だから意見を見ると次のようにしなければならないようです。

Options +FollowSymLinks +Includes

これにより、ライン10でも同じことをするように指示/要求します。

Options +Indexes +FollowSymLinks +MultiViews +Includes

私は正しい道を行っていますか?

アップデート#1

@garethTheRedの提案に従って、次のように修正しました。

$ cat minidebconfindia.conf
<VirtualHost mini:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html/in2014.mini/website

    <Directory />
        Options +FollowSymLinks +Includes
        Require all granted
    </Directory>

    <Directory /var/www/html/in2014.mini/website/>
        Options +Indexes +FollowSymLinks +MultiViews +Includes
        Require all granted
    </Directory>
</VirtualHost>

apache2 configtestこれを得るために再実行しました。

$ sudo apachectl configtest
[sudo] password for shirish:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK

最後の行は、設定ファイルが準備されたことを示しています。これはサーバー名/ IPアドレスに問題があるようです。印刷物を共有しました/etc/hosts

インターネットで検索してエラーを探してみhttpd.confなければならない/etc/hosts/使用できない場所があるようです。ファイルを作成して2つを試しました。

$ cat /etc/apache2/httpd.conf
ServerName localhost

また:

$ cat /etc/apache2/httpd.conf
ServerName mini

ただし、上記で共有したのと同じエラーが発生したため、どちらも機能しませんでした。誰でも助けることができますか?

ベストアンサー1

Apacheドキュメントからオプション:

ノート

+ または - のオプションと + または - のないオプションを混在させるのは無効な構文であり、サーバーの起動中に構文チェックを中断することで拒否されます。

だからそれは全部または専務のようです+

おすすめ記事