Linux 服务器中搭建环境

吃可爱长大的小学妹 提交于 2020-11-23 23:57:56
Linux:
 
Linux发行版本 : CentOS  Ubuntu RedHat .....
 
vmware:
 
xshell:
 
yum:
----------------
安装apache : yum install -y httpd
卸载apache : rpm -e httpd
查看apache是否安装成功 : apachectl -v
 
网站根目录 : /var/ www/html/
启动apache : centos6.5 -> service httpd start
             centos7   -> cd /bin -> systemctl start httpd.service
 
启动服务(等同于service httpd start): systemctl start httpd.service
停止服务(等同于service httpd stop) : systemctl stop httpd.service
重启服务(等同于service httpd restart): systemctl restart httpd.service
查看服务是否运行(等同于service httpd status): systemctl status httpd.service
开机自启动服务(等同于chkconfig httpd on): systemctl enable httpd.service
开机时禁用服务(等同于chkconfig httpd on): systemctl disable httpd.service
 
----------------
安装php : yum install -y php
注意:安装完php后必须重启apache
 
----------------
安装mysql:
 
从最新版本的linux系统开始,默认的是 Mariadb而不是mysql!
使用系统自带的repos安装很简单:
 
yum install mariadb mariadb-server
systemctl start mariadb ==> 启动mariadb
systemctl enable mariadb ==> 开机自启动
mysql_secure_installation ==> 设置 root密码等相关
mysql -uroot -p123456 ==> 测试登录!
修改服务器mysql访问权限:GRANT ALL PRIVILEGES ON *.* TO ‘myuser’@'%’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION
                        mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
 
----------------
安装mysql扩展 : yum install -y php-mysql
 
 
安装phpmyadmin:
 
==========================
ftp:
winscp:
 
 
mysql5.7:
    root
    BQ-9iwst*tan    //password
2017-12-08T04:52:28.062404Z 1 [Note] A temporary password is generated for root@localhost: 0>MHLWpAz/jz
         0>MHLWpAz/jz    //password
         Admin@123       //password
 
 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!