Linux CentOS7安装NET Core

sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
sudo yum update
sudo yum install dotnet-sdk-2.2-2.2.108-1

安装守护进程
yum install supervisor
systemctl enable supervisord.service
systemctl start supervisord.service
systemctl status supervisord.service
vi /etc/supervisord.conf(修改9001端口注释,打开防火墙,重启)
systemctl restart supervisord.service
参考:https://my.oschina.net/weidedong/blog/747428

时序数据库InfluxDB在centos7安装使用

安装过程:
curl -O https://dl.influxdata.com/influxdb/releases/influxdb-1.7.7.x86_64.rpm
yum install influxdb-1.7.7.x86_64.rpm
systemctl start influxdb
systemctl status influxdb
配置安全选项
vim /etc/influxdb/influxdb.conf
[http]
enabled = true
bind-address = “:8086”
auth-enabled = true
log-enabled = true
https暂不开启
登录
influx -precision rfc3339
有密码登录
influx -precision rfc3339 -username ‘admin’ -password ‘admin’
设置密码(必须登录,先停止安全配置,重启influxdb)
CREATE USER admin WITH PASSWORD ‘‘ WITH ALL PRIVILEGES
数据库连接使用
NET:https://github.com/influxdata/influxdb-java
java:https://github.com/AdysTech/InfluxDB.Client.Net

Centos7安装mysql5.6

wget http://repo.mysql.com/yum/mysql-5.6-community/el/7/x86_64//mysql-community-release-el7-5.noarch.rpm
rpm -Uvh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server
systemctl start mysql
systemctl status mysql
mysql -u root
use mysql;
update user set password=PASSWORD("root") where User='root';
update user set host='%' where Host='localhost' and User='root';
flush privileges;

TensorFlow在Centos7上环境安装

1、Python版本为 2.7
yum install python-pip python-dev
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow # Python 2.7; CPU support (no GPU support)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu #有N卡版本

如果安装失败,执行下面命令
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.6.0-cp27-none-linux_x86_64.whl # Python 2.7
卸载tensorflow
pip uninstall tensorflow
2、验证环境

运行一个简短的 TensorFlow 程序
从 shell 中调用 Python,如下所示:
python
在 Python 交互式 shell 中输入以下几行简短的程序代码:
# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

如果系统输出以下内容,就说明您可以开始编写 TensorFlow 程序了:
Hello, TensorFlow!

Fabric区块链学习—Centos7服务器环境配置

区块链学习必备条件:linux操作基础知识,了解虚拟机,翻墙知识,至少熟悉一门开发语言,中高级以上水平,学习能力强!!!
1、虚拟机安装  建议安装centos7 mini版本
https://blog.csdn.net/u010070703/article/details/78005081?locationNum=9&fps=1
2、记得配独立IP,桥接模式

vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=365a9bb3-6d86-4f27-b2d7-fcadb4b6343a
DEVICE=enp0s3
ONBOOT=yes
IPADDR=172.17.200.88
NETMASK=255.255.255.128
GATEWAY=172.17.200.1
#HWADDR=080027710F6C
DNS1=61.128.192.168
DNS2=61.128.128.68

3、配置centos源,设置阿里yum的源

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
sudo wget/curl -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
其他命令参考
uname -r
uname -a
cat /proc/version
cat /etc/issue
cat /etc/redhat-release
yum -y install wget

yum clean all
rm -rf /var/cache/yum/*
yum makecache
yum update
ip addr
重启网络
systemctl restart network
安装gcc
yum install gcc 
yum install gcc-c++

4、GCC升级

yum -y install epel-release
yum install centos-release-scl-rh centos-release-scl
yum install devtoolset-3-gcc  devtoolset-3-gcc-c++
source /opt/rh/devtoolset-3/enable  
scl enable devtoolset-3 bash
echo "source /opt/rh/devtoolset-3/enable" >>/etc/profile

提示:yum包找不到去这个网站https://centos.pkgs.org
5、Docker安装

wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm
yum install docker-ce-17.12.0.ce-1.el7.centos.x86_64.rpm
docker --version
systemctl start docker
删除所有带none关键字的镜像
docker rmi $(docker images | grep "none" | awk '{print $3}')
docker rmi -f $(docker images -q)
清空重置网络
docker rm -f $(docker ps -aq)
docker network prune
查看网络
docker network list
Docker镜像地址下载
先修改/etc/docker/daemon.json镜像文件地址 换养猪的地址
{ 
"registry-mirrors": ["http://hub-mirror.c.163.com"] 
}
systemctl daemon-reload
systemctl restart docker

6、安装Docker-Compose

curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version

7、安装go语言

wget https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz
环境变量
export PATH=$PATH:/usr/local/go/bin 
默认执行文件夹目录
export GOPATH=/opt/gopath

8、node 安装 注意版本
Python必须的2.7

python -v 
yum install pcre pcre-devel  
yum install zlib zlib-devel 
yum install openssl openssl--devel  
yum install -y readline-devel
wget http://nodejs.org/dist/v7.10.1/node-v7.10.1.tar.gz
tar -zxvf node-v7.10.1.tar.gz
cd node-v7.10.1
./configure && make && make install
node -v

9、npm安装

npm cache clean --force
npm install换
npm install -g cnpm --registry=https://registry.npm.taobao.org
或者 
npm config set registry https://registry.npm.taobao.org 
再
cnpm install 或 npm install
升级版本
npm i npm@latest -g

10、linux内核升级

cat /etc/redhat-release
uname -sr
yum clean all
yum update
reboot
上面操作无效

加入ELRepo 仓库:
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
列出可用的系统内核相关包:
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
安装最新的主线稳定内核:
yum --enablerepo=elrepo-kernel install kernel-ml
设置默认启动内核
vi /etc/default/grub 并设置 GRUB_DEFAULT=0
重新创建内核配置
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
uname -a
删除 CentOS 更新后的旧内核
查看系统中全部的内核 RPM 包
rpm -qa | grep kernel
yum remove 
kernel-tools-3.10.0-514.26.2.el7.x86_64 
kernel-devel-3.10.0-514.10.2.el7.x86_64 
kernel-3.10.0-514.26.2.el7.x86_64 
kernel-3.10.0-327.el7.x86_64 
kernel-headers-3.10.0-514.26.2.el7.x86_64 
kernel-devel-3.10.0-514.26.2.el7.x86_64 
kernel-tools-libs-3.10.0-514.26.2.el7.x86_64;
reboot

CentOS7安装PHP7与Nginx之PHP-FPM模式

采用yum安装PHP7.1.6Released版
1、添加PHP管理软件包的安装源
CentOS/RHEL 7.x安装源:

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

2、
[subscribe]mod_php安装模式

yum install mod_php71w php71w-opcache php71w-pecl-apcu php71w-common php71w-mysqlnd php71w-pdo php71w-pecl-imagick

php-fpm安装模式(现在一般选这个)

yum install php71w-fpm php71w-opcache php71w-pecl-apcu php71w-common php71w-mysqlnd php71w-pdo php71w-pecl-imagick

[/subscribe]
3、安装其他插件包

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-mysql 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

4、启动php-fpm(默认端口9000)

systemctl start php-fpm

5、对应配置文件路径如下

/etc/php-fpm.conf
/etc/php.ini

6、安装nginx源
CentOS/RHEL 7.x:

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

7、安装nginx

yum install nginx

8、启动nginx

systemctl start nginx

9、NGINX配置文件地址如下

/etc/nginx/nginx.conf

10、NGINX整合PHP-FPM,按照如下格式修改nginx server节点。

	
#增加权限 否则报错
chmod +777 /var/run/php-fpm/php-fpm.sock
root         /usr/share/nginx/html/;#PHP文件存放目录
location / {
         index index.php index.html;
         try_files $uri $uri/ /index.php?$args;
        }
location ~ \.php$ {
         fastcgi_pass  unix:/var/run/php-fpm/php-fpm.sock;
         fastcgi_index index.php;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_param QUERY_STRING    $query_string;
         fastcgi_param REQUEST_METHOD  $request_method;
         fastcgi_param CONTENT_TYPE    $content_type;
         fastcgi_param CONTENT_LENGTH  $content_length;
         include fastcgi_params;
       }

11、重新启动nginx

systemctl restart nginx