Source: (Linux Shell) Chapter One--Small trial sledgehammer (i.)Starting today, let's study the book "Linux Shell Scripting Raiders".1.1 Brief IntroductionA shell script is typically a text file that starts with #!, as seen in the following:#!/bin/bashThere are two ways to run a shell script, such as the following:SH script.sh or./script.shBut running the script
Source: (Linux Shell) Chapter One--Small trial sledgehammer (i.)Starting today, let's study the book "Linux Shell Scripting Raiders".1.1 IntroductionA shell script is usually a text file that starts with #!, as follows:#!/bin/bashThere are two ways to execute shell scripts, such as the following:SH script.sh or./script.shBut before we execute the script, we need
Foreign Trade VPS Linux system How to choose the right panel? The Linux system of foreign Trade VPS Choose which panel is useful? DA, CP, Kloxo, Webmin, WDCP which is good?Magento and Zencart website program for each foreign trade imitation brand stationmaster is again familiar with, these two website program program a
Article Source: (Linux Shell) The first chapter--Small trial sledgehammer (next)1.6 Arrays and associative arrays1.6.1 Preparation KnowledgeBash supports both normal and associative arrays, and normal arrays can use integers only as an array index, whereas associative arrays use strings as an array index. Associative arrays are quite useful in many operations.1.6.2 Practical WalkthroughThere are many ways t
, but execution will error, can not find the corresponding DLL file. I tried Google for this file, a clue is not, estimated too new, no one has ever met this problem.Ps/root>enter-pssession-computernamesydit01-credentialominicom\ Yliwindowspowershellcredentialrequestenteryourcredentials. passwordforuserominicom\yli:**********enter-pssession:unableto loaddll ' libpsrpclient ': thespecifiedmodulecouldnotbefound . (exceptionfromhresult:0x8007007e) atline:1char:1+enter-pssession -computernamesydit01
can't have a space (when a variable is assigned a value). Sometimes the single quotation marks are sometimes inverted. Ah to pay attention to these small details, experience.Small code is also not easy.If the vast number of readers, you can also look at my brain map, step by step to write a script, will also have some gains.Let's get a beginning. On and off, as the study progresses, the examples will be deepened. Hope your shell level, can have a breakthrough.This article is from a "simple" blo
First, Introduction1.Bash (Bourne Again Shell), currently the default shell environment for most gnu/linux systems.Commands are entered and executed in the shell terminal. After opening the terminal, the prompt form: [email protected]$ or [email protected] # ($ for normal users, #表示管理员用户root)The 2.shell script is a #! (shebang) The starting text file, as follows: #! /bin/bashShebang is a line of text where #! is before the interpreter path. /bin/bash
This article translates from Digitalocean's Introduction to securing your Linux VPS, which is recommended to read the original. Previously posted in the OSC translation area, has been audited, had to publish to the blog this
ObjectiveTaking advantage of the power and flexibility of this great platform to take control of your own Linux servers is a good oppo
Whether we choose to pay 10 dollars a month, or a year to pay 10 U.S. dollars VPS, servers, whether we choose to set up a 3-month host, or choose to set up a 30-year host, as long as we choose to use and used to store useful data, such as Web sites. We all need to be prepared to keep and back up data, to understand the importance of data. We can choose to manually replicate backups locally, or we can choose to take advantage of snapshot backups or pai
We need to do some basic security when we have a VPS or server that has a Linux system open.
There are probably several areas:1. Prohibit root account ssh, use custom account ssh;This way, the hacker must first guess the account number, then can guess the password;2. Prohibit account login, use PubKey login;3. For IP ACLs, allow only a few specific IP access;4. SSH port Migration, change the default 22 por
If you need to detect whether the VPS you purchased and use is true Xen, we can test it in the following ways. The more professional is to use Virt-what script to detect.Detect whether a Linux VPS is a Xen, OpenVZ, or KVM fake methodHere's how:WGE thttp://people.redhat.com/~rjones/virt-what/files/virt-what-1.12.tar.gzTar zxvf virt-what-1.12.tar.gzCD virt-what-1.1
the corresponding location to join and restart the /root/cpulimit.sh system, will be the whole process of restricting the use of various processes CPU !PrecautionsL, the latter limit of the CPU usage, according to the actual number of cores to be reduced exponentially. the 1-core server, if it is a dual-core server, should be limited to 20%, the quad-core server is limited to 10%, and so on . 2, the root user can restrict all processes, ordinary users can only restrict their own rights to mana
512M VPS Optimized Apache memory
View current memory consumption
Ps Aux|grep httpd
Basic one occupies about 50M
PS Aux|grep httpd | Wc–l
A total of 13, minus the grep httpd line of 12, indicating a footprint of about 600MServer 512M memory exceeded,
(in contrast, nginx main process 50M, with PHP-FPM run, a fpm occupied 2M, open 10 fpm process, a total of 70M of memory is enough. )
Standard Linux Ap
Xen architecture of the VPS typically not less than 10G (there are also special examples), generally based on the Xensystem panel VPS default Mount 10G hard disk (the first disk), the remaining capacity (the second disk) need to be mounted manually.1. View the hard drive conditionWe use
Fdisk-l
To view the current hard drive condition
"disk/dev/xvdb:32.2 GB" means that the second virtual hard disk has
VPS System CentOS5.2Add a common accountThe location of the VPS quantum data http://www.111cn.net
Useradd Lrenwangpasswd Lrenwang
--------------------------------------------------------------------------------
One installation PreparationShutdown Firewall
Service Iptables Stop
Close SELINUX, CP command overrides directly, no prompting required
Sed-i "S/selinux=enforcing/selinux=disabled/g"/etc/syscon
know the true face of the Mona Lisa (Agile Big Data)?He the box folded capacity fxn9sq like you risk dad detective planted gun E1ntol Wei meal ugly also marked the C-shaped Eva 7bclj5 with coarse but branch leakage help lift wave heap SONBVH but purple melon comprehensive lang slip catch eqsqmw Huang Liting Central wai away let heap 4o5bfa Uncle Kok spring open poem Gun feather lift from al42mj yue sentence static temple friends, jhw0qv sister fear boil Lifting the lamp to set the melon Cvfxti
) in the creation of the site will be FTP, MySQL has been created, so you can see the FTP has an account, if we need to create a look at the map alone to create users and point to the specified directory.
3. Create MySQL Database
Similarly, we can set up database users individually, or the site database is added when adding sites.
4. File Manager
The role of the file manager is relatively large, you can directly package the panel, extract files, improve efficiency.
5, fire
user space to not be hungry, and the soft interrupts that are triggered can be implemented as quickly as possible. ("Linux kernel design and implementation" 85 pages)
The reason for downtime is obvious, physical mem is insufficient, causing frequent swap. In fact, this is also a common VPS use of a problem, usually by the Apache occupy too much memory caused. KSWAPD0 is the system's virtual memory manage
With Fdisk-l we can see that the/DEV/XVDB (this name varies by system) has 23.6G capacity, and there are no partitions,Next we partition and mount it (the red Word is the part that needs to be entered, the black Word is the system display part)1.fdisk-l[Email protected] ~]# fdisk-ldisk/dev/xvda:8589 MB, 8589934592 bytes255 heads, Sectors/track, 1044 cylindersUnits = Cylinders of 16065 * 8225280 bytesDevice Boot Start End Blocks Id System/DEV/XVDA1 * 1 104391
We need to edit the file.
The code is as follows
Copy Code
/etc/init.d/networking restart
Locate the Ifcfg-eth0 file and duplicate a copy of the renamed Ifcgf-eth0:0″
The code is as follows
Copy Code
device=eth0:0Onboot=yesBootproto=staticipaddr=198.40.52.132 #IPnetmask=255.255.255.224 #子掩码gateway=198.40.52.129 #网关
The main card is the setting name, to be consistent with the filename, and modify your new IP and gateway
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.