Set with vim
DEVICE="eth0" IPADDR="10.2.0.58" <=Change this part (line) NETMASK="255.255.255.0" GATEWAY="10.2.0.1" ONBOOT="yes" TYPE="Ethernet"
The default gateway is the gateway to the Internet from the server
(Usually a router). / etc / sysconfig / network-scripts / ifcfg-eth0 file
Edit the GATEWAY line of. A network restart is required after the change.
DEVICE="eth0" IPADDR="10.2.0.58" NETMASK="255.255.255.0" GATEWAY="10.2.0.1" <=Edit this line ONBOOT="yes" TYPE="Ethernet"
Edit the HOSTNAME line in the / etc / sysconfig / network file. Hoss After changing the name, you need to restart the system. '/etc/sysconfig/network'
NETWORKING=yes Edit this line HOSTNAME=www.example.com
Disable access control by SELinux by all means in server test etc.
If you want to, "SELINUX = permissive" in the / etc / sysconfig / selinux file
will do. A warning will be issued, but SELinux access control will be disabled.
After changing the settings, reboot the system.
To enable it, set "SELINUX = enforcing".
The DNS server referenced by the server is in the /etc/resolv.conf file.
Edit the nameserver line. The server belongs to the search line of the first line
Enter the domain name (it does not have to be).
search example.com nameserver 10.124.163.4 <=Edit this line nameserver 10.124.163.3 <=Edit this line
To set the language displayed on the server, / etc / sysconfig / i18n)
Specify as "LANG =" Locale "" in Isle. What is a locale?
It is a unit that expresses or region, "C" in the case of English environment, and'Ja. In the case of Japanese environment.
Specify "JP.UTF-8". On the server, to prevent garbled characters
It is a good idea to set it to "LANG =" C "" in the environment. Change will be logged next time
It will be effective from the time of operation.
LANG="C" SYSFONT="latarcyrheb-sun16" <=Edit this line
If you change the network settings, you need to restart the network.
[[email protected] ]# service network restart
Execute the ifconfig command. The "inet addr:" part on the second line is the server IP address.
[[email protected] ~]# ifconfig etho Link encap:Ethernet HWaddr 52:54:05:01:82:84 inet addr:10.2.0.58 Bcast:10.2.0.255 Mask:255.255.255.0 inet6 addr: fe80::5054:5ff:fe01:8284/64 Scope:Link Metric:1 MTU:1500 UP BROADCAST RUNNING MULTICAST RX packets:49298416 errors:0 dropped:0 overruns:0 frame:0 TX packets:73616594 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3808917908 (3.5 GiB) TX bytes:108033988984 (100.6 GiB) ・ ・ ・
Install with the yum command. The package name is httpd.
[[email protected] ]# yum install httpd
Start using the service command. The service name is httpd. start fee Instead, stop with stop and restart with restart.
Trootecentos -]# service httpd start
Reboot with the -r option to the shutdown command. Instead of now, "+10. If you specify, it will restart after 10 minutes.
[[email protected] ~]# shutdown -r now
Shut down the system with the -h option on the shutdown command.
[[email protected] ~]# shutdown -h now
When the w command is executed, the logged-in user and the access source (FROM) are displayed. Will be displayed.
[[email protected] -]# w 23:00:03 up 7 days, 26 min, 1 user, load average: 0.00, 0.00, 0.00 USER TTY FROM [email protected] IDLE JCPU PCPU WHAT centuser pts/058.80.227.149 22:48 0.00s 0.08s 0.03s sshd: centuser
Execute the useradd command with the user name specified.
[[email protected] -]# useradd webadmin
Execute the userdel command with the user name specified. With -r option This will also delete the user's home directory.
[[email protected] -]# userdel -r webadmin
Run the passwd command as the root user. Current password, new Enter your password twice.
[[email protected] ~]# passwd
Execute the passwd command by specifying the general user whose password you want to change. I will. Enter the password twice.
[[email protected] ~]# passwd webadmin
Use the netstat command to display open ports and check which services are running. I can admit it.
[[email protected] ~]# netstat -atn
This command keeps the packages installed on your system up to date Will be updated to.
[[email protected] ~]# yum update
Temporarily disable SELinux access control.
[[email protected] ]# setenforce 0
Enables SELinux in the disabled state.
[[email protected] ]# setenforce 1