Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How the simplified version of Linux server initializes the Shell script

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the knowledge of "how to initialize the Shell script on the simple version of Linux server". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The Shell script is mainly used to initialize the newly installed Linux server system, including:

Close the IPv6 module

Close SELinux

Let vim display colors

Set system language coding

Optimize system servic

Kernel parameter optimization and so on.

Can be modified according to their own actual situation, can be used in the production environment. The original author is NetSeek, and I have made some modifications.

The code is as follows:

#! / bin/sh

# desc: lsm03624 modified by www.webnginx.com

#-cut begin

# welcome

Cat / etc/modprobe.conf

Echo "alias ipv6 off" > > / etc/modprobe.conf

/ sbin/chkconfig-- level 35 ip6tables off

Echo "ipv6 is disabled!"

# disable selinux

Sed-I'/ SELINUX/s/enforcing/disabled/' / etc/selinux/config

Echo "selinux is disabled,you must reboot!"

# vim

Sed-I "8 s / ^ / alias vi='vim'/" / root/.bashrc

Echo 'syntax on' > / root/.vimrc

# zh_cn

Sed-I-e's / ^ Lang =. * / LANG= "zh_CN.UTF-8" /'/ etc/sysconfig/i18n

# configure file max to 52100

Echo "* soft nofile 52100

* hard nofile 52100 "> > / etc/security/limits.conf

# tunoff services

#-

Cat > / etc/sysctl.conf

Echo "optimizited kernel configure was done!"

This is the end of the content of "how to initialize the Shell script for the simple version of Linux Server". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report