Create an account    
 home  
 
Web www.thaihealth.net
  You are here:> home>topics> linux for newbies > การลง apache ใน redhat2 การตั้งค่าconfigและให้apache run อัตโนมัติ ©
Linux,PHP&MySQL: การลง apache ใน redhat2 การตั้งค่าconfigและให้apache run อัตโนมัติ
Posted on Friday, September 26 @ 03:00:00 GMT+7 by admin

linux for newbies

การปรับแต่งApache บน Redhat

เมื่อครั้งที่แล้วว่าไปถึงลงเสร็จนะครับ ต่อมาคือการปรับแต่งไฟล์ httpd.conf ซึ่งสำคัญมากกับการทำงาน



อ้อ ประเดี๋ยวก่อน เมื่อเรา compile program เสร็จจนถึง #make install แล้วอย่าลืม

# make clean
# cd ..
# rm -rf httpd-2.0.xx

เพื่อเป็นการป้องกันปัญหามีใครมาแอบ compile ใหม่

การปรับแต่ง httpd.conf

จริง ๆ แล้วไฟล์นี้เขาให้มาแล้วครับ แต่ต้องมีการปรับแต่งเล็กน้อย ถ้าเอาแบบเด็ด ๆ คือ (สำหรับ apache 2.0)

ServerType
Server Root ไม่ต้องแก้
timeout 300
keepalive on
อื่น ๆ ไม่ต้องแก้
Listen 80
User nobody
group nobody

ต่อไปจะต้องนำไปอธิบายในกรณีติดตั้ง php ด้วยและลง virtual server + mod_ssl

การทำให้ apache รันเองเวลาเปิดเครื่อง

เมื่อเราลง Apache เสร็จใหม่ ๆ ถ้าอยากรู้ว่ามันทำงานได้เปล่า ให้ใช้คำสั่ง

# /usr/local/apache2/bin/apachectl start

# ps -ef | grep httpd จะต้องเห็น process ของ httpd

ทีนี้ละมาถึงตอนสำคัญ เราจะเอา apachectl ไปไว้ที่ init.d เพื่อให้มันสตาร์ทเวลาเปิด server เลย

# cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd2

# cd /etc/rc3.d

# ln -s ../init.d/httpd2 S85httpd2
#ln -s ../init.d/httpd2 K85httpd2
# cd /etc/rc5.d
# ln -s ../init.d/httpd2 K85httpd2
# ln -s ../init.d/httpd2 S85httpd2

คราวนี้การให้ apache start ก็จะใช้คำสั่งว่า

# /etc/rc.d/init.d/httpd2 restart
หรือ เวลาจะหยุดก็
# /etc/rc.d/init.d/httpd2 stop

อย่าลืมลบไฟล์ apachectl ทิ้งไปเลยได้
# rm /usr/local/apache2/bin/apachectl
แค่นี้เราก็ได้ apache อีกตัวมาไว้กอดสมใจ โดยที่ยังมี apache เดิม (httpd) ของ redhat ยังเหลือให้เราเล่นอีก ถ้าไม่อยากให้ของเก่า run ก็แค่ใช้คำสั่งว่า /etc/rc.d/init.d/httpd stop เป็นไง จะเอากี่ apache ดีล่ะ


blog this


blog this

More about linux for newbies
· apache 2.0.54 has come, see the changes2005-06-25 13:20:47
· apache 2.0.49 released. Try!2004-03-23 12:27:38
· New Linux Server project2003-07-17 11:13:23

Comment Post
1  by
on Sunday, March 16 @ 19:32:58 GMT+7
منتديات [f.jsoftj.com]

Read the rest of this comment...


2  by gaila
on Saturday, January 26 @ 07:53:25 GMT+7
free wallpaper [gallery.newsit.es]




Your Name:

[ New User ]

Subject:


Comment:

Allowed HTML:
<b> <i> <a> <em> <br> <strong> <blockquote> <tt> <li> <ol> <ul>
Security code:



T news tweak
 

       Sponsored Links
       Related Links
· More about linux for newbies
· News by admin


Most read story about linux for newbies:
 New Linux Server project(4466)

       Article Rating
Average Score: 0
Votes: 0

Please take a second and vote for this article:

Excellent
Very Good
Good
Regular
Bad


       Options

 Printer Friendly  Printer Friendly

 Send to a Friend  Send to a Friend

News ©

เล่นเกมส์ arcade games free!

main sitethaihealth | home | forums | downloads | topics

Seo from our desk thai seo
Web site engine code is Copyright © 2003 by PHP-Nuke.Copyright 2007 Thaihealth and pattaya doctor
Page Generation: 0.238 Seconds

Theme developed by WebDesignHQ.com Modified By DoctorNUKE