- 浏览: 804193 次
- 性别:
- 来自: 南京
文章分类
最新评论
-
xieye:
jetty插件有好几个版本,1.6,1.7,1.8
我选的是用 ...
tapestry入门(翻译)3 导入项目到eclipse -
xieye:
还有,
注:第2部分时,需要先安装jetty,我自己在安装过程 ...
tapestry入门(翻译)3 导入项目到eclipse -
xieye:
说明一下:实际使用中,导入时我并没有错误。2、我把eclips ...
tapestry入门(翻译)3 导入项目到eclipse -
xieye:
其实还是有一些先决条件的。1是外部环境,2是进步是阶段性的(意 ...
(转载文章)如何愉悦起来:一位精神治疗师的见解 -
mandy_yanzi:
我都已经饿7天了坚持为了我的衣衣
身体健康的问题
# 操作系统 centos7.4
# 所谓套件,就是nginx,php7.2最新版本,mysql5.7,redis
这是查看centos版本的命令
cat /etc/redhat-release
# 设置centos的阿里镜像源。
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y wget epel-release
yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y yum-utils
## 设置epel的阿里镜像源。
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum-config-manager --enable remi-php72
# 设置remi 的清华大学镜像源。
yum-config-manager --setopt=remi-php72.baseurl="https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/7/php72/$basearch/" --save
yum-config-manager --setopt=remi-php56.baseurl="https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/7/php56/$basearch/" --save
yum install -y nginx php72 redis zip unzip p7zip rsync crontabs vim supervisor
yum install -y php72-php-devel php72-php-fpm php72-php-mbstring php72-php-memcache php72-php-redis php72-php-mysqli php72-php-mysqlnd php72-php-pdo php72-php-bcmath php72-php-dom php72-php-gd php72-php-gmp php72-php-igbinary php72-php-imagick php72-php-mcrypt php72-php-pdo_mysql php72-php-posix php72-php-simplexml php72-php-opcache php72-php-xsl php72-php-xmlwriter php72-php-xmlreader php72-php-xml php72-php-swoole php72-php-zip php72-php-phalcon php72-php-yaml
ln -s /usr/bin/php72 /usr/bin/php
sed -i 's/user\ =\ apache/user\ =\ nginx/g' /etc/opt/remi/php72/php-fpm.d/www.conf
sed -i 's/group\ =\ apache/group\ =\ nginx/g' /etc/opt/remi/php72/php-fpm.d/www.conf
等效于
vi /etc/opt/remi/php72/php-fpm.d/www.conf
~~~
# user=apche, group=apache改成
user = nginx
group = nginx
~~~
echo "location ~ \.php\$ {root /usr/share/nginx/html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi_params;fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;}" > /etc/nginx/default.d/php.conf
等效于
vi /etc/nginx/default.d/php.conf
~~~
## enable php support ##
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
~~~
vi /usr/share/nginx/html/phpinfo.php
~~~
<?php
phpinfo();
~~~
systemctl enable php72-php-fpm.service
systemctl start php72-php-fpm
systemctl enable nginx.service
systemctl start nginx
systemctl enable redis
systemctl start redis
# 打开浏览器
http://127.0.0.1/phpinfo.php
# 下面一大段 mysql 5.7
wget http://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
yum install -y mysql57-community-release-el7-11.noarch.rpm
yum install -y mysql-community-server
systemctl start mysqld
# 这一步查看到初始密码
grep "password" /var/log/mysqld.log
# 这一步输入刚才的初始密码
mysql -uroot -p
# 以下语句在mysql的shell里执行,最后一句是设置密码
set global validate_password_policy=0;
set global validate_password_mixed_case_count=0;
set global validate_password_number_count=3;
set global validate_password_special_char_count=0;
set global validate_password_length=3;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123');
# 下面这句话去除 mysql在yum仓库的记录,避免每次更新。
yum -y remove mysql57-community-release-el7-11.noarch
# 这句话查看mysql的安装配置
# mysql_config
systemctl stop mysqld
systemctl start mysqld
git 和composer
curl https://setup.ius.io | sh
yum remove -y git
yum install -y git2u
git config --global core.autocrlf false
git config --global core.safecrlf false
git config --global user.name 'test'
git config --global user.email 'test@qq.com'
curl -s http://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/
chmod a+x /usr/local/bin/composer.phar
ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
composer config -g repo.packagist composer https://developer.aliyun.com/composer
=====================================================
关闭防火墙和Selinux
CentOS6
[root@node1 ~]#chkconfig iptables off
[root@node1 ~]#vi /etc/selinux/config
修改:SELINUX=disabled
CentOS7
[root@node1 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@node1 ~]# systemctl stop firewalld
[root@node1 ~]# setenforce 0
[root@node1 ~]# vi /etc/selinux/config
SELINUX=disabled
配置iptables
yum install iptables-services
vim /etc/sysconfig/iptables
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
yum restart iptables
systemctl enable iptables
---------------------
更改镜像源
3.1 安装wget
[root@node1 ~]#yum install -y wget
3.2 下载aliyun的repo
[root@node1 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3.3 更新镜像源
[root@node1 ~]#yum clean all
[root@node1 ~]#yum makecache
---------------------
参考
https://blog.csdn.net/chengyuqiang/article/details/55044073
# 所谓套件,就是nginx,php7.2最新版本,mysql5.7,redis
这是查看centos版本的命令
cat /etc/redhat-release
# 设置centos的阿里镜像源。
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y wget epel-release
yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y yum-utils
## 设置epel的阿里镜像源。
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum-config-manager --enable remi-php72
# 设置remi 的清华大学镜像源。
yum-config-manager --setopt=remi-php72.baseurl="https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/7/php72/$basearch/" --save
yum-config-manager --setopt=remi-php56.baseurl="https://mirrors.tuna.tsinghua.edu.cn/remi/enterprise/7/php56/$basearch/" --save
yum install -y nginx php72 redis zip unzip p7zip rsync crontabs vim supervisor
yum install -y php72-php-devel php72-php-fpm php72-php-mbstring php72-php-memcache php72-php-redis php72-php-mysqli php72-php-mysqlnd php72-php-pdo php72-php-bcmath php72-php-dom php72-php-gd php72-php-gmp php72-php-igbinary php72-php-imagick php72-php-mcrypt php72-php-pdo_mysql php72-php-posix php72-php-simplexml php72-php-opcache php72-php-xsl php72-php-xmlwriter php72-php-xmlreader php72-php-xml php72-php-swoole php72-php-zip php72-php-phalcon php72-php-yaml
ln -s /usr/bin/php72 /usr/bin/php
sed -i 's/user\ =\ apache/user\ =\ nginx/g' /etc/opt/remi/php72/php-fpm.d/www.conf
sed -i 's/group\ =\ apache/group\ =\ nginx/g' /etc/opt/remi/php72/php-fpm.d/www.conf
等效于
vi /etc/opt/remi/php72/php-fpm.d/www.conf
~~~
# user=apche, group=apache改成
user = nginx
group = nginx
~~~
echo "location ~ \.php\$ {root /usr/share/nginx/html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;include fastcgi_params;fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;}" > /etc/nginx/default.d/php.conf
等效于
vi /etc/nginx/default.d/php.conf
~~~
## enable php support ##
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
~~~
vi /usr/share/nginx/html/phpinfo.php
~~~
<?php
phpinfo();
~~~
systemctl enable php72-php-fpm.service
systemctl start php72-php-fpm
systemctl enable nginx.service
systemctl start nginx
systemctl enable redis
systemctl start redis
# 打开浏览器
http://127.0.0.1/phpinfo.php
# 下面一大段 mysql 5.7
wget http://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
yum install -y mysql57-community-release-el7-11.noarch.rpm
yum install -y mysql-community-server
systemctl start mysqld
# 这一步查看到初始密码
grep "password" /var/log/mysqld.log
# 这一步输入刚才的初始密码
mysql -uroot -p
# 以下语句在mysql的shell里执行,最后一句是设置密码
set global validate_password_policy=0;
set global validate_password_mixed_case_count=0;
set global validate_password_number_count=3;
set global validate_password_special_char_count=0;
set global validate_password_length=3;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123');
# 下面这句话去除 mysql在yum仓库的记录,避免每次更新。
yum -y remove mysql57-community-release-el7-11.noarch
# 这句话查看mysql的安装配置
# mysql_config
systemctl stop mysqld
systemctl start mysqld
git 和composer
curl https://setup.ius.io | sh
yum remove -y git
yum install -y git2u
git config --global core.autocrlf false
git config --global core.safecrlf false
git config --global user.name 'test'
git config --global user.email 'test@qq.com'
curl -s http://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/
chmod a+x /usr/local/bin/composer.phar
ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
composer config -g repo.packagist composer https://developer.aliyun.com/composer
=====================================================
关闭防火墙和Selinux
CentOS6
[root@node1 ~]#chkconfig iptables off
[root@node1 ~]#vi /etc/selinux/config
修改:SELINUX=disabled
CentOS7
[root@node1 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@node1 ~]# systemctl stop firewalld
[root@node1 ~]# setenforce 0
[root@node1 ~]# vi /etc/selinux/config
SELINUX=disabled
配置iptables
yum install iptables-services
vim /etc/sysconfig/iptables
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
yum restart iptables
systemctl enable iptables
---------------------
更改镜像源
3.1 安装wget
[root@node1 ~]#yum install -y wget
3.2 下载aliyun的repo
[root@node1 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3.3 更新镜像源
[root@node1 ~]#yum clean all
[root@node1 ~]#yum makecache
---------------------
参考
https://blog.csdn.net/chengyuqiang/article/details/55044073
发表评论
-
召唤神龙 - 安装 centos 8, php 8, mysql 8, laravel 8 的整套 php 运行环境
2020-11-27 16:26 552本文编写时间:2020-11-27 传说集齐龙珠可以召唤神 ... -
centos安装denyhost
2020-11-21 14:29 349安装denyhost 下面这个不知是否是官网。 https: ... -
centos8 使用阿里镜像快速安装php7.4套件
2020-11-15 00:48 665centos8 使用阿里镜像快速安装php7.4套件 本文只 ... -
centos7 使用阿里镜像快速安装php7.4套件
2020-11-15 00:32 1000本文只考虑centos7 今日 2020-11-16 rem ... -
win10 安装docker
2020-11-14 11:26 245首先,需到docker官网注册,有个账号和密码。 1.进入d ... -
rabbitmq的终端管理命令rabbitmqadmin
2020-11-13 17:03 756启动rabbitmq systemctl start rab ... -
centos 安装 RabbitMQ
2020-11-11 14:40 378安装 erlang语言环境。 千万不要直接 yum inst ... -
composer常用命令
2020-11-05 14:46 1005列出当前全局配置 composer config -l -g ... -
期待centos8+php8 + mysql8 + laravel8,8888
2020-10-29 19:24 381期待centos8+php8 + mysql8 目前主要使用 ... -
ubuntu 安装 php7.4以及各类插件
2020-10-24 13:20 895ubuntu 安装 php7.4以及各类插件 安装系统 最近 ... -
centos的证书配置
2020-06-09 20:32 834用百度云,发现对其他https 的 网站访问时有时无。 排查 ... -
宝塔定义站点
2020-02-24 10:41 2宝塔定义站点。 1111111111111111111111 ... -
让php-fpm以root账号运行
2020-02-19 21:41 693一般来说,我们没有这种需求,但是当需要时, 可以让php-fp ... -
git常用命令
2020-02-03 15:27 341git常用命令 删除本地分支。 git branch -d ... -
shadowsocks 故障解决
2020-02-01 12:06 4509今天突然发现shadowsocks无法使用。 解决方案:修改服 ... -
将代码部署到coding.net
2020-01-10 14:20 538coding.net 是一个git仓库,有免费有收费。 首先 ... -
php部署工具deployer技巧 - vendor目录创建
2020-01-06 12:06 805deployer是个好东西,可是每次都composer ,其实 ... -
自定义redis多个实例
2020-01-04 01:17 577假如多个项目部署到同一台服务器,有时会被redis的各项目前缀 ... -
推荐使用php的部署工具 deployer
2020-01-03 16:48 806php部署代码可以使用 https://deployer.or ... -
使用composer 类库 cachetool 清除opcache 的缓存
2020-01-03 16:38 877php的生产服务器上,需要把opche打开。 但有时,会被缓 ...
相关推荐
CentOS7.4环境安装MySQL5.7步骤,包括环境准备,依赖包的安装等
CentOS7.4 安装mongodb
centos 7.4 安装 oracle 11.2.0.4 最佳实践,作者原创 环境 操作系统:Centos 7.4 CentOS-7-x86_64-DVD-1708.iso Oracle软件:oracle 11.2.0.4 p13390677_112040_Linux-x86-64_1of7.zip p13390677_112040_Linux-x86...
Centos7.4.1708版本最小化安装镜像 附件内容: CentOS-7-x86_64-Minimal-1708.iso CentOS-7-x86_64-Minimal-1708.torrent
通过rpm软件包在centos7.4安装docker,附件中包含rpm包和安装指导
centos7.4安装Intel I219-V网卡驱动 一、 问题描述 二、 下载 三、 编译安装 四、 遇到的问题
硬盘设置成exfat格式,可同时在windows和linux上面同时使用
centos7.4下安装nginx1.16.0.docx
oracle基础安装,有需要的可以看一下。最基本的安装方法。
CentOS7.4 Linux安装步骤详细说明。适合初学者,对还不会安装的人有帮助
Linux网络操作系统项目教程(RHEL7.4CentOS7.4)(第3版)》-PPT课件.rar
附件包含redhat 7.0 64位镜像资源 和 centos 7.4 64位镜像资源
Linux操作系统与实训(CentOS 7.4 & RHEL7.4)(微课视频版)ppt及答案.rar
Linux网络操作系统项目教程(RHEL7.4CentOS7.4)(第3版)-电子教案.zip
centos7.4安装VNC.txt
centos7.4.1708-32位,清华大学yum源配置文件,把原来的源备份后直接覆盖就可以
CentOS7.4安装指导书,转载于华为安装指导书。大家使用时可参考
用于centos7.4离线安装gcc、g++,压缩包包含binutils-devel-2.25.1-31.base.el7.x86_64.rpm cpp-4.8.5-16.el7.x86_64.rpm gcc-4.8.5-16.el7.x86_64.rpm gcc-c++-4.8.5-16.el7.x86_64.rpm glib2-2.50.3-3.el7.x86_...
Centos7.4.1708 安装usb无线网卡驱动
centos 7.4安装kafka 一、 关闭防火墙 二、 禁止selinux 三、 更新系统 四、 安装JDK 五、 配置Java环境变量 六、 安装kafka 七、 安装zookeeper 八、 配置kafka 九、 测试kafka 十、 把zookeeper配置成服务 十一、...