Ubuntu 14.04 LTSでApache仮想ホストが機能しない

Ubuntu 14.04 LTSでApache仮想ホストが機能しない

使ってきたこのチュートリアル私のUbuntu PCにApache仮想ホストを設定します。no-ip domain仮想ホストとして使用するホスト名を作成しました。チュートリアルのすべての手順に従いましたが、うまくいきません。これは仮想ホストファイルで、名前は次のとおりですcrm2plus.ddns.net.conf

<VirtualHost *:80>

        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin [email protected]
        ServerName  crm2plus.ddns.net
        ServerAlias crm2plus.ddns.net
        DocumentRoot /var/www/crm2plus.ddns.net/public_html

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>
<Directory /var/www>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order Allow,Deny
    Allow from all
</Directory>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

また、次のようにローカルホストファイルにIPとドメイン名のペアを追加しました。

23.253.21.201   shhasan.ddns.net
127.0.1.1       Ubuntu-Dev
127.0.0.1       localhost
99.250.71.177   crm2plus.ddns.net

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Chromeでナビゲートすると正常に動作crm2plus.ddns.netしますweb page not available page。端末に入力するshhasan.ddns.netと何も表示されませんが、入力すると以下が表示されます。ssh-keygen -H -F crm2plus.ddns.netssh-keygen -H -F shhasan.ddns.net

# Host shhasan.ddns.net found: line 14 type RSA

以下はRSAキーです。

また、Apacheエラーとアクセスログも調べました。エラーログには、次のコード行がたくさん繰り返されます。

[Fri Nov 14 17:44:50.304782 2014] [mpm_prefork:notice] [pid 21927] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 configured -- resuming normal operations
[Fri Nov 14 17:44:50.304801 2014] [core:notice] [pid 21927] AH00094: Command line: '/usr/sbin/apache2'
[Fri Nov 14 17:44:54.979832 2014] [mpm_prefork:notice] [pid 21927] AH00169: caught SIGTERM, shutting down

検索しcaught SIGTERM, shutting downてみると、正常な操作の一部であることがわかりました。私はどこで間違っているのかわかりません。以前は動作しshhasan.ddns.netていましたがcrm2plus.ddns.net

出力netstat -pan | grep 80

unix  2      [ ]         STREAM     CONNECTED     528079   5594/gvfsd-http     @/dbus-vfs-daemon/socket-vc8j6I1O
unix  3      [ ]         STREAM     CONNECTED     18079    2579/dbus-daemon    @/tmp/dbus-nICf5nhpay
unix  3      [ ]         STREAM     CONNECTED     18067    2579/dbus-daemon    @/tmp/dbus-nICf5nhpay
unix  2      [ ]         DGRAM                    8009     -                   
unix  3      [ ]         STREAM     CONNECTED     18116    2680/indicator-appl 
unix  3      [ ]         STREAM     CONNECTED     18076    2488/dbus-daemon    @/tmp/dbus-PTGbrLg1OB
unix  3      [ ]         STREAM     CONNECTED     18085    2587/ibus-ui-gtk3   
unix  2      [ ]         STREAM     CONNECTED     528093   5594/gvfsd-http     @/dbus-vfs-daemon/socket-XXVPW75v
unix  3      [ ]         STREAM     CONNECTED     20680    2827/compiz         
unix  3      [ ]         STREAM     CONNECTED     18072    2488/dbus-daemon    @/tmp/dbus-PTGbrLg1OB
unix  3      [ ]         STREAM     CONNECTED     225804   4011/chrome         
unix  3      [ ]         STREAM     CONNECTED     18008    2488/dbus-daemon    @/tmp/dbus-PTGbrLg1OB
unix  3      [ ]         STREAM     CONNECTED     228060   2541/ibus-daemon    @/tmp/dbus-8s7gwnYp
unix  3      [ ]         STREAM     CONNECTED     18071    2488/dbus-daemon    @/tmp/dbus-PTGbrLg1OB
unix  3      [ ]         STREAM     CONNECTED     225280   4011/chrome         
unix  3      [ ]         STREAM     CONNECTED     18069    2607/at-spi2-regist 
unix  3      [ ]         STREAM     CONNECTED     18001    2501/window-stack-b 
unix  2      [ ]         STREAM     CONNECTED     9700589  5594/gvfsd-http     @/dbus-vfs-daemon/socket-80dWj6IE
unix  3      [ ]         STREAM     CONNECTED     18044    2488/dbus-daemon    @/tmp/dbus-PTGbrLg1OB

ベストアンサー1

仮想ホスト定義のわずかに編集されたバージョンstackoverflowに対するRiggsFollyの答え仕事crm2plus.ddns.net

<VirtualHost *:80>

    ServerName crm2plus.ddns.net
        ServerAlias crm2plus.ddns.net
    ServerRoot /var/www/crm2plus.ddns.net/
    DocumentRoot /var/www/crm2plus.ddns.net/public_html

    <Directory "/var/www/crm2plus.ddns.net/public_html">
        Options +Indexes +FollowSymLinks
        Order allow,deny
        Allow from all
        AllowOverride All
    </Directory>


    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    ErrorLog ${APACHE_LOG_DIR}/crm2plus.ddns.net_error.log
    CustomLog ${APACHE_LOG_DIR}/crm2plus.ddns.net_access.log combined


</VirtualHost>

おすすめ記事