0

つい最近、ペットプロジェクト用のVPSとドメインを取得しました。ApacheとPHPをセットアップしましたが、パブリックIPをURLに配置するまで、すべてが正常に機能します。DocumentRootそれは私のセットの1つにリダイレクトしますVirtualHost

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@mydomain.com
  ServerName  mydomain.com
  ServerAlias www.mydomain.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/mysite
  <Directory /var/www/mysite>
    AllowOverride All
    Allow from mydomain.com
    Allow from www.mydomain.com
  </Directory>
  # Log file locations
  LogLevel warn
  ErrorLog  /home/me/public/mydomain.com/log/error.log
  CustomLog /home/me/public/mydomain.com/log/access.log combined
</VirtualHost>

パブリックIPがURLに入力されたものになるたびに、デフォルトにリダイレクトされるようにするには、何を調整する必要がありますIt works! // /var/www/index.htmlか?

4

1 に答える 1

0

DocumentRootグローバルポイントの場所を変更する必要がありますhttpd.conf

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/"

の値を変更しますdirectory

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/var/www">
    Options -Indexes +FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
于 2012-09-04T16:51:27.063 に答える