iterm2免密码登录Linux

用惯了Win的xshell,忽然到了mac下面就忽然茫然了,后来厚着脸问人家用什么工具,人家说用 iterm2+证书登录,恍然大悟,

os x 不也就是linux吗?

那就简单了,在iterm2 中输入ssh-keygen 一路回车

然后在~/.ssh 产生了id_rsa.pub和id_rsa 文件,将pub公钥上传到服务器的~/.ssh/authorized_keys ,然后修改配置

修改sshd配置文件(/etc/ssh/sshd_config).
找到以下内容,并去掉注释符”#“
=========================
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile  .ssh/authorized_keys
=========================

 

然后重启ssh,这下在iterm2 中配置下连接指令,搞定。

Linux (centos)服务器配置常用命令

Linux常用的YUM命令
CentOS yum -y install httpd
CentOS yum -y install httpd*
CentOS yum -y install httpd php php-gd mysql
CentOS yum -y remove httpd
CentOS yum -y remove httpd*
CentOS yum -y remove httpd php php-gd mysqlyum search iostat

MYSQL自动启动
chkconfig mysqld on 设置MySQL服务随系统启动自启动
chkconfig –list mysqld 确认MySQL自启动 两个 —
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off 如果2–5为on的状态就OK

登陆mysql
mysql -u用户名 -p用户密码
修改你要的配置

新建文件夹
mkdir 文件夹名称
删除文件夹
rmdir 文件夹名称

解压 Tomcat6
tar zxvf apache-tomcat-6.0.29.tar.gz

安装jdk环境
jdk1.6提供以下两种自解压文件:
1)jdk-6u22-linux-i586.bin
2)jdk-6u22-linux-i586-rpm.bin
3、我下载的是jdk-6u22-linux-i586-rpm.bin
4、给所有用户添加可执行的权限
#chmod +x jdk-6u22-linux-i586-rpm.bin
5、执行该文件,命令如下:
#./jdk-6u22-linux-i586-rpm.bin
执行后会解压出一些rpm软件包,其中有jdk-6u22-linux-i586.rpm这是主程式包,接下来就是安装这个主程序包。
6.、切换到root用户,进入jdk-6u22-linux-i586.rpm存放的目录,执行如下命令:
rpm -ivh jdk-6u22-linux-i586.rpm
安装软件会将JDK自动安装到 /usr/java/jdk-1.6.0_22-fcs目录下。

不重启修改时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

打包文件夹
tar cvfz 包名.tar.gz 文件……

centos下使用yum安装Zend Optimizer

从网上寻找错误一片,我只能说你们c的时候就不能全一点,这里成功安装留个痕迹吧。希望对后来人有用。。
1. 创建源环境
wget -q -O – http://www.atomicorp.com/installers/atomic.sh | sh

# vi /etc/yum.repos.d/i.repo
添加:
[atomic]
name = CentOS / Red Hat Enterprise Linux $releasever – atomicrocketturtle.com
mirrorlist = http://www.atomicorp.com/mirrorlist/atomic/centos-5-$basearch
#mirrorlist = http://www.atomicorp.com/channels/atomic/centos/5/mirrors-atomic
enabled = 1
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
gpgcheck = 1

# Almost Stable, release candidates for [atomic]
[atomic-testing]
name = CentOS / Red Hat Enterprise Linux $releasever – atomicrocketturtle.com – (Testing)
mirrorlist = http://www.atomicorp.com/mirrorlist/atomic-testing/centos-5-$basearch
enabled = 0
priority = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
gpgcheck = 1

# Untested, Unstable, known buggy, and incomplete packages.
#[atomic-bleeding]
#name = CentOS / Red Hat Enterprise Linux $releasever – atomicrocketturtle.com – (Bleeding)
#baseurl = http://www.atomicorp.com/channels/atomic-bleeding/centos/5/$basearch/
#enabled = 0
#priority = 1
#protect = 0
#gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt
#gpgcheck = 1
2.安装
yum check-udpate
yum install php-zend-optimizer