#############创建一个方便快捷实验环境快照###################
配置好静态IP地址,关闭iptables防火墙,关闭selinux,,光盘自动挂载,配置好yum仓库
1 配置IP
[root@xuegod163 ~]# /etc/init.d/NetworkManager stop
[root@xuegod163 ~]# chkconfig NetworkManager off
[root@xuegod163 ~]# ifconfig
-----------------------------------------------------------------------------------
2 防火墙
[root@xuegod163 ~]# service iptables stop #关闭防火墙
[root@xuegod163 ~]# iptables –F #清空防火墙规则
[root@xuegod163 ~]# chkconfig iptables off #设置防火墙开机自动关闭
------------------------------------------------------------------------------------
3 关闭selinux
查看selinux服务开启状态
[root@xuegod163 ~]# getenforce
Disabled
[root@xuegod163 ~]# vim /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
临时强制关闭selinux
[root@xuegod163 ~]# setenforce 0
-------------------------------------------------------------------------------------------
光盘自动挂载
[root@xuegod163 ~]# vim /etc/fstab
/dev/sr0 /mnt iso9660 defaults 0 0
-------------------------------------------------------------------------------------------
配置好yum仓库
[root@xuegod163 ~]# cd /etc/yum.repos.d/
[root@xuegod163 yum.repos.d]# vim rhel-source.repo
[rhel-yum]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///mnt/
enabled=1
gpgcheck=0
yum list
yum clean all
yum repolist
-----------------------------------------------------------------------------------------------
基础环境开发:
[root@XueGod63 ~]# yum install gcc gcc-c++ autoconf automake -y
[root@XueGod63 ~]# yum install zlib zlib-devel openssl openssl-devel -y
--------------------------------------------------------------
yum -y install gcc automake autoconf libtool make
yum -y install gcc gcc-c++ glibc yum -y install libmcrypt-devel mhash-devel libxslt-devel \ libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel \ zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel \ ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel \ krb5 krb5-devel libidn libidn-devel openssl openssl-devel
----------------------------------------------------------
yum install -y cmake ncurses-devel #mysql依赖安装
yum install gcc gcc-c++ autoconf automake -y
yum install zlib zlib-devel openssl openssl-devel -y
----------------------------------------------------------
解决依赖和安装LAP环境
[root@XueGod63 ~]# yum install -y gcc glibc glibc-common php gd gd-devel libpng libmng libjpeg zlib
[root@XueGod63 ~]# yum install -y httpd ; service httpd restart
[root@XueGod63 ~]# yum install http://mirrors.ustc.edu.cn/centos/6.7/os/x86_64/Packages/gd-devel-2.0.35-11.el6.x86_64.rpm
//部分镜像没有gd-devel这个软件包,去Centos镜像去拿下来,或者在线装
[root@XueGod63 ~]# echo "<?php phpinfo(); ?>" >/var/www/html/index.php //测试是否支持php
-------------------------------------------------------------------------------
nginx依赖软件
[root@xuegod62 ~]# yum -y install gcc gcc-* autoconf automake
[root@xuegod62 ~]# yum -y install zlib zlib-* openssl openssl-* pcre pcre-*
----------------------------------------------------------------------------------
1.服务器yum安装lmp
[root@localhost ~]# yum -y install httpd httpd-devel php php-devel php-mysql
2.启动httpd服务
[root@localhost ~]# service httpd restart
3.创建测试网页
[root@localhost ~]# echo 192.168.1.63 > /var/www/html/index.html
[root@localhost ~]# vim /var/www/html/test.php
192.168.1.63
<?php
phpinfo();
?>