系统命令
1.查看sentOS7.2系统版本信息的命令
命令:[root@LAMP1 config]#
cat /etc/redhat-release
结果:[root@LAMP1 config]#
CentOS Linux release 7.2.1511 (Core)
使用 file /bin/ls
[root@LAMP1 config]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
使用uname -a/uname -r
使用
# cat /proc/version
Linux version 3.10.0-327.10.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Tue Feb 16 17:03:50 UTC 2016
2.查看64位还是32位:
[root@LAMP1 config]
更改sentOS7.2命令行样式
1)登录服务器后cd ~
2)vim .bashrc
3)在文件中最后加入PS1='\[\033[01;37m\]|--\[\033[01;32m\]\u\[\033[31m\]@\[\033[34m\]\h\[\033[00m\]:\[\033[01;33m\]\w \[\033[01;37m\]--| \$ '
*注:隐藏IP地址PS1='\[\033[01;37m\]|--\[\033[01;32m\]\u\[\033[31m\]@\[\033[00m\]:\[\033[01;33m\]\w \[\033[01;37m\]--| \$ '
4)reboot 重启linux系统;
5)重启后可以看到带颜色的文件夹全路径。
sentOS7.2安装apache后配置都正确,域名无法访问时,极有可能时防火墙的问题:
sentOS7.2安装php
1、先删除之前的php版本
yum remove php* php-common
2、rpm 安装 Php7 相应的 yum源:
[root@iZ23d ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Retrieving https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
warning: /var/tmp/rpm-tmp.LhJKKR: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY
Preparing... ################################# [100%]
package webtatic-release-7-3.noarch is already installed
3、 直接yum安装php7:
[root@iZ23d ~]# yum install php70w
Loaded plugins: langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Resolving Dependencies
--> Running transaction check
。。。 【省略】
Warning: RPMDB altered outside of yum.
Installing : php70w-common-7.0.0-1.w7.x86_64 1/3
Installing : php70w-cli-7.0.0-1.w7.x86_64 2/3
Installing : php70w-7.0.0-1.w7.x86_64 3/3
Verifying : php70w-7.0.0-1.w7.x86_64 1/3
Verifying : php70w-common-7.0.0-1.w7.x86_64 2/3
Verifying : php70w-cli-7.0.0-1.w7.x86_64 3/3
Installed:
php70w.x86_64 0:7.0.0-1.w7
Dependency Installed:
php70w-cli.x86_64 0:7.0.0-1.w7 php70w-common.x86_64 0:7.0.0-1.w7
Complete!
4、检查 php 版本:
[root@iZ23d ~]# php -v
PHP 7.0.0 (cli) (built: Dec 2 2015 20:42:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
[root@iZ23d2e6hoqZ ~]#
以上显示安装成功!
5、重启 Apache,查看 phpinfo :
[root@iZ23d ~]# systemctl restart httpd.service