以下内容是经过测试的,可放心按步骤来安装。
查看当前服务器版本
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/
- 前言
- 阿里图标库使用
- LAMP环境安装
- 数据库
- MYSQL
- 安装
- Mysql导出导入
- 修改最大连接数
- Mysql慢查寻
- 查看MYSQL占用空间
- 严格模式
- 数据库模式
- mysql权限
- MongoDB
- Redis
- 服务器
- PHP5.4安装
- svnmanager
- linux修改端口22
- 打包忽略文件
- 远程复制文件
- 查看目录大小
- zendloader
- Apache负载
- Memcache
- svn远程同步
- 服务器参数调整
- 内存占满
- PHP调用Java
- Apache重写
- 禁用selinux
- SFTP 子系统申请已拒绝
- Gitlab
- 硬盘挂载
- gitlab修改密码
- oneapm
- SVN安装
- .gitlab-ci.yml
- Nginx重写 html to php
- 添加到环境变量
- supervisor常驻任务
- .gitlab-ci.yml
- crontab.sh
- PEAR
- java jenkins
- Mongo
- 解决unix:///tmp/supervisor.sock no such file的问题
- 登录日志
- tail -f
- git remote
- 开发需知
- Sublime开发工具
- 文档生成工具
- PHP代码注释标准
- http网站自动跳转到https
- PHP只保留错误提示。
- window刷新DNS
- 网站慢
- Centos安全
- 临时代码
- SVNHOOK
- mariadb
- git
- gitlab-runner
- Sublime3设置注释
- Vue开发
- 安装
- v-cloak
- 错误处理
- failed to connect 443
- JavaScriptURL请求乱码
- 内容管理系统
- WordPress
- 支付相关
- 银联
- Angularjs
- 安装环境
- 报错处理
- centos7在upgrade的时候显示:Delta RPMs disabled....详见内容?
- yum-complete-transaction command not find
- hadowsocks
- vpn
- Laravel
- 安装
- ngnix-config
- 使用私有git的composer
- Crontab防止多次执行
- JS
- mui storage
- RTMP