1、 修改hostname主机名 查看一下hostname [root@localhost ~]# cat /etc/hostname localhost.localdomain [root@localhost ~]# vim /etc/hostname #永久生效 server0.example.com [root@localhost ~]# hostname test #临时生效,重启后失效 [root@localhost ~]# hostname Test 2、 使用ssh远程连接主机 [root@localhost ~]# ssh root@192.168.11.137 The authenticity of host '192.168.11.137 (192.168.11.137)' can't be established. ECDSA key fingerprint is 70:50:c9:2b:f9:32:07:87:82:e7:38:53:27:b7:84:1d. Are you sure you want to continue connecting (yes/no)? ssh的端口是22,为了安全起见,应该更改端口 更改端口的方式 [root@localhost ~]# vim /etc/ssh/sshd_config Port 22 更改为其他端口 重启一下ssh服务 [root@localhost ~]# systemctl restart sshd [root@localhost ~]# systemctl enable sshd 可以验证是否更改成功 [root@localhost ~]# netstat -tlunp | grep sshd 3、 简单安装lamp 先安装apache [root@localhost ~]# yum -y install httpd 重启http服务 [root@localhost ~]# systemctl restart httpd [root@localhost ~]# systemctl enable httpd 浏览器输入IP进行测试 查看端口 [root@localhost ~]# netstat -anutp | grep 80 配置文件 [root@localhost ~]# vim /etc/httpd/conf/httpd.conf 安装数据库mariadb [root@localhost ~]# yum -y install mariadb mariadb-server 重启mariadb [root@localhost ~]# systemctl restart mariadb [root@localhost ~]# systemctl enable mariadb 安装php [root@localhost ~]# yum -y install php php-mysql 测试一下 [root@localhost ~]# cd /var/www/html [root@localhost html]# vim index.php <?php phpinfo(); ?> 浏览器输入ip

未完,待续~