查看一下hostname
[ [email protected] ~]# cat /etc/hostname
localhost.localdomain
[ [email protected] ~]# vim /etc/hostname #永久生效
server0.example.com
[ [email protected] ~]# hostname test #临时生效,重启后失效
[ [email protected] ~]# hostname
Test
2、 使用ssh远程连接主机
[ [email protected] ~]# 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,为了安全起见,应该更改端口
更改端口的方式
[ [email protected] ~]# vim /etc/ssh/sshd_config
Port 22 更改为其他端口
重启一下ssh服务
[ [email protected] ~]# systemctl restart sshd
[ [email protected] ~]# systemctl enable sshd
可以验证是否更改成功
[ [email protected] ~]# netstat -tlunp | grep sshd
3、 简单安装lamp
先安装apache
[ [email protected] ~]# yum -y install httpd
重启http服务
[ [email protected] ~]# systemctl restart httpd
[ [email protected] ~]# systemctl enable httpd
浏览器输入IP进行测试
查看端口
[ [email protected] ~]# netstat -anutp | grep 80
配置文件
[ [email protected] ~]# vim /etc/httpd/conf/httpd.conf
安装数据库mariadb
[ [email protected] ~]# yum -y install mariadb mariadb-server
重启mariadb
[ [email protected] ~]# systemctl restart mariadb
[ [email protected] ~]# systemctl enable mariadb
安装PHP
[ [email protected] ~]# yum -y install PHP PHP-MysqL
测试一下
[ [email protected] ~]# cd /var/www/HTML
[ [email protected] HTML]# vim index.PHP
<?PHP
PHPinfo();
?>
浏览器输入ip
未完,待续~
总结以上是内存溢出为你收集整理的Linux小课堂开课了(5)全部内容,希望文章能够帮你解决Linux小课堂开课了(5)所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)