[root@localhost ~]# vim/etc/sysconfig/network-scripts/ifcfg-ens192
BOOTPROTO=static
ONBOOT=yes
IPADDR0=
PREFIX0=16
GATEWAY0=
DNS1=
DNS2=
[root@localhost ~]# service network restart
[root@localhost ~]# mkdir /media/cdrom
[root@localhost ~]# mount -t iso9660 -o loop/dev/cdrom /media/cdrom
[root@localhost ~]# ls /media/cdrom
[root@localhost ~]# vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Dec 20 10:25:37 2015
#
# Accessible filesystems, by reference, are maintainedunder '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/orblkid(8) for more info
#
/dev/mapper/rhel-root / xfs defaults 11
UUID=db9f48c6-e240-417f-8d4d-916a1f91565d /boot xfs defaults 1 2
/dev/mapper/rhel-swap swap swap defaults 0 0
/usr/local/src/rhel-server-7.0-x86_64-dvd.iso /media/cdrom iso9660 defaults,ro,loop 0 0
[root@localhost ~]# df -T
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# touch rhel-media.repo
[root@localhost yum.repos.d]# vim rhel-media.repo
[rhel-media]
name=Red Hat Enterprise Linux 7.0
baseurl=file:///media/cdrom
enabled=1
gpgcheck=1
gpgkey=file:///media/cdrom/RPM-GPG-KEY-redhat-release
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
[root@localhost yum.repos.d]# systemctl stopfirewalld.service
[root@localhost yum.repos.d]# systemctl disablefirewalld.service
[root@localhost yum.repos.d]# yum install iptables
[root@localhost yum.repos.d]# cd /usr/local/src
[root@localhost src]# ls
apr-1.5.2.tar.gz apr-util-1.5.4.tar.gz httpd-2.4.18.tar.gz mysql-5.7.10-1.el7.i686.rpm-bundle.tar php-5.6.9.tar.gz
[root@localhost src]# tar -zxvf httpd-2.4.18.tar.gz
[root@localhost src]# tar -zxvf apr-1.5.2.tar.gz
[root@localhost src]# tar -zxvf apr-util-1.5.4.tar.gz
[root@localhost src]# mv httpd-2.4.18 httpd
[root@localhost src]# mv apr-1.5.2 apr
[root@localhost src]# mv apr/ ./httpd/srclib/
[root@localhost src]# ls ./httpd/srclib/
[root@localhost src]# mv apr-util-1.5.4./httpd/srclib/apr-util
[root@localhost src]# yum remove httpd
[root@localhost src]# yum install pcre-devel
[root@localhost src]# yum install gcc
[root@localhost src]# cd httpd/
[root@localhost httpd]# ./configure--prefix=/usr/local/httpd
[root@localhost httpd]# make && make install
[root@localhost httpd]# vim/usr/local/httpd/conf/httpd.conf
#ServerName www.example.com:80
ServerName localhost:80
[root@localhost httpd]# /usr/local/httpd/bin/apachectlrestart
[root@localhost httpd]# vim /etc/rc.local
touch /var/lock/subsys/local
/usr/local/httpd/bin/apachectl start
[root@localhost httpd]# pwd
/usr/local/src/httpd
[root@localhost httpd]# vim /usr/local/httpd/conf/httpd.conf
Options Indexes FollowSymLinks 修改为: Options -Indexes+FollowSymLinks
#禁止访问网站目录(目录列表显示文件)
[root@localhost httpd]# /usr/local/httpd/bin/apachectlrestart
[root@localhost src]# tar -xvf mysql-5.7.10-1.el7.x86_64.rpm-bundle.tar
[root@localhost src]# rpm -ivhmysql-community-client-5.7.10-1.el7.x86_64.rpm
[root@localhost src]# rpm -ivhmysql-community-libs-5.7.10-1.el7.x86_64.rpm
[root@localhost src]# yum remove mariadb-libs
[root@localhost src]# rpm -ivhmysql-community-common-5.7.10-1.el7.x86_64.rpm
[root@localhost src]# rpm -ivhmysql-community-libs-5.7.10-1.el7.x86_64.rpm
[root@localhost src]# rpm -ivhmysql-community-client-5.7.10-1.el7.x86_
[root@localhost src]# rpm -ivhmysql-community-server-5.7.10-1.el7.x86_
[root@localhost src]# cat /etc/passwd | grep mysql
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/false
[root@localhost src]# cat /etc/group | grep mysql
mysql:x:27:
[root@localhost src]# mysql
ERROR 2002 (HY000): Can't connect to local MySQLserver through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost src]# /bin/systemctl start mysqld.service
[root@localhost src]# passwd mysql
[root@localhost src]# vim /etc/my.cnf
pid-file=/var/run/mysqld/mysqld.pid
skip_grant_tables
[root@localhost src]# /bin/systemctl start mysqld.service
[root@localhost src]# mysql -u root -p
mysql>update mysql.user set authentication_string=PASSWORD('A0MDB0NE') whereUser='root';
[root@localhost src]# vim /etc/my.cnf
#skip_grant_tables
[root@localhost src]# /bin/systemctl restart mysqld.service
[root@localhost src]# mysqladmin -u root -p password
[root@localhost src]# mysql -u root -p
[root@localhost src]# yum install libxml2-devel
[root@localhost src]# yum install libjpeg-devel
[root@localhost src]# yum install libpng-devel
[root@localhost src]# yum install freetype-devel
[root@localhost src]# tar -zxvf php-5.6.9.tar.gz
[root@localhost src]# mv php-5.6.9 php
[root@localhost php]# cd php
[root@localhost php]# ./configure--prefix=/usr/local/php/ --with-apxs2=/usr/local/httpd/bin/apxs --with-mysqli--with-mysql --with-gd --with-jpeg-dir --with-freetype-dir --with-png-dir --enable-mbstring--enable-xml --enable-zip --enable-ftp
# --prefix是安装目录, --with-config-file-path是指定php配置文档php.ini做在的目录;--with-mysql是安装mysql扩展,--enable-mbstring --enable-xml 安装mbstring和xml扩展。
[root@localhost php]# make && make install
[root@localhost php]# cp/usr/local/src/php/php.ini-development /usr/local/php/lib/php.ini
[root@localhost php]# cp ./php.ini-production/etc/php.ini
[root@localhost php]# vim/usr/local/httpd/conf/httpd.conf
# /LoadModule是向下查找 LoadModule
LoadModule php5_module modules/libphp5.so
# /DocumentRoot 查找网站根目录
DocumentRoot "/usr/local/httpd/htdocs"
AddType application/x-gzip .tgz
AddType application/x-httpd-php .php
DirectoryIndex index.html ==> DirectoryIndex index.html index.php
[root@localhost php]# /usr/local/httpd/bin/apachectlrestart
[root@localhost php]# vim /usr/local/php/lib/php.ini
#修改php时区。php5默认是格林威治时间,不修改的话与中国时间相差8小时
date.timezone = ==> date.timezone= PRC
[root@localhost php]# /usr/local/httpd/bin/apachectl-k restart
[root@localhost php]# vim/usr/local/httpd/htdocs/phpinfo.php
<?php
phpinfo();
?>
# 测试 http://localhost/phpinfo.php正确显示安装模块信息
[root@localhost php]#