[{"data":1,"prerenderedAt":71},["ShallowReactive",2],{"article-21":3},{"code":4,"msg":5,"data":6,"count":14},200,"查询成功",{"id":7,"title":8,"keywords":9,"description":10,"category_id":11,"content":12,"body_html":13,"thumb_up":14,"clicks":15,"sort":14,"remark":16,"status":17,"is_open":17,"is_deleted":14,"is_top":14,"is_recommend":14,"create_time":18,"update_time":19,"image_id":20,"url":13,"member_id":14,"cate_name":21,"prev":22,"next":25,"tags":28,"words":44,"read_time":45,"comments":14,"cover":46,"relevant":47},21,"Cenos7.2下安装Apache2.4，MySQL5.7和PHP7.1","linux;php;web;apache","一、主要软件：1、SecureCRT 5.1：是一款支持SSH（SSH1和SSH2）的终端仿真程序，简单地说是Windows下登录UNIX或Linux服务器主机的软件。2、WinSCP：是一个Windows环境下使用SSH的开源图形化SFTP客户端。同时支持SCP协议。它的主要功能就是在本地与远程计算机间安全的复制文件。winscp也可以链接其他系统,比如linux系统。以上两款软件的具体使用可以通过搜索引擎分分钟查到。",4,"##### 一、主要软件：\n\n1、SecureCRT 5.1：是一款支持SSH（SSH1和SSH2）的终端仿真程序，简单地说是Windows下登录UNIX或Linux服务器主机的软件。\n\n2、WinSCP：是一个Windows环境下使用SSH的开源图形化SFTP客户端。同时支持SCP协议。它的主要功能就是在本地与远程计算机间安全的复制文件。winscp也可以链接其他系统,比如linux系统。\n\n以上两款软件的具体使用可以通过搜索引擎分分钟查到。\n\n##### 二、安装相关软件\n\n1、升级yum\n\n```bash\nyum -y update \u002F\u002F升级所有包，改变软件设置和系统设置,系统版本内核都升级\nyum -y upgrade \u002F\u002F升级所有包，不改变软件设置和系统设置，系统版本升级，内核不改变\n```\n2、安装Apache2.4\n\n```bash\nyum install -y httpd \u002F\u002F安装全新的Apache\n```\n打开Apache配置文件：\n\n```bash\nvi \u002Fetc\u002Fhttpd\u002Fconf\u002Fhttpd.conf\n```\n修改ServerName后面为localhost或者127.0.0.1\n\n启动：\n\n```bash\nsystemctl start httpd\n```\n查看是否启动：\n\n```bash\nsystemctl status httpd\n```\n重启Apache：\n\n```bash\nsystemctl restart httpd\n```\n设置为开机启动\n\n```bash\nchkconfig httpd on\n```\n3、安装MySQL5.7\n\n安装MySQL源：\n\n```bash\nyum localinstall http:\u002F\u002Fdev.mysql.com\u002Fget\u002Fmysql57-community-release-el7-7.noarch.rpm\n```\n安装MySQL:\n\n```bash\nyum install mysql-community-server\n```\n启动:\n\n```bash\nsystemctl start mysqld\n```\n查看状态：\n\n```bash\nsystemctl status mysqld\n```\n获取初始密码：\n\n```bash\ngrep 'temporary password' \u002Fvar\u002Flog\u002Fmysqld.log\nroot@localhost:后面的就是初始密码\n```\n进入MySQL:\n\n```bash\nmysql -uroot -p\n```\n修改密码：\n\n```bash\nALTER USER 'root'@'localhost' IDENTIFIED BY '你的密码'; \u002F\u002F(密码要包含大写，小写，特殊符号，数字等，复杂点最好，不然会报错)\n```\n开放远程访问：\n\n```bash\nuse mysql;\nupdate user set host = '%' where user = 'root';\u002F\u002F %表示全部放行，也可以设置为特定的ip，比如\n192.168.25.36。\n```\n立即生效：\n\n```bash\nflush privileges;\n```\n4、安装PHP7.1\n\nPHP需要很多依赖包，一般使用源码安装比较好点，先到PHP官网下载php-7.1.12.tar.gz，然后通过winscp上传到\u002Fvar\u002Fsrc文件夹中，（var文件夹中没有src文件夹的可以通过 mkdir src在var下创建）.\n\n解压PHP压缩包：\n\n```bash\ntar -zxvf php-7.1.12.tar.gz\n```\n然后进入解压包：\n\n```bash\ncd php-7.1.12\n```\n安装gcc:\n\n```bash\nyum install gcc\n```\n安装PHP的依赖包：\n\n```bash\nyum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel \nzlib zlib-devel curl curl-devel openssl openssl-devel\nyum -y install libxslt-devel* \nyum -y install perl* \nyum -y install httpd-devel\n```\n配置依赖以及php的安装路径：\n\n```bash\n.\u002Fconfigure --prefix=\u002Fusr\u002Flocal\u002Fphp --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir \\\n--with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql \\\n--with-pdo-sqlite --with-pear --with-png-dir --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath \\\n-enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl \\\n--enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-zip --enable-pcntl --with-curl \\\n--with-fpm-user=nginx --enable-ftp --enable-session --enable-xml --with-apxs2=\u002Fusr\u002Fbin\u002Fapxs\n```\n编译安装：\n\n```bash\nmake && make install\n```\n配置环境变量：\n\n```bash\nvi \u002Fetc\u002Fprofile\n```\n在最后面添加：\n\n```bash\nPATH=$PATH:\u002Fusr\u002Flocal\u002Fphp\u002Fbin\nexport PATH\n```\n改动立即生效：\n\n```bash\nsource \u002Fetc\u002Fprofile\n```\n生成所需文件：\n\n```bash\ncp php.ini-production \u002Fusr\u002Flocal\u002Fphp\u002Fetc\u002Fphp.ini\ncp sapi\u002Ffpm\u002Fphp-fpm \u002Fusr\u002Flocal\u002Fphp\u002Fetc\u002Fphp-fpm\ncp \u002Fusr\u002Flocal\u002Fphp\u002Fetc\u002Fphp-fpm.conf.default \u002Fusr\u002Flocal\u002Fphp\u002Fetc\u002Fphp-fpm.conf\ncp \u002Fusr\u002Flocal\u002Fphp\u002Fetc\u002Fphp-fpm.d\u002Fwww.conf.default \u002Fusr\u002Flocal\u002Fphp\u002Fetc\u002Fphp-fpm.d\u002Fwww.conf\n```\n再次修改Apache配置文件：\n\n```bash\nvi \u002Fetc\u002Fhttpd\u002Fconf\u002Fhttpd.conf\n```\n找到：\n\n```bash\nAddType application\u002Fx-compress .Z\nAddType application\u002Fx-gzip .gz .tgz\n```\n添加：\n\n```bash\nAddType application\u002Fx-httpd-php .php\nAddType application\u002Fx-httpd-php-source .php7\n```\n找到：\n\n```bash\nDirectoryIndex index.html\n```\n后面添加index.php:\n\n```bash\nDirectoryIndex index.html index.php\n```\n在配置的最后添加：\n\n```bash\nLoadModule php7_module modules\u002Flibphp7.so\n```\n最后配置域名：\n\n```bash\nDocumentRoot \u002Fvar\u002Fwww\u002Fhtml\nServerName www.你的域名.com\nServerAlias 你的域名.com\nOptions +Indexes +FollowSymLinks +ExecCGI\nAllowOverride All\nOrder Deny,Allow\nAllow from all\n```\n重启Apache。\n\n测试：\n\n在\u002Fvar\u002Fwww\u002Fhtml下创建index.php\n\nindex.php代码：\n\n```bash\nphpinfo();\n```\n用域名访问查看打开是不是php配置。\n\nphp的配置文件路径：\u002Fusr\u002Flocal\u002Fphp\u002Fetc中\n",null,0,490,"",1,"2019-01-17 22:48:15","2026-04-19 15:14:20",133,"Linux",{"id":23,"title":24},20,"cenos 7下安装SVN以及同步代码到WEB目录",{"id":26,"title":27},22,"JavaScript常见排序之快速排序",[29,32,35,38,41],{"id":30,"name":31},25,"PHP",{"id":33,"name":34},41,"服务",{"id":36,"name":37},38,"Apache",{"id":39,"name":40},26,"MySQL",{"id":42,"name":43},37,"Centos7",2709,6,"https:\u002F\u002Ftp.myong.top\u002Fstorage\u002Farticle\u002Fbe\u002F7eb81eb8c1826e0eb5671b64818cf3.jpg",[48,53,58,63,68],{"id":49,"title":50,"create_time":51,"description":52},53,"Linux环境下Apahce的调优","2019-05-21 14:04:03","整理了部分有关Apahce调优的配置说明，后续陆续的将所有调优方式更新。",{"id":54,"title":55,"create_time":56,"description":57},50,"虚拟机安装Centos7后配置网络","2019-03-26 20:37:33","VMware虚拟机上安装min版的Centos7，并配置网络。虚拟机和centos7的安装在本文不做相关的介绍。",{"id":59,"title":60,"create_time":61,"description":62},85,"Linux环境PHP解压缩ZipArchive中的extractTo()方法，解压zip时文件丢失的问题","2020-04-30 17:17:44","在实际项目中要用ZipArchive解压ZIP文件，起初測试环境在Win环境中，測试通过，换到 LINUX 的环境中时  就出问题了（ZIP包中有文件和目录，包含带汉字的文件名称）\r\n\r\n问题的现象是：不带汉字的文件解压没有问题，另外有部分带汉字和数字字母的文件解压没有问题，然后其它纯文字的文件名称就丢失了，也没有报错，最后把问题定位到了extractTo()方法，这种方法是个封装的方法，看不到实际的源码。 \r\n\r\n经Google一番后，发现使用` getNameIndex `和` numFiles `",{"id":64,"title":65,"create_time":66,"description":67},78,"Centos7安装Docker","2019-12-28 14:17:23","### 安装docker\n\n安装命令\n\n``` bash\nyum install docker\n```\n\n启动docker并设置为开机启动\n\n``` bash\nservice docker start\nchkconfig docker on\n```\n\nLCTT 译注：此处采用了旧式的 sysv 语法，如采用CentOS 7中支持的新式 systemd 语法，如下：\n\n``` bash\nsystemcty start docker.service\nsystemcty enable docker.s",{"id":23,"title":24,"create_time":69,"description":70},"2019-01-17 22:46:50","该文章主要介绍给cenos 7下安装SVN以及同步代码到WEB目录。",1783431670435]