標籤:
CentOS 查看作業系統版本
[[email protected] ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)
參考linux centos yum安裝LAMP環境
Yum(全稱為 Yellow dog Updater, Modified)是一個在Fedora和RedHat以及CentOS中的Shell前端軟體包管理器。
基於RPM包管理,能夠從指定的伺服器自動下載RPM包並且安裝,可以自動處理依賴性關係,並且一次安裝所有依賴的軟體包,無須繁瑣地一次次下載、安裝。
1、更新一下yum
[[email protected] ~]# yum -y update
2、用yum安裝Apache,Mysql,PHP
安裝Apache:
[[email protected] ~]# yum install httpd httpd-devel
安裝完成後, 啟動apache
[[email protected] ~]# /etc/init.d/httpd start
Starting httpd: httpd: apr_sockaddr_info_get() failed for oa.aioute.com
httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]
設為開機啟動
[[email protected] ~]# chkconfig httpd on
安裝mysql:
[[email protected] ~]# yum install mysql mysql-server mysql-devel
啟動mysql
[[email protected] ~]# /etc/init.d/mysqld start
參考:[CentOS 0010] CentOS 配置mysql允許遠程登入
CentOS下開啟mysql遠端連線,遠端管理資料庫
設定mysql密碼,並開啟遠程許可權:
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘yourpassword‘ WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> EXIT
允許3306連接埠:
[[email protected] ~]# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
[[email protected] ~]# iptables -L -n
安裝php:
yum install php php-devel
重啟apache使php生效:
/etc/init.d/httpd restart
[[email protected] ~]# yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
重新啟動php:
[[email protected] ~]# /etc/init.d/httpd restart
Starting httpd:
3、允許連接埠訪問
[[email protected] ~]# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
[[email protected] ~]# iptables -L -n
參考 centos下vi的用法大全
參考 CentOS配置VSFTP伺服器
CentOS 6.6 yum 搭建LAMP環境