使用YUM安裝LAMP全過程
作者:bocai2015
使用YUM安裝LAMP。LAMP的意思是Linux-Apache-MySQL-PHP,LAMP網站架構是目前國際流行的Web框架,他具有Web資源豐富、輕量、快速開發等特點。如何使用YUM安裝LAMP呢?
使用YUM安裝LAMP:
apache
- yum install httpd httpd-devel
- etc/init.d/httpd start
mysql
- yum install mysql mysql-server mysql-devel
- /etc/init.d/mysqld start
設置密碼
- mysql> USE mysql;
- mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
- mysql> FLUSH PRIVILEGES;
登陸
- mysql -u root -p
- Enter Password:
創建一個用戶管理數據庫
- mysql > create database demo
- mysql >GRANT ALL PRIVILEGES ON demo.* TO 'guest'@'localhost' IDENTIFIED BY 'guest' WITH GRANT OPTION;
- mysql> UPDATE user SET Password=PASSWORD('guest') WHERE user='guest';
安裝php
- yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
- etc/init.d/httpd restart
設置開機啟動
- chkconfig httpd on
- chkconfig mysqld on
【編輯推薦】
責任編輯:zhaolei
來源:
javaeye