vps linux Commands Reference

cal -3: Display a calendar uname -a : display linux version tail -f /var/log/messages : Monitor message in a log file  top free -m ps aux logout groups history last reboot

vps centos check cpu and memery usage

For memery use: free -m You will see an output like this: total       used       free     shared    buffers     cached Mem:           512        462         49          0         46…

Creating links to files and directories in unix centos vps

Creating a link to a directory It is often useful to change to another directory without typing its full pathname: symbolic links provide a useful shortcut to do this. A symbolic link differs from a hard link. It is a small file that contains a reference (by name) to a directory or file that already exists. Unlike normal…

add tomcat to auto start in centos VPS

This article assumes that you have already installed the Apache Tomcat Server on your Linux Centos machine. If you need help with your with Apache Tomcat Setup then please click on the Link below.   Step 1: Create a file named tomcat6 in your /etc/init.d directory $ cd /etc/init.d $ gedit tomcat6  If this file…

CentOS Linux VPS搭建Java环境

搭建Java环境要安装JDK,搭配Tomcat可以作为JSP Web服务器。系统先升级到目前最新。 yum check-update && yum update 安装软件说明: JRE(Java Runtime Enviroment)是Java运行环境,JDK(Java Development Kit)是Java开发环境,包括了Java开发工具、Java运行环境、及其它工具。 Java SE(standard edition)是标准版,Java EE(enterprise edition)是企业版,Java ME(micro edition)是用于移动和嵌入式设备。 这里JDK安装的是Java SE 6: JDK下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html 支持rpm包的linux系统下载jdk-6u27-linux-i586-rpm.bin,不支持RPM包的如Debian下载jdk-6u27-linux-i586.bin。 开始安装: cd /tmp wget http://download.oracle.com/otn-pub/java/jdk/6u27-b07/jdk-6u27-linux-i586-rpm.bin chmod a+x jdk-6u27-linux-i586-rpm.bin ./jdk-6u27-linux-i586-rpm.bin 安装的路径为/usr/java/jdk1.6.0_27,编辑环境变量: vim /etc/profile 在最后加入: export JAVA_HOME=/usr/java/jdk1.6.0_27 export CALSSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin 重启系统: reboot 安装Tomcat,这里下的是已经编译好的Binary Distributions: cd /tmp wget http://labs.renren.com/apache-mirror/tomcat/tomcat-6/v6.0.33/bin/apache-tomcat-6.0.33.tar.gz tar -zxvf apache-tomcat-6.0.33.tar.gz…

Add User to root Group on CentOS VPS

1. Add a new user. In this example, I used ‘myroot’ and then set the password. [root@CentOS57 ~]# useradd myroot [root@CentOS57 ~]# passwd myroot Changing password for user myroot. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. 2. Check current groups for ‘root’ user. [root@CentOS57 ~]# groups root bin daemon…

VPS上使用ssh mysql命令

连接ssh, 在terminal中:ssh -l root ip , 敲入密码,搞定。 navigate到usr/bin下面(有mysql执行文件的地方),开始mysql 一、mysql服务的启动和停止 net stop mysql net start mysql 二、登陆mysql 语法如下: mysql -u用户名 -p用户密码 键入命令mysql -uroot -p, 回车后提示你输入密码,输入12345,然后回车即可进入到mysql中了,mysql的提示符是: mysql> 注意,如果是连接到另外的机器上,则需要加入一个参数-h机器IP 三、增加新用户 格式:grant 权限 on 数据库.* to 用户名@登录主机 identified by “密码” 如,增加一个用户user1密码为password1,让其可以在本机上登录, 并对所有数据库有查询、插入、修改、删除的权限。首先用以root用户连入mysql,然后键入以下命令: grant select,insert,update,delete on *.* to user1@localhost Identified by “password1”; 如果希望该用户能够在任何机器上登陆mysql,则将localhost改为”%”。 如果你不想user1有密码,可以再打一个命令将密码去掉。 grant select,insert,update,delete on mydb.* to user1@localhost…