1、用yum安装软件提示cannot find a valid baseurl for repo:base/7/x86_64
原因是网络不通。
解决办法一:
1、打开vi /etc/sysconfig/network-scripts/ifcfg-eth0(每个机子都可能不一样,但格式会是“ifcfg-eth数字”),把ONBOOT=no,改为ONBOOT=yes
2、重启网络:service network restart
解决办法二:
1、打开 vi /etc/resolv.conf,增加 nameserver 8.8.8.8
2、重启网络: service network restart
2、ifconfig Command not found
执行:yum install net-tools
3、install oracle jdk on linux
1、卸载open jdk:sudo apt-get update && apt-get remove openjdk*
2、配置oracle jdk:(“/opt/java/jdk1.7.0_25”是jdk解压后的目录)
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.7.0_25/bin/java" 1
sudo update-alternatives --set java /opt/java/jdk1.7.0_25/bin/java
4、install mysql —— mariadb
安装:yum install mariadb-server mariadb
相关命令:
systemctl start mariadb #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动
默认root密码为空,通过以下命令修改密码:
登陆
mysql -u root
> use mysql;
> update user set password=password('123456') where user='root';
> flush privileges;
> exit;
再次登陆验证是否成功
mysql -u root (不能登陆)
mysql -u root -p (输入密码后,成功登陆)
如果验证不成功,重启mariadb服务后再次验证。
5、允许远程连接mysql(mariadb)数据库
1、开启3306端口:
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
2、允许任何主机远程访问数据库
登陆数据库
mysql -u root -p
> use mysql;
> grant all privileges on *.* to 'root'@'%'with grant option;
> flush privileges;
> exit;
如果仍然不能通过ip直接访问数据库,参考第4条,再次修改root用户的密码即可。
6、安装nginx (http://nginx.org/en/linux_packages.html#stable)
1、To set up the yum repository for RHEL/CentOS, create the file named /etc/yum.repos.d/nginx.repo with the following contents:
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “5”, “6”, or “7”, for 5.x, 6.x, or 7.x versions, respectively.
2、执行安装命令:yum install nginx
copyright = {
"作者": "墨衣夜行",
"本文链接": "http://my.oschina.net/letao/blog/524487"
}