デフォルトのxampplocalhostc:xampp/htdocを別のフォルダに変更するにはどうすればよいc:/alanですか?IPアドレスを使用すると、で自分のWebサイトファイルを表示できるはずですC:/alan。
私を助けてくれてありがとう。
デフォルトのxampplocalhostc:xampp/htdocを別のフォルダに変更するにはどうすればよいc:/alanですか?IPアドレスを使用すると、で自分のWebサイトファイルを表示できるはずですC:/alan。
私を助けてくれてありがとう。
回答:
httpd.confファイルを編集し、DocumentRoot "/ home / user / www"という行を好きなものに置き換え ます。
デフォルトのDocumentRootパスは、Windowsでは異なります[上記はLinux用です]。
@Souravのアドバイスに従ってください。
サーバーを再起動した後にエラーが発生した場合は、ディレクトリオプションも設定する必要があります。これは<Directory>、httpd.confのタグで行われます。最終的な構成が次のようになっていることを確認します。
DocumentRoot "C:\alan"
<Directory "C:\alan">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
<Directory>一部はそれの後にどこかでなければなりませんが、私は別のサーバーを使用し、異なるプラットフォーム上として、私は本当に確かに確認する手段を持っていません。
                    ステップ:
交換
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
それらの2行
| C:/ xampp / htdocs ==ルートの現在の場所|
| C:/ xampp / htdocsを任意の場所に変更します|
完了:Apacheを起動し、ローカルホストに移動して動作を確認[ビデオを見るここをクリック]
Ubuntu14.04では2つのステップで実行できます。 Xampp 1.8.3-5
ステップ1: -変更DocumentRootとDirectoryパスで/opt/lampp/etc/httpd.conf
から
DocumentRoot "/opt/lampp/htdocs" そして Directory "/opt/lampp/htdocs"
DocumentRoot "/home/user/Desktop/js"とDirectory "/home/user/Desktop/js"
ステップ2:-フォルダの権限を変更します(パスとその親フォルダを777に変更します)。
sudo chmod -R 777 /home/user/Desktop/js
Linux Mint(Debianベース)では、 /opt/lampp/etc/httpd.conf 
もちろん、ファイルの場所にYOUR_OWN_FILES_LOCATIONを見つけます。
DocumentRoot "YOUR_OWN_FILES_LOCATION"
<Directory "YOUR_OWN_FILES_LOCATION">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/trunk/mod/core.html#options
    # for more information.
    #
    #Options Indexes FollowSymLinks
    # XAMPP
    Options Indexes FollowSymLinks ExecCGI Includes
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    #AllowOverride None
    # since XAMPP 1.4:
    AllowOverride All
    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>
私にとっては183行目でしたが、コンピューターを再起動した後にのみ機能します。毎回再起動せずにすばやく変更する方法があればいいのにと思いますが、今のところそれが私が知っている唯一の方法です。
httpd.confファイルとhttpd-ssl.confファイルの両方のDocumentRootプロパティを変更して、相対リンク(href = "/ index.html"など)やfavicon.icoリンクなどを正しく機能させる必要がありました。
最新のXamppコントロールパネルはこれを非常に簡単にします。
コントロールパネルから、最初の行にApacheがあるはずです。開始されている場合は、停止します。次に、configをクリックしてhttpd.confファイルを開き、htdocsまたはdocumentRootを検索します。パスを好きなように変更します。httpd-ssl.confについても同じようにします。これらは、Configのドロップダウンの下のリストの上位2つのファイルである必要があります。
その後、サーバーを再起動します。
これが誰かを助けることを願っています。乾杯。