linux training in Thailand
| Home | Articles | Webboard | Download | FreeTips | Resources | Training | Blog | Web Link |
| Courses | Schedule | Price | Promotion | Map | Customer Ref. | Instructors | Certification | FAQ |
เนื่องจากเราจะปิดทำการ 4 วัน ในวันที่ 1-4 พฤษภาคม 2551 กรุณาติดต่อ โทร. 089-890-5494

Install Apache

โดย bman




สำหรับการ Install Apache นั้นโดยปรกติแล้วตอนที่เราทำการ Install Linux จะมีการถาม ให้เราเลือกว่าจะลงหรือไม่สำหรับคนที่เลือกว่าไว้ตั้งแต่ตอน Install ก็ข้ามเรื่องนี้ ไปได้เลยแต่คนที่ไม่ได้เลือกไว้ หรือ ไม่ยังไม่รู้จักคุ้นเคยกับ Apache ซึ่งเป็น web server ชื่อดังก็ลองอ่านดูก่อนนะครับ

Apache คืออะไร
Apache คือ Project ที่ทำหน้าที่เป็น web server ที่มีผู้ใช้ทั่วโลกมากกว่า 60 % มีหน้าที่ในการจัดเก็บ Homepage และส่ง Homepage ไปยัง Browser ที่มีการเรียกเข้า ยัง Web server ที่เก็บ HomePage นั้นอยู่ซึ่งปัจจุบันจัดได้ว่าเป็น web server ที่มี ความน่าเชื่อถือมาก ซึ่งสามารถหามา Download ได้จาก website www.apache.org

การ Install Apache
เมื่อทำการ Download มาเรียบร้อยแล้วก็ทำการ Install ดังนี้
กรณีที่เป็น file .tar.gz ให้ทำดังนี้
tar xvfz apache_1.3.20.tar.gz [use the name of the file you downloaded]
./configure
make
make install
กรณีที่เป็น RPM
rpm –ivh apache-1.3.20.i386.rpm[use the name of the file you downloaded]
สำหรับ rpm file นั้น สามารถหามา Download ได้จาก web www.rpm.redhat.com

เมื่อเราทำการติดตั้ง Apache เรียบร้อยแล้วก็ควรทำการ Set ให้สามารถ run PHP ได้ด้วย โดยทำดังนี้
Download PHP www.php.net
./configure --with-apache=/path/to/apache (paht/to คือ path ที่ต้องการทำการติดตั้ง apache ลงไป)
make
make install
และถ้าเราต้องการให้มีการ support mysql ด้วยก็ควรใส่ option --with-mysql นี้ลงไปด้วย
จากนั้นก็ทำการ config จาก Apache directory โดยทำดังนี้
./configure --activate-module=src/modules/php3/libphp3.a (for PHP version 3)
./configure --activate-module=src/modules/php4/libphp4.a (for PHP version 4)
./configure --with-apxs --with-mysql
จากนั้นก็ทำการแก้ file httpd.conf โดยเพิ่ม 2 บรรทัดนี้ลงไป
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
AddType application/x-httpd-php .php3

การ Start,Stop Apache
กระทำโดยการใช้ command
apachectl start หรือ Apachectl stop