4.26-alias别名php
Alias别名:
一条命令的另一个名字,你能够理解为外号。
举例:
alias ls='/usr/bin/ls --color=auto'
网卡配置文件路径很长,每次敲这个命令都要花很长时间,能够作一个别名:
alias viens33='vi /etc/sysconfig/network-scripts/ifcfg-ens33'
配置文件做用域:
vi ~/.bashrc //针对当前用户的,换一个用户就很差使了
vi /etc/bashrc //针对全部用户,不单单是当前用户。
在这个文件最后面增长:alias viens33='vi /etc/sysconfig/network-scripts/ifcfg-ens33'html
4.27--29 php编译安装
下载PHP
cd /usr/local/src
wget http://cn2.php.net/distributions/php-7.3.0.tar.bz2
解压
tar jxvf php-7.3.0.tar.bz2
编译
cd php-7.3.0
编译参数:
./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl
make
make install
配置文件:
cd /usr/local/php-fpm/
cp php-fpm.conf.default php-fpm.conf
cd /usr/local/src/php-7.3.0
cp php.ini-development /usr/local/php-fpm/etc/php.ini
cd /usr/local/php-fpm/etc/php-fpm.d/
cp www.conf.default www.conf
启动脚本:
cd /usr/local/src/php-7.3.0
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
chmod 755 /etc/init.d/php-fpm
补充:
vi 里面在通常模式下,按dd能够删除行(剪切),5dd(剪切5行),光标挪到要粘贴的位置,按p。
操做错误以后,想要撤销,能够按u,反着撤销按 ctrl r;
通常模式下按gg能够把光标定位到首行,按G能够定位到末行;
按yy复制,5yy复制5行;
显示行号,在通常模式里输入:set nu;
定位到指定的行:通常模式下直接按数字G,如10G
编译安装一个软件包的步骤:
./configure ; make; make install
grep -i 忽略大小写
错误1:
checking for cc... no
checking for gcc... no
解决: yum install -y gcc
错误2:
error: libxml2 not found
解决:yum install -y libxml2-devel
错误3:
error: Cannot find OpenSSL's
解决:yum install -y openssl-devel
错误4:
error: cURL version 7.15.5 or later is required
解决:yum install -y libcurl-devel
错误5:
configure: error: jpeglib.h not found
解决:yum install -y libjpeg-turbo-devel
错误6:
configure: error: png.h not found
解决:yum install -y libpng-devel
错误7:
configure: error: freetype-config not found.
解决: yum install -y freetype-devel
错误8:
configure: error: wrong mysql library version or lib not found
解决:下载一个低版本的MySQL/Mariadb
wget http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
tar jxvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.6.39-linux-glibc2.12-x86_64 /usr/local/mysql5.6
改编译参数
./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=/usr/local/mysql5.6 --with-mysqli=/usr/local/mysql5.6/bin/mysql_config --with-pdo-mysql=/usr/local/mysql5.6 --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --with-pear --with-curl --with-openssl
错误9:
ERROR: [pool www] cannot get uid for user 'php-fpm'
解决:useradd php-fpm
补充:
diff 查看两个文件的差别的,如 diff 1.txt 2.txtmysql
4.28-php编译安装2
4.29-php编译安装3linux
4.30-编译安装Nginx
官网:http://nginx.org/
官方文档:http://nginx.org/en/docs/install.html
下载:
wget http://nginx.org/download/nginx-1.14.2.tar.gz
解压:
tar zxvf nginx-1.14.2.tar.gz
cd nginx-1.14.2
编译:
./configure --prefix=/usr/local/nginx --with-http_ssl_module
make && make install
启动:
/usr/local/nginx/sbin/nginxnginx