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 [email protected]
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
未完,待续~
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。