-
Linux下nginx的yum安装、源码安装、OpenResty的源码安装
2020-10-09 14:18:21Linux下nginx的安装 安装环境: # cat /proc/version Linux version 3.10.0-123.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Mon Jun 30 12:09:...Linux下nginx的安装
安装环境:
# cat /proc/version Linux version 3.10.0-123.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Mon Jun 30 12:09:22 UTC 2014 # cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core)
yum安装
- 设置yum仓库地址
vi /etc/yum.repos.d/nginx.repo
:
[nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true
- 使用yum安装:
# yum install -y nginx
安装完成后配置文件所在目录为
/etc/nginx
。- nginx的启动与停止:
- 启动nginx:
nginx
或systemctl start nginx
。 - 停止nginx:
nginx -s stop
或systemctl stop nginx
。
- 查看nginx是否启动成功。
# ps -ef|grep nginx root 1830 1 0 22:45 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf nginx 1831 1830 0 22:45 ? 00:00:00 nginx: worker process root 1835 1638 0 22:45 pts/0 00:00:00 grep --color=auto nginx # systemctl status nginx ● nginx.service - nginx - high performance web server Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled) Active: active (running) since Wed 2020-10-07 22:45:12 EDT; 22s ago Docs: http://nginx.org/en/docs/ Process: 1817 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=1/FAILURE) Process: 1829 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS) CGroup: /system.slice/nginx.service ├─1830 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf └─1831 nginx: worker process Oct 07 22:45:12 localhost.localdomain systemd[1]: Starting nginx - high performance web server... Oct 07 22:45:12 localhost.localdomain systemd[1]: Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory Oct 07 22:45:12 localhost.localdomain systemd[1]: Started nginx - high performance web server.
-
访问网站
http://localhost/
。 -
卸载nginx。
# yum list nginx Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.ustc.edu.cn * centos-sclo-rh: mirrors.163.com * centos-sclo-sclo: mirrors.ustc.edu.cn * extras: mirrors.ustc.edu.cn * updates: mirrors.ustc.edu.cn Installed Packages nginx.x86_64 1:1.18.0-1.el7.ngx @nginx-stable # yum remove nginx.x86_64 Loaded plugins: fastestmirror ... ...
源码安装
源码安装的方式方便对nginx进行自定义的配置以及安装插件。
-
下载源码,下载地址:http://nginx.org/en/download.html,这里使用的版本为
nginx-1.18.0.tar.gz
。 -
解压
nginx-1.18.0.tar.gz
:
# tar xf nginx-1.18.0.tar.gz
- 安装可能需要的依赖:
# yum -y install autoconf automake make # yum -y install gcc gcc-c++ # yum -y install pcre pcre-devel # yum -y install zlib zlib-devel # yum install -y openssl openssl-devel
- 配置:
# cd nginx-1.18.0 # ./configure
- 安装:
# make && make install
安装完成后的二进制文件和配置文件在
/usr/local/nginx
目录下。- 配置环境变量:
# vi /etc/profile 最后增加 export PATH=$PATH:/usr/local/nginx/sbin # source /etc/profile
- 安装成为服务:
# vi nginx.service [Unit] Description=nginx - high performance web server Documentation=http://nginx.org/en/docs/ After=network-online.target remote-fs.target nss-lookup.target Wants=network-online.target [Service] Type=forking PIDFile=/usr/local/nginx/logs/nginx.pid ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/usr/local/nginx/sbin/nginx -s stop [Install] WantedBy=multi-user.target # systemctl daemon-reload
OpenResty的安装
OpenResty是一个基于Nginx与Lua的高性能Web平台,其内部集成了大量精良的Lua库、第三方模块以及大多数的依赖项。
-
下载OpenResty,下载地址:
https://openresty.org/download/openresty-1.17.8.2.tar.gz
。 -
安装:
# tar xf openresty-1.17.8.2.tar.gz # cd openresty-1.17.8.2 # ./configure # make && make install
- 配置环境变量:
# vi /etc/profile 最后追加 export PATH=$PATH:/usr/local/openresty/bin # cd /usr/local/openresty/bin # ll | grep openresty lrwxrwxrwx. 1 root root 37 Oct 9 14:09 openresty -> /usr/local/openresty/nginx/sbin/nginx
openresty是一个指向
/usr/local/openresty/nginx/sbin/nginx
的软链接,其实openresty内置了一个nginx,使用方法与nginx一样。# openresty -V nginx version: openresty/1.17.8.2 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.17 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.8 --with-ld-opt=-Wl,-rpath,/usr/local/openresty/luajit/lib --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_ssl_module
- 设置yum仓库地址
-
源码安装Ceph
2017-03-31 22:06:07源码安装Ceph1. 系统版本和Ceph版本
Ubuntu:16.04.1 下载地址
Ceph : 11.2.0 下载地址 (注意:源码文件名的格式为ceph_11.x.y.orig.tar.gz)2. 安装Ubuntu
虚拟机安装Ubuntu:
- 50G硬盘空间
- 8G内存
- 4个CPU处理器。由于Ceph源码在编译后多达30G,因此需要分配大量的存储空间。
Ubuntu的安装和环境配置:见xxx
3. 下载解压Ceph源码
下载Ceph源码:
wget http://download.ceph.com/tarballs/ceph_11.2.0.orig.tar.gz
解压Ceph源码:
tar zxf ceph_11.2.0.orig.tar.gz
4. 编译Ceph源码
进入源目录:
cd ceph-11.2.0/
安装需要的库:
./install-deps.sh
编译:
./do_cmake.sh cd build make -j4
最后一步会花较多的时间
5. 建立集群
建立集群,1个monitor,4个osd,1个mds
../src/vstart.sh -n -X --mon_num 1 --osd_num 4 --mds_num 1
查看集群
./bin/ceph -s
关闭集群
../src/stop.sh
-
源码安装pip
2017-11-03 16:50:44但是公司的编译环境使用的Gentoo,没有yum,apt-get,我每次安装python库都是自己下载源码用python setup.py来编译安装,安装后的库文件在/usr/lib64/python2.7/site-packages目录下,源码安装的在这个目录下库的...今天本来要使用Twisted,但是公司的编译环境使用的Gentoo,没有yum,apt-get,我每次安装python库都是自己下载源码用python setup.py来编译安装,安装后的库文件在/usr/lib64/python2.7/site-packages目录下,源码安装的在这个目录下库的文件夹名字会带上后缀.egg。最后拷贝库文件到我的运行环境对应目录下面,例如拷贝到了目录/home/test,那么运行自己的代码之前就执行export PYTHONPATH=/home/test,这样就和pip安装的库一样使用了。
但是今天这个Twisted真是麻烦了报错:distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('incremental>=16.10.1')
实在没辙,退而求其次想办法安装pip,用pip install Twisted来安装是最靠谱的。到官网下载了最新的setuptools和pip源码包,先安装setuptools再安装pip,结果又报错:
ImportError: <module 'setuptools.dist' from '/usr/lib64/python2.7/site- packages/setuptools/dist.pyc'> has no 'check_specifier' attribute
这里解决办法是安装setuptools时选用低版本,比如这个https://github.com/pypa/setuptools/archive/13.0.2.tar.gz,再次安装pip就成功了。
-
源码安装Bazel
2018-04-12 18:18:54有时候我们需要源码安装tensorflow,这时逃不过的第一步就是安装Bazel,如果没有root权限的时候,这时我们就需要源码安装Bazel了。下面是安装步骤,参考:...有时候我们需要源码安装tensorflow,这时逃不过的第一步就是安装Bazel,如果没有root权限的时候,这时我们就需要源码安装Bazel了。
下面是安装步骤,参考:https://docs.bazel.build/versions/master/install-compile-source.html
1. Ensure that JDK 8, Python, Bash, zip, and the usual C++ build toolchain are installed on your system.
这里需要说明的是JDK8的安装,一般centos默认安装了openJDK,但不完整,因此我们改用oracle的java版本,具体安装方法,见:《 安装oracle-java,并覆盖原先的OpenJDK》
2. Download and unpack Bazel's distribution archive.
Download
bazel-<version>-dist.zip
from the release page:https://github.com/bazelbuild/bazel/releases3. Build Bazel using
./compile.sh
.cd
into the directory where you unpacked the distribution archive- run
bash ./compile.sh
output/bazel下面。
4. 更新bashrc
export PATH=$PATH:**/output/bazel然后source ~/.bashrc即可。
-
源码安装与yum安装的区别
2019-08-21 22:40:51跟做运维的朋友聊天,谈到了,yum安装和源码安装哪个好的问题。真没想到,关于这个问题,分歧还挺大的。有的人认为,不用源码安装就不是好的运维,不是好的系统管理员。这帽子扣的有点大了。在此我想说一说我的看法... -
pytorch 源码安装
2018-04-21 21:18:06安装过程 之前尝试过各种安装方式,...1 下载源码安装torch git clone https://github.com/pytorch/pytorch.git git clone https://github.com/pytorch/vision.git cd pytorch/ #如果是安装CPU版本的话在加一个声... -
samba源码安装
2017-11-30 21:50:29在不能使用linux的环境下,采用samba源码安装samba服务器 -
squid源码安装
2017-08-03 23:04:56squid源码安装步骤: 上篇文章已经说过了squid的几种类型下面来安装一下squid: squid代理服务器安装squid源码包(也可yum安装) 源码包:squid-3.4.6.tar.gz 1、解压: [root@www squid-3.4.6]# tar -... -
cmake源码安装
2017-12-01 09:32:41用于cmake源码安装,在开发板或者linux无法使用apt-get获取时,可使用该方法 -
galera 源码安装
2015-07-07 14:24:51galera 10.0.20 on centos 6.6安装之galera源码安装配置 -
Linux 源码安装 OpenSSL
2018-09-13 17:20:34Linux 源码安装 OpenSSL Linux 源码安装 OpenSSL 1、下载OpenSSL 2、源码安装 3、查看信息 1、下载OpenSSL 官网下载 https://www.openssl.org/source/ 选择要下载版本右击复制链接地址... -
Ubuntu源码安装swig
2013-12-19 22:21:37现在 swig 已经支持 apt install 命令安装了,如果不想通过下面源码安装的可以直接执行下面命令安装。 sudo apt install swig 下面的步骤是使用 swig 源码安装的方法。 1. 下载 swig 源码 ... -
使用源码安装wine
2019-06-02 19:43:42使用源码安装wine。 使用git clonehttps://github.com/wine-mirror/wine.git获取到最新的wine源码 安装步骤如下: ./configure make make install 在执行./configure时会出现 1.错误 checking whether gcc ... -
Linux源码安装gnutls
2019-07-04 11:09:20安装解压工具lzip,如果yum install或者apt-get install可直接安装lzip则跳过下面源码安装lzip wget http://download.savannah.gnu.org/releases/lzip/lzip-1.20.tar.gz tar zxvf lzip-1.20.tar.gz cd lzip-1.20 ./... -
二进制安装和源码安装
2019-03-19 16:57:56二进制安装和源码安装 二进制包里面包括了已经编译完成,可以直接运行的程序。你通过sudo apt-get install来进行下载和解包(安装),执行完该指令后就可以马上使用了。因此这种方式简单快捷,适合比较固定、无需改动的... -
mysql源码安装与yum安装优缺点
2018-09-15 17:24:08根做运维的朋友聊天,谈到了,yum安装和源码安装哪个好的问题。真没想到,关于这个问题,分歧还挺大的。有的人认为,不用源码安装就不是好的运维,不是好的系统管理员。这帽子扣的有点大了。在此我想说一说我的看法... -
OpenLDAP源码安装及配置管理
2019-09-24 14:40:40OpenLDAP源码安装 下载OpenLDAP源码 http://www.openldap.org/software/download/ ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release.tgz 编译源码 tar -zxvf openldap-2.4.48.tgz cd openldap-2.4.48/ ... -
gazebo源码安装
2016-11-30 14:23:471> 源码安装protobuf2.5 如果出现x86_64_lib中有一样的库时, 添加路径到LD_LIBRARY_PATH 2> 按照官网进行安装 http://gazebosim.org/tutorials?tut=install_from_source&cat=install 注意: ... -
Superset源码安装+Docker安装笔记
2019-07-08 15:02:09主要功能: 丰富的数据可视化集 易于使用的界面,用于探索和可视化数据 创建和共享仪表板 ... 与主要身份验证提供程序集成的企业级身份验证(通过Flask AppBuilder进行数据库,OpenID,LDAP,OAuth和... -
Python 基础:python 安装-Linux源码安装
2019-11-01 12:43:33Python 基础:python 安装-Linux源码安装概述踩过的坑:一、安装前准备二、安装过程1. 安装依赖环境2. 解压源码包3. 查看安装说明4. 编译并安装5. 验证安装,并添加环境变量 概述 本次在CentOS 7 下完成源码安装。 ... -
mysql 5.7.18 源码安装笔记
2018-10-19 14:17:02主要是因为很久之前,源码安装MySQL的时候,碰到了太多太多的坎坷。 如果你有兴趣进行源码安装,那么请不要以这篇文章为标准,因为每个人的及其环境等其他因素还是差距比较大的。 但可以作为一篇流程参考文档,... -
yum安装与源码安装优势、劣势
2018-07-17 00:37:45在网上看到很多观点,有的说yum安装好,有的说源码安装好,还有的人说两者结合起来好,下面是从网上摘录的几种观点: 观点一 根做运维的朋友聊天,谈到了,yum安装和源码安装哪个好的问题。真没想到,关于这个... -
tensorflow1.5源码安装
2018-01-06 11:48:42tensorflow1.5源码安装 昨天听同学说TensorFlow1.5.0-rc0 发布了,该版本将动态图集成到了tensorflow模块里面,不用像1.4的版本需要另外安装插件,很是激动,打算赶紧安装上手一波。但是由于才发布不久,不... -
PostgreSQL 源码安装及 yum 安装
2017-11-06 16:31:19# 源码安装 tar zxvf postgresql-10.0.tar.gz mv postgresql-10.0 /usr/local/pgsql cd /usr/local/pgsql/ ./configure --prefix=/usr/local/pgsql --without-readline make make install # 添加用户,设置目录权限... -
sysbench-1.0源码安装
2018-11-06 14:08:20文章目录sysbench-1.0源码安装一、下载源码二、源码编译 sysbench-1.0源码安装 一、下载源码 wget https://codeload.github.com/akopytov/sysbench/zip/1.0 解压缩 unzip 1.0 二、源码编译 yum -y ... -
Ansible的源码安装
2018-06-07 11:22:36以下工具及模块的安装全部基于源码安装1、https://github.com/ansible/ansible首先获取Ansible的源码包2、Ansible是基于Python开发的所以推荐Python2.7及以上版本3、Ansible还需要一些第三依赖需要下载,将压缩包... -
源码安装、yum安装和rpm安装的区别
2018-03-02 15:56:581、yum安装可以看成是从网络在线安装的一种方式,只需要yum install 软件名,系统就自动...2、而源码安装方式是需要自己到网上下载源码包,然后解压安装。此方式可以指定配置参数,更加灵活方便,兼容性更强。比较... -
rdesktop源码安装
2016-04-22 09:42:46rdesktop源码安装Linux 官方网站:http://www.rdesktop.org/#download以rdesktop-1.7.1为例: yum -y install libX11-devel tar -xvf rdesktop-1.7.1.tar.gz -C /usr/local/src cd /usr/local/src/rdesktop-... -
MySQL5.7.32源码安装
2020-12-06 18:31:54MySQL源码安装 MySQL官网进行源码下载 https://dev.mysql.com/downloads/mysql/ 文章目录MySQL源码安装二、使用步骤1.进行安装总结前言一、pandas是什么?二、使用步骤1.引入库2.读入数据总结 二、使用步骤 1.... -
源码安装nginx-1.16
2019-05-19 21:35:38源码安装配置nginx-1.16 首先准备好yum源,源码包 源码包可以在官网上下载 安装nginx源码包 [root@nginx ~]# wget http://nginx.org/download/nginx-1.16.0.tar.gz 部署nginx源码编译 1.yum源下载所需的依赖包 ...
-
智联万物,京东IoT技术创新与实践
-
基于 C# 的 GIS 近海环境管理系统
-
php实现简单的用户注册,登录,修改个人信息接口
-
Redis数据库入门与使用
-
中文说明worldserver.conf
-
securecrt一款好用的终端仿真程序
-
易语言子程序的调用.e
-
web前端开发规范
-
Java Web开发之Java语言基础
-
ProBuilder快速原型开发技术
-
FPGA 之 SOPC 系列(五)Nios II 软件使用与程序开发 I
-
基于X210的裸机时钟温度显示器-第3/3季
-
Python编写小型购物车程序
-
数据类型转换、运算符、方法入门
-
易语言开发通达信DLL公式接口
-
Leetcode 739. Daily Temperatures (cpp)
-
FFmpeg4.3系列之26:视频监控之H265多路摄像头播控项目实战
-
Driver Signature Enforcement Overrider-桌面系统工具类资源
-
新闻列表页的制作
-
Unity游戏开发之数字华容道