ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
以下内容是经过测试的,可放心按步骤来安装。 查看当前服务器版本 lsb_release -a svn 删除所有的 .svn文件 find . -name .svn -type d -exec rm -fr {} \; ### rz lz上传下载文件,可选安装 yum install lrzsz ### 查文件内容 find . | xargs grep -ri "IBM" [ 阿里云挂载硬盘](https://help.aliyun.com/document_detail/25426.html?spm=5176.11065259.1996646101.searchclickresult.26a41cefyUkmzy) [阿里云空间满了处理](https://help.aliyun.com/knowledge_detail/42531.html#%E5%83%B5%E5%B0%B8%E6%96%87%E4%BB%B6%E5%88%86%E6%9E%90%E5%88%A0%E9%99%A4) 遍历寻找0字节的文件,并删除。 sudo find /home -type f -size 0 -exec rm {} \; ## opcache yum install php-pecl-zendopcache ## webbench wget http://home.tiscali.cz/cz210552/distfiles/webbench-1.5.tar.gz tar -xvzf webbench-1.5.tar.gz # 安装PHP ### CentOS/RHEL 7.x: rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm ### CentOS/RHEL 6.x: rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm 安装PHP7.1及OPACHE: yum install mod_php71w php71w-opcache php-fpm: yum install php71w-fpm php71w-opcache 一键安装所有扩展 yum install php71w-* --skip-broken # MYSQL CentOS/RHEL 7.x: wget http://repo.mysql.com/mysql57-community-release-el7.rpm rpm -ivh mysql-community-release-el7-5.noarch.rpm yum install -y mysql-server mysql mysql-deve systemctl start mysqld.service 查看密码 grep 'temporary password' /var/log/mysqld.log 修改密码 mysql_secure_installation # MYSQL CentOS/RHEL 6.x: wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm rpm -ivh mysql-community-release-el6-5.noarch.rpm yum install -y mysql-server mysql mysql-deve systemctl start mysqld.service dns 查看 nslookup -q=ns doamin * 设置root密码。 mysql -uroot -p use mysql; update user set password=password('pwd123') where user='root'; * 或开机自启动。 vim /etc/rc.local #### NGNIX (apache | ngnix只需安装一个,建议安装 ngnix) yum remove httpd* yum install nginx 打开配置 vim /etc/nginx/nginx.conf 修改server location / { root /usr/share/nginx/html; index index.html index.php; } location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } ##### 使用命令关闭占用80端口的程序,如遇nginx启动不了的情况,执行下面命令 sudo fuser -k 80/tcp ### 自启动,然后重启系统 `reboot` chkconfig nginx on chkconfig mysqld on chkconfig php-fpm on * 执行以上命令一般直接通过 * 正在启动 php-fpm:cannot get uid for user 'apache' * 解决办法: vi /etc/php-fpm.d/www.conf 找到以下两行: user = apache group = apache 将其中的apache都改为`nginx`。 ### 网站根目录 /usr/share/nginx/html ### 常用命令 ps aux|grep php-fpm service nginx restart service php-fpm start #启动 service php-fpm restart #重启 systemctl restart mysqld.service * php session 目录可写 chmod -R 777 /var/lib/php/session ------------------------------------------------------------------------ ### 以下内容可跳过 ------------------------------------------------------------------------ #### APACHE (apache | ngnix只需安装一个,建议安装 ngnix) yum install httpd httpd-devel * 安装完成后,用`/etc/init.d/httpd start` 启动apache * 设为开机启动: `chkconfig httpd on ` ### yum mysql 默认密码,及开启远程登录 grep 'temporary password' /var/log/mysqld.log SET PASSWORD = PASSWORD('密码'); GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION; flush privileges; ### mysql忘记root密码 vim /etc/my.conf [mysqld] 下面加上: skip-grant-tables 重启mysql service mysqld restart; update mysql.user set password=password('test') where user= 'root'; flush privileges; ### 支持的列表 | Package | Provides | | --- | --- | | mod_php71w | php71w, mod_php, php71w-zts | |php71w-bcmath | | |php71w-cli |php-cgi, php-pcntl, php-readline| |php71w-common| php-api, php-bz2, php-calendar, php-ctype, php-curl, php-date, php-exif, php-fileinfo, |php-filter|, php-ftp, php-gettext, php-gmp, php-hash, php-iconv, php-json, php-libxml, php-openssl, php-pcre, php-pecl-Fileinfo, php-pecl-phar, php-pecl-zip, php-reflection, php-session, php-shmop, php-simplexml, php-sockets, php-spl, php-tokenizer, php-zend-abi, php-zip, php-zlib| |php71w-dba || |php71w-devel || |php71w-embedded| php-embedded-devel| |php71w-enchant || |php71w-fpm || |php71w-gd || |php71w-imap || |php71w-interbase| php_database, php-firebird| |php71w-intl|| |php71w-ldap || |php71w-mbstring || |php71w-mcrypt || |php71w- | php-mysqli, php_database| |php71w-mysqlnd| php-mysqli, php_database| |php71w-odbc| php-pdo_odbc, php_database| |php71w-opcache| php71w-pecl-zendopcache| |php71w-pdo |php71w-pdo_sqlite, php71w-sqlite3| |php71w-pdo_dblib| php71w-mssql| |php71w-pear || |php71w-pecl-apcu || |php71w-pecl-imagick || |php71w-pecl-memcached || |php71w-pecl-mongodb || |php71w-pecl-redis || |php71w-pecl-xdebug || |php71w-pgsql| php-pdo_pgsql, php_database| |php71w-phpdbg | |php71w-process| php-posix, php-sysvmsg, php-sysvsem, php-sysvshm| |php71w-pspell || |php71w-recode || |php71w-snmp || |php71w-soap || |php71w-tidy || |php71w-xml |php-dom, php-domxml, php-wddx, php-xsl| |php71w-xmlrpc || ### https://webtatic.com/packages/php71/