ติดตั้ง web server บน Centos 5


เป็นการติดตั้ง Apache2, PHP5 และ MySQL5 บน CentOS 5+ server โดยใช้ Yum

ติดตั้ง packet ต่างๆ
yum -y install httpd php mysql mysql-server php-mysql

กำหนด password สำหรับ root ของ MySQL

/etc/init.d/mysql start
mysqladmin -u root password 'ENTER-PASSWORD-HERE'

จากนั้นก็กำหนดให้ Service ต่างๆทำงานตอนเปิดเครื่องและพร้อมในการทำงานเดี๋ยวนี้

/sbin/chkconfig httpd on
/sbin/chkconfig --add mysqld
/sbin/chkconfig mysqld on
/sbin/service httpd start
/sbin/service mysqld start

ทดสอบ php โดยการสร้างเพจขึ้นมาไว้ที่ /var/www/html ซึ่งเป็น directory พื้นฐานของ web server ใน centos
<?php echo phpinfo(); ?>

ที่มา : http://www.tutorialized.com/view/tutorial/Install-Apache2-PHP5-MySQL5-with-Yum-on-CentOS/37630


Comments

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • HTML tags will be transformed to conform to HTML standards.

More information about formatting options

CAPTCHA
คำถามนี้ทดสอบว่าคุณมีความรู้ทางคณิตศาสตร์ ไม่ได้โง่!!!
16 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.