openEuler安装_Java源代码会被编译成

openEuler安装_Java源代码会被编译成openEulerLinux源代码编译安装Nginx升级系统和软件yum-yupdate关闭防火墙systemctlstopfirewalldsystemctldisablefirewalld编辑/etc/selinux/config#SELINUX=enforcing修改为SELINUX=disabled#或者执行sed-i’s/SELINUX=enforcing/SELINUX=disabled/g’/etc/selinux/config保

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

openEuler Linux 源代码编译安装 Nginx

升级系统和软件

yum -y update

关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

编辑/etc/selinux/config

# SELINUX=enforcing 修改为
SELINUX=disabled
# 或者 执行 
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

保存后执行

setenforce 0

安装依赖

yum -y groupinstall Development
yum -y install gcc gcc-c++
yum -y install zlib zlib-devel openssl openssl-devel pcre-devel
yum -y install vim net-tools man wget tar

或者:

yum -y install gcc gcc-c++ make cmake zlib zlib-devel openssl openssl-devel pcre-devel vim net-tools man wget epel-release tar

gcc gcc-c++编译环境
gzip 模块需要 zlib 库
rewrite 模块需要 pcre 库
ssl 功能需要openssl库

添加nginx组,用户

groupadd nginx
useradd nginx -g nginx -s /sbin/nologin -M

下载安装包

wget http://nginx.org/download/nginx-1.22.0.tar.gz
tar -zxvf nginx-1.22.0.tar.gz
cd nginx-1.22.0/

对nginx进行配置

./configure --prefix=/usr/local/nginx \
 --user=nginx --group=nginx \
 --with-http_stub_status_module --with-http_ssl_module \
 --with-http_realip_module --with-http_gzip_static_module \
 --with-file-aio --with-http_realip_module 

#查看是否配置成功($? 是显示最后命令的退出状态,0表示没有错误,其他表示有错误)

echo $?
# 成功会显示数字零 
0

编译安装

make -j4
make  -j4 install
echo $?
0

查看nginx版本号

/usr/local/nginx/sbin/nginx -v
# 显示结果如下:
nginx version: nginx/1.20.2

检查配置文件语法是否正确

/usr/local/nginx/sbin/nginx -t
# 检查通过显示结果如下:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

启动nginx

/usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx -s reload                 # 重新载入配置文件
/usr/local/nginx/sbin/nginx -s stop                   # 快速关闭 Nginx
/usr/local/nginx/sbin/nginx -s quit                   # 关闭Nginx 

编写启动脚本

cd  /usr/lib/systemd/system/
vim nginx.service
[Unit]
Description=nginx
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPost=/bin/sleep 0.1
ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

# 重新加载服务文件
systemctl daemon-reload 
# 开启|停止|重新加载|重启|
systemctl start|stop|reload|restart|status nginx.service

开机自启:

systemctl enable nginx.service

关闭开机自启:

systemctl disable nginx.service
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/188359.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • python-opencv2利用cv2.findContours()函数来查找检测物体的轮廓

    python-opencv2利用cv2.findContours()函数来查找检测物体的轮廓转自http://blog.csdn.net/sunny2038/article/details/12889059相比C++而言,Python适合做原型。本系列的文章介绍如何在python中用OpenCV图形库,以及与C++调用相应opencv函数的不同之处。这篇文章介绍在Python中使用OpenCV检测并绘制轮廓。提示:转载请详细注明原作者及出处,谢谢! 本文介绍在OpenCV…

    2022年10月4日
    1
  • JAVA如何遍历arraylist数组,Java 程序使用Lambda表达式遍历ArrayList

    JAVA如何遍历arraylist数组,Java 程序使用Lambda表达式遍历ArrayListJava程序使用Lambda表达式遍历ArrayList在此示例中,我们将学习在Java中使用lambda表达式遍历数组列表的每个元素。要理解此示例,您应该了解以下Java编程主题:示例:将ArrayList作为函数参数传递示例importjava.util.ArrayList;classMain{publicstaticvoidmain(String[]args){//创建Ar…

    2022年7月22日
    5
  • Eclipse自动补全设置「建议收藏」

    Eclipse自动补全设置「建议收藏」最简单的修改方式是:Windows——>Preferences——>Java–>Editor–>ContentAsis在AutoactivationtriggersforJava后面的文本框里只有一个“.”现在你将其改为“.abcdefghijklmnopqrstuvwsyzABCDEFGHIJKLMNOPQRSTUVWSYZ_”即可。

    2022年6月28日
    21
  • ODrive应用 #1 ODrive入门指南[通俗易懂]

    ODrive应用 #1 ODrive入门指南[通俗易懂]ODrive入门文章目录ODrive入门硬件需求需要准备以下硬件:ODrive接线WiringupthemotorsWiringuptheencodersSafety&PowerUPDownloadingandInstallingToolsWindowsOSXLinuxFirmwareStart`odrivetool`ConfigureM02.Set…

    2022年5月14日
    86
  • Spring中的AOP以及切入点表达式和各种通知

    Spring中的AOP以及切入点表达式和各种通知上篇讲了动态代理:Java中动态代理的两种方式JDK动态代理和cglib动态代理以及区别我们用上篇的做法去实现目标方法的增强,实现代码的解耦,是没有问题的,但是还是需要自己去生成代理对象,自己手写拦截器,在拦截器里自己手动的去把要增强的内容和目标方法结合起来,这用起来还是有点繁琐,有更好的解决方案吗?答案是:有的!那就是Spring的AOP,这才是咱们最终想引出来的重点!有了Sprin…

    2022年7月27日
    8
  • 如何查看容器的IP地址和网络相关的参数?

    如何查看容器的IP地址和网络相关的参数?

    2021年9月4日
    85

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号