I. Linux initialization service
First figure out four concepts:
Process: Running program, has its own independent memory space,
Thread: is the subordinate unit of the process, the cost is smaller than the process, there is no independent memory space
Job: A series of processes that are composed to accomplish a task
Service: The essence is the daemon, running in the background, responding to various requests
Linux Classic Initialization daemon:
Init: Has been eliminated
Upstart int: Retired
SYSTEMD: Compatible with the previous two, the mainstream Linux system now basic use of this initialization process
Basic operation:
Systemctl status .... View service Status
Systemctl stop .... Stop Service
Systemctl start .... Start the service
Systemctl Restart ... Restart Service
Systemctl enable ..... Enable service (boot)
Systemctl Disable ... Disabling services
Two. Install the server on Linux
Basic operations
1. Install the server
2. Configure the server
3. Enable the server
4. Accessing the server through a client or browser
Specific server configuration
(1) Print server: (Universal UNIX Printing System)
installation: Yum Install cups
add printer
configuration file:/etc/cups/cupsd.conf
start service: Systemctl start cups.service
(2) Configure the Web server
The most popular Web server today is Apache ( HTTPD) Web server, Apache is an open source project, configuration is very simple, can provide
encrypted communication (HTTPS) and secure Web sites that use different types of authentication
1. Installation: Yum groupinstall "Web Server"
2. configuration file:/etc/httpd/conf/httpd.conf (Master profile)
/etc/httpd/conf.d any file ending in. conf as an Apache configuration (secondary configuration file)
directory tag is used to specify a path based on the file system location
location tag to specify the URL to access files and directories
3. Start Service: Systemctl start httpd.service
4. Accessing the Web server: Accessing the
from the browser
(3) Configuring the FTP server
File Transfer Protocol (FTP) is one of the earliest protocols used to share files over a network today, because in clear text between the FTP client and the server
Send information, so FTP is suitable for sharing common documents, open source repositories
1. Installation: Yum intsall vsftpd
2. Configuration file:/etc/vsftpd/vsftpd.conf
To set User access:
anonymous_enable=yes Allow anonymous user access
local_enable=yes allow local user access
Allow upload
anon_upload_enable=yes: Allow anonymous users to upload
anon_mkdir_write_enable=yes: Allow anonymous users to create directories
Create a directory on the server side where anonymous users can write:
mkdir Directory
chown ftp:ftp Directory
chmod 775 Catalogue
3. Start Service: Systemctl start Vsftpd.service
4. Access FTP server: can be accessed via Firefox or another client
(4) Configuring the Samba server
The Samba project implements shared files between Windows systems, and the Samba project strives to make the software safe and reliable
1. Installation: Samba and samba-client
2. configuration file:/etc/samba/smb.conf
The file consists of the following predefined sections:
Global: The settings for this section apply to the Samba server as a whole
Homes: The settings in this section determine whether Samba users can view the home directory or write to the home directory
Printers: The settings in this section tell samba whether to use a printer configured for Linux printing
Note To add Samba users: Samba users must first be Linux users (smbpasswd-a user name)
3. Start-up service: Nmb.service and Smb.service Services
4. Access to the Samba server: Access via Windows Explorer (\\IP address)
Via Client access (smbclient-u user name//IP address/directory)
(5) Configuring Server for NFS
NFS (Network file system) allows Linux to connect file systems on other computers to the local directory structure
1. Installation: Yum Intsall nfs-utils
2. configuration file:/etc/exports
Format: Directory Host (Options ...) Host (Options ...)
Directory indicates the directories to be shared, and the host indicates which client computers the share is limited to, and options includes various
Used to define security measures with shared directories
3. export file system; EXPORTFS command
4. Start Service: Systemctl start Nfs-server.service
5. Mount the file system on the client: Mount command
Unmount the file system; Umount
Attention!! :
The firewall and selinux need to be considered when configuring the server
When you share a file, you need to take into account the different user permissions on the file (read-write delete, etc.)
Three. Network Management
1. Firewall: Filtering data packets in and out of the computer system or network
There are more FIREWALLD services installed on Linux systems now
The graphical interface can be installed for configuration: Yum install firewalld firewall-config installation
Firewall-config & Startup
Perform some configuration operations
2.SELinux: Security Enhancement module deployed on Linux
Total disabled. Permissive. Enforcing three modes of operation
Disabled:selinux is closed.
Permissive: Security policy is not enforced
Enforcing: Enforcement of all security policy rules
To view the current SELinux mode: Getenforce
Change the current mode: Setenforce 0 or 1 0 means permissive,1 represents enforcing
SELinux master configuration file path:/etc/selinux/config
3.Network Mapper (NMAP): For security audits and web search
Scan this machine with the Namp command to see which ports are open externally
Use the Nmap command on the host on another host to view ports that can be accessed externally
If these common ports such as 80 are not displayed, the port is filtered and the firewall needs to be checked
Four. Troubleshooting Linux
The approximate process of booting a Linux system:
1. Turn on the power
2. Through the BIOS or UEFI firmware to find the system boot location (from the hard disk boot, or the CD-ROM boot, or USB drive boot ...)
3. Start the loader (for example, grub boot) to start the system
4. Load the kernel and start checking the hardware
5. Start the initialization process (init or SYSTEMD)
6. Load a variety of services ....... .......
Spit The Groove: Linux is fairly stable, generally there is no problem. Most of the time, there is a problem with modifying the configuration file, causing the system to fail
So emphasize here; be sure to back up!!!!!! before modifying the configuration file
Be sure to back up!!!!!! before modifying the configuration file
Be sure to back up!!!!!! before modifying the configuration file
When encountering problems, finding the problem is an important indicator of the level of an IT practitioner (nonsense (╯-╰))
A summary of Learning Linux 2