Linux Basic Environment Construction (2)

Source: Internet
Author: User
Tags get ip pack

Open the virtual machine, connect with Xshell, first we want to get the IP address first enter the command to get the IP
IP addr    Get IP
Ifup (NIC name) #网卡启动
Ifdown (NIC name) #网卡关闭

Without getting the words

We will begin to troubleshoot the problem in the following order:

Follow the steps above to troubleshoot the problem step by one.

Sometimes the company is not necessarily all Xshell also has the SSH client SecureCRT

We need to do some simple optimizations for the newly built Environment:

The first is to turn off the firewall

Systemctl Stop Firewalld
Then cancel the boot-up firewall
Systemctl Disable FIREWALLD

Security Policy
SELinux
Temporary shutdown Setenforce 0
Completely shut down the need to change the configuration file

Vi/etc/selinux/config change into a circle in the picture.

NetworkManager and network can manage networks, we use only

Systemctl Stop NetworkManager


Systemctl Disable NetworkManager
The 3 line output is as follows:


The Curl command-line browser
Because again domestic download things with foreign sources is too slow, so we changed the source of Ali

Mv/etc/yum.repos.d/centos-base.repo/etc/yum.repos.d/centos-base.repo.backup
Curl-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-7.repo
Yum Makecache


It is important to note that Yum uses Python2 to develop a python2 that cannot be upgraded, which will affect the use of YumDownload basic app back-y to prevent continuous confirmation when downloading

Yum install bash-completion net-tools vim lrzsz wget tree screen lsof tcpdump-y The following is a list of Linux directory structures:the core of Linux is everything.View directory ls/bin binary command file

Boot boot file of the boot system
directory where dev device device files are located
The directory of ETC configuration files
Home directory for normal home users

Create a normal user useradd name ls/home/View user passwd user name normal user home directory Lib 32-bit library files lib64 64-bit library files compatible with library files in Windows

Look at the binary execution path which python

View files ldd/usr/bin/python2.7 mnt temporary mount point opt general directory proc process to mount information about in-memory processes in/proc

See no process is also a file! All documents!

Root root user home directory run PID directory PID process name sbin root user can binary command file src do not sys system kernel run time generated file tmp temp directory usr user installed soft    Pieces of all files var frequently change file, mail, log file properties ls-il each column meaning inode (equivalent to index in database) first letter-(normal file) d (directory) L (Effect of soft connect shortcut) s (sock file) B (block storage file) C (Chars input/output string device) Find-type frw-r--r--9-bit permission bit belongs to the main group other R read W write x 9-bit permission to execute the last point, when the Seliunx run, the creation of the processing of the file will be a little fourth column: root owner Fifth Column: Root group Sixth column: File size 第7-9 column: Modify time of File 10th column: file name

Soft links and Hard links soft links: Equivalent to Windows above shortcut ln (link)-s path of the original file the new shortcut path LN can only be created on the file to create a hard-link inode number the same as the delete file principle: When this hard link value is 0, and no program is occupied, then this file has Remove soft links and hard links to the difference soft link real files, while hard link 5, compress package and decompress packages tar ZCV (verbose process plus v) f/tmp/duoduo.tar.gz packaged content (path) look inside the content tar tf to see the path of the file (without pressure) unpack the package Tar zxv (detailed process plus v) f/tmp/duoduo.tar.gz-c (Specify directory unpacked content (path) 6, user management Useradd view current User WhoAmI Linux system is multi-user, multi-terminal system SU-Switch User name lo Gout Exit login View User ID Delete user userdel-fr deleted user name Useradd user name-G 1000 (create user in specified group) 7, Rights Management chmod modify file or directory permissions chown modify file or directory owner and owner group Default user rights  Limit: 755r:4 ls Read permissions w:2 touch Write permissions x:1 CD Execute permissions 8, scheduled task how to command line send mail cat/root/anaconda-ks.cfg|mail-s ' Duoduoshuai ' [email Protectedmore hair will be sealed!!! format of timed sendTime- Sharing week00 9 * * * 9:00 timed delivery

Edit timed Task: Crontab-e View timed tasks: Crontab-l 9, network management vim/etc/sysconfig/network-scripts/ifcfg-eth0 to static IP Restart Network Service command Systemctl Resta RT Network command to view the gateway Route-n

10, install the httpd, run a static web site Web Services software: Apache Httpd,nginx installation yum install httpd-y check the monitoring Netstat-lntup

From the service:

Check if the HTTPD service is booting properly to see if 80 ports are listening

Systemctl Start httpd

There's a 80-port description.

Access to your own IP

Upload the game pack in cd/var/www/html, unzip the game pack

At last:

Find process

Ps-ef|grep ' httpd '

End process Kill PID Pkill httpd If the service is not controlled by Systemctl, then this service requires manual execution of the command to start, manual kill process to stop the service from starting again systemctl start httpd shutdown Service Systemctl St OP httpd

Linux Basic Environment Construction (2)

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.