入手一台ECS 2核4G 3年1650-安装软件笔记

root 登陆

蕾丝边命令 哈哈

# lsb_release -a

Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core

傻瓜安装

yum安装jdk

# yum -y list java*

# yum -y install java-1.8.0-openjdk*

# whereis java

java: /usr/bin/java /usr/lib/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz

openresty

依赖 安装

luajit2.1-beta3

# wget http://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz

# tar -xvf LuaJIT-2.1.0-beta3.tar.gz

# cd LuaJIT-2.1.0-beta3

# make

# sudo make install

==== Successfully installed LuaJIT 2.1.0-beta3 to /usr/local ====

Note: the development releases deliberately do NOT install a symlink for luajit
You can do this now by running this command (with sudo):

ln -sf luajit-2.1.0-beta3 /usr/local/bin/luajit

提示我们 需要建立软链接

 # ln -sf luajit-2.1.0-beta3 /usr/local/bin/luajit

查看版本 

# luajit -v

 LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/

 源码安装openresty

# wget https://openresty.org/download/openresty-1.13.6.1.tar.gz  

# tar -xvf openresty-1.13.6.1.tar.gz

# cd openresty-1.13.6.1

# ./configure --prefix=/opt/openresty --with-luajit

##需要先创建/opt/openresty目录

如果报错如下:   

./configure: error: the HTTP rewrite module requires the PCRE library.

尝试安装

#yum -y install pcre-devel

错误提示:./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library.   You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl=<path> options.

解决办法:

# yum  -y install openssl openssl-devel

我们可以指定各种选项,比如

./configure --prefix=/opt/openresty

            --with-luajit

            --without-http_redis2_module

            --with-http_iconv_module

            --with-http_postgres_module

具体用法参考./configure–help 或者官方文档

gmake

gmake install

环境变量配置

# echo "export PATH=$PATH:/opt/openresty/nginx/sbin/" >>/etc/profile && source /etc/profile

启动并加载配置文件

# nginx -c /opt/openresty/nginx/conf/nginx.conf

# nginx -t

查看并开启防火墙,以及开放80

# systemctl status firewalld

# systemctl start firewalld

# firewall-cmd --add-port=80/tcp --permanent

用root用户执行下面3个命令:

允许http服务通告防火墙

1 #firewall-cmd --add-service=http

在永久配置中 添加http服务

2 #firewall-cmd --permanent --add-service=http

在不改变状态的条件下重新加载防火墙

3 #firewall-cmd --reload

 mariadb安装

http://www.cnblogs.com/zhonghuahero/p/7904878.html

原文地址:https://www.cnblogs.com/zhonghuahero/p/7831880.html