1.升级系统
yum -y update
2. 安装tools
注:参考地址----> http://www.cnblogs.com/roooookie/p/8473640.html
1. yum -y install perl gcc gcc-c++ make cmake kernel kernel-headers kernel-devel net-tools
2. 安装tools
2. vmhgfs-fuse .host:/htdocs /mnt/hgfs
最小化安装tools工具
http://www.cnblogs.com/roooookie/p/8473640.html
https://bbs.csdn.net/topics/392053153?locationNum=2&fps=1
//这两个不知道干啥,可以作参考
vmhgfs-fuse .host:/htdocs /mnt/hgfs
mount -t vmhgfs .host:/htdocs /mnt/hgfs
1.安装nginx
yum install gcc-c++
yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel
yum -y install pcre-devel zlib zlib-devel openssl openssl-devel
./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
make && make install
useradd -M -s /sbin/nologin nginx
#修改nginx配置文件
vim /usr/local/nginx/conf/nginx.conf
把#user nobody 改成 user nginx;
#测试一下nginx配置文件
/usr/local/nginx/sbin/nginx -t
#启动nginx
/usr/local/nginx/sbin/nginx
#一般来说在nginx的配置文件修改后进行如下操作,
/usr/local/nginx/sbin/nginx -t检测一下配置文件是否正确,如果正确的话
再使用/usr/local/nginx/sbin/nginx -s reload 使nginx平滑启动
2.安装php
参考:
https://blog.csdn.net/qq_39629343/article/details/81807577
## yum provides php
#更新源 rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
## rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#移除系统自带的php-common yum remove php-common
yum remove php*
rpm -qa|grep php
#安装php7.2: yum -y install php72w* --skip-broken
或者 yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
或者源码编译: ./configure --prefix=/usr/local/php --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-freetype-dir --enable-mbstring --with-iconv-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-ftp --with-gd --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx
卸载 xdebug(不然swoole没法用)
1.搜索xdebug yum search xdebug
2. 移除xdeug rpm -e php72w-pecl-xdebug-2.6.0-1.w7.x86_64
3. 安装swoole
方式一: pecl install swoole
方式二: https://blog.csdn.net/chhnang2016/article/details/81011576
3. 安装mysql
cd /etc/yum.repos.d/
vim MariaDB.repo
{
# MariaDB 10.3 CentOS repository list - created 2019-02-15 15:50 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
}
yum install MariaDB-server MariaDB-client
systemctl start mariadb
mysql_secure_installation