1 安装Apache服务器
yum -y install httpd httpd-devel
2 安装mysql
yum -y install mysql mysql-server mysql-devel
3 安装php以及其扩展
yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
4 启动mysql
service mysqld start
连接mysql
mysql -uroot -p
登录以后查看mysql
show databases;
5 修改防火墙规则
[[email protected] ~]# iptables -F
[[email protected] ~]# service iptables save
iptables:将防火墙规则保存到 /etc/sysconfig/iptables:[确定]
[[email protected] ~]# service iptables stop
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则:[确定]
iptables:正在卸载模块:[确定]
[[email protected] ~]# vi /etc/selinux/config
设置
SELINUX=disabled
6 启动APACHE
apche启动,提示错误
[[email protected] ~]# apachectl start
httpd: Could not reliably determine the server‘s fully qualified domain name, using localhost.localdomain for ServerName
httpd (pid 18265) already running
修改配置文件
[[email protected] ~]# vi /etc/httpd/conf/httpd.conf
设置行号:set nu 大概276行
ServerName www.example.com:80取消注释
[[email protected] ~]# apachectl restart
测试地址:192.168.214.42 ,OK
7 测试php
[[email protected] ~]# cd /var/www/html
[[email protected] html]# vi index.php
<?php
phpinfo();
?>
测试地址:192.168.214.42 ,OK
大功告成!
提升性能,安装zend
[[email protected] yum.repos.d]# wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh 注意:是大O
[[email protected] yum.repos.d]# yum install php-zend-optimizer,安装失败