吴贺华 发表于 2015-8-20 13:48:33

linux lamp服务器安装配置

  1 安装Apache服务器
yum-y installhttpdhttpd-devel
  2安装mysql
yum -y installmysql 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   修改防火墙规则
# iptables -F
# service iptables save
iptables:将防火墙规则保存到 /etc/sysconfig/iptables:[确定]
# service iptables stop
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则:[确定]
iptables:正在卸载模块:[确定]

# vi /etc/selinux/config
设置
SELINUX=disabled
  
6启动APACHE
apche启动,提示错误
# apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
httpd (pid 18265) already running
修改配置文件
# vi /etc/httpd/conf/httpd.conf
设置行号:set nu大概276行
ServerName www.example.com:80取消注释
# apachectl restart
  
测试地址:192.168.214.42,OK
  7测试php
# cd /var/www/html
# vi index.php
<?php
phpinfo();
?>

测试地址:192.168.214.42,OK
  
  大功告成!
  
提升性能,安装zend
# wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh   注意:是大O
# yum install php-zend-optimizer,安装失败
  
页: [1]
查看完整版本: linux lamp服务器安装配置