Google
 
My visitors : Hit Counter by Digits

2009/07/26

Đổi thư mục host( host root) của Apache

Khi cài xong Apache host root mặc định có thể sẽ là: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\
Nếu bạn dùng XAMPP thì C:\XAMPP\htdocs\
Như vậy, bạn phải đặt các file php trong folder htdocs này. Bạn hoàn toàn có thể đổi folder host root này như sau.

  1. Bạn tạo folder host root tương lai đã( VD: D:\mywww\ ).
  2. Trong folder D:/mywww/ bạn tạo folder cgi-bin.
  3. Copy file httpd.conf trong folder C:\XAMPP\apache\conf\ hay ..\Apache2.2\conf ra chỗ khác để backup thôi.
  4. Mở httpd.conf bằng notepad( hay tương tự) rồi sửa như sau:
  • Tìm : DocumentRoot “C:/xampp/htdocs”
Sửa thành: DocumentRoot “D:/mywww”
  • Tìm : Directory “C:/xampp/htdocs”
Sửa thành: Directory “D:/mywww”
  • Tìm: ScriptAlias /cgi-bin/ “C:/xampp/htdocs”
Sửa thành: ScriptAlias /cgi-bin/ “D:/mywww/cgi-bin/”

Save file httpd.conf lại. Rồi khởi động lại XAMPP. Bạn vào trình duyệt web, khỏ localhost/ nếu nó ra list các file và folder trong hostroot thì hoàn thành rồi. Từ nay, bạn lưu các file php trong này.
Nếu bạn cài thêm phpMyAdmin nữa thì copy folder đó ra hostroot mới luôn.
À, nếu bạn cài PHP rồi thì phải vào sửa file httpd.conf trong folder
htdocs nơi đã cài Apache( thường là C:\Program Files\Apache Software Foundation\Apache2.2\ ). Thêm 3 dòng như sau( ở đâu cũng được):
ScriptAlias /php/ "c:/xampp/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"


Kitco Gold live chart

Kitco Gold live chart
Kitco Gold live chart