标签:linux
最近在公司云服务器搭建应用,需要安装常用的软件,这里简要收集一些常用软件的安装方法。
一、安装ftp服务
1.yum安装
<span style="font-size:18px;">yum install vsftpd</span>
2.查看安装路径
[root@kingson-test-fser6 ~]# which vsftpd /usr/sbin/vsftpd
3. 查看ftp 服务器状态
#service vsftpd status
4. 启动ftp服务器
#service vsftpd start
4. 重启ftp服务器
#service vsftpd restart
5. 查看服务有没有启动
#netstat -an | grep 216.添加ftp用户
下面是添加ftpuser用户,设置根目录为/home/wwwroot/ftpuser,禁止此用户登录SSH的权限,并限制其访问其它目录。
(1)修改/etc/vsftpd/vsftpd.conf
将底下三行
改为
(2)编辑文件chroot_list:
内容为ftp用户名,每个用户占一行,如:
peter
john
(3)重新启动vsftpd
1、500 OOPS: cannot change directory
解决方法:
在终端输入命令:
就OK了!
原因:这是因为服务器开启了selinux,这限制了FTP的登录。
例子:
C:\Users\Kunxin>ftp 10.199.144.198 连接到 10.199.144.198。 220 (vsFTPd 2.2.2) 用户(10.199.144.198:(none)): kingson 331 Please specify the password. 密码: 230 Login successful. ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. 226 Directory send OK. ftp> pwd 257 "/" ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. 226 Directory send OK. ftp> cd /user 550 Failed to change directory. ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. tempftp 226 Directory send OK. ftp: 收到 12 字节,用时 0.00秒 12.00千字节/秒。 ftp> pwd 257 "/" ftp> lcd g:目前的本地目录 G:\。 ftp> get tempftp 200 PORT command successful. Consider using PASV. 150 Opening BINARY mode data connection for tempftp (0 bytes). 226 Transfer complete. ftp> quit
二、安装JDK
tar -zxvf jdk-7-linux-x64.tar.gz
1.解压到指定安装路径
tar -zxvf /home/kingson/jdk-7u71-linux-x64.gz -C /apps/svr/jdk
2.配置环境变量
unset i unset pathmunge export LANG=en_US.UTF-8 export JAVA_HOME=/apps/svr/jdk/jdk1.7.0_71 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar "/etc/profile" 84L, 1964C written
例子:
[root@kingson-test-fser6 jdk1.7.0_71]# java -version -bash: java: command not found [root@kingson-test-fser6 jdk1.7.0_71]# source /etc/profile [root@kingson-test-fser6 jdk1.7.0_71]# java -version java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode) [root@kingson-test-fser6 jdk1.7.0_71]# which java /apps/svr/jdk/jdk1.7.0_71/bin/java参考:http://www.cnblogs.com/samcn/archive/2011/03/16/1986248.html
三、安装mysql
1.yum安装
yum install mysql-server mysql-devel mysql
例子:
[root@kingson-test-fser6 profile.d]# which mysql /usr/bin/mysql [root@kingson-test-fser6 profile.d]# /etc/rc.d/init.d/mysqld status mysqld is stopped [root@kingson-test-fser6 profile.d]# service mysqld start Initializing MySQL database: Installing MySQL system tables... OK Filling help tables... OK 。。。。 [root@kingson-test-fser6 profile.d]# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.1.73 Source distribution 。。。
设置mysql帐号
/q
例子:
[root@kingson-test-fser6 profile.d]# mysql -u root -p mysql Enter password: Reading table information for completion of table and column names
3. 本地计算机连接远程 mysql服务器:
./mysql -h "192.168.1.244" -u root -p
解决方法:
(1) 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改成"%"
mysql -u root -pvmwaremysql>use mysql;mysql>update user set host = ‘%‘ where user = ‘root‘;mysql>select host, user from user;
(2)授权法。例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO ‘myuser‘@‘%‘ IDENTIFIED BY ‘mypassword‘ WITH GRANT OPTION;
例如:
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘192.168.1.3‘ IDENTIFIED BY ‘mypassword‘ WITH GRANT OPTION;
这个时候就会往mysql的user表里面添加一条数据:
INSERT INTO `user` VALUES (‘%‘, ‘root‘, ‘*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘,
‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘Y‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘0‘, ‘0‘, ‘0‘, ‘0‘);
如上图所示
四、安装SVN
1.yum安装
yum -y install subversion
2.查看版本
svnserve --version
[root@kingson-test-fser6 ~]# which svn /usr/bin/svn
http://www.cnblogs.com/jiqing9006/p/3370627.html
五、安装git
1.yum安装
yum install git
2.查看版本和安装路径
[root@kingson-test-fser6 yum.repos.d]# git --version git version 1.7.1 [root@kingson-test-fser6 yum.repos.d]# which git /usr/bin/git3.使用git
ssh-keygen -t rsa -C "kingson.wu@vipshop.com" Your public key has been saved in /root/.ssh/id_rsa.pub. vi /root/.ssh/id_rsa.pub
tar zxvf /home/kingson/apache-tomcat-7.0.57.tar.gz -C /apps/svr mv apache-tomcat-7.0.57 tomcat chmod +x /apps/svr/tomcat
export TOMCAT_HOME=/apps/svr/tomcat export CATALINA_HOME=/apps/svr/tomcat source /etc/profile
3.启动tomcat
[root@kingson-test-fser6 tomcat]# sh /apps/svr/tomcat/bin/startup.sh Using CATALINA_BASE: /apps/svr/tomcat Using CATALINA_HOME: /apps/svr/tomcat Using CATALINA_TMPDIR: /apps/svr/tomcat/temp Using JRE_HOME: /apps/svr/jdk/jdk1.7.0_71 Using CLASSPATH: /apps/svr/tomcat/bin/bootstrap.jar:/apps/svr/tomcat/bin/tomcat-juli.jar Tomcat started.
4.设置UTF-8编码
server.xml:
<Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />
参考:http://blog.sina.com.cn/s/blog_866c5a5d0101cn1l.html
七、安装memcached
1.检查是否安装了libevent
rpm -q libevent (首先检查系统是否安装了Libevent)
yum info libevent libevent-devel yum -y install libevent libevent-devel3.安装memcached
# tar -zxvf memcached-1.4.5.tar.gz
# cd memcached-1.4.5
# ./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent/
# make
# make install
./configure --prefix=/apps/svr/memcached --with-libevent=/usr/make && make install
4.配置Memcached
(1)启动Memcached
# cd /usr/local/memcached/bin/
# ./memcached -u root -d
(2)将Memcached加入系统自动启动
# vim /etc/rc.local
# /usr/local/memcached/bin/memcached -u root -d
(3)查看Memcached
参考:http://www.centoscn.com/image-text/config/2013/0827/1459.html
# ps -ef |grep memcached
5.查看状态:
八、安装gcc
yum install gcc
九、安装telnet
service telnet { flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure += USERID disable = yes } 将disable项由yes改成no。
1.解压到安装目录
tar -zvxf /home/kingson/apache-maven-3.2.5-bin.tar.gz -C /apps/svr mv apache-maven-3.2.5 maven
export M2_HOME=/apps/svr/maven export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
[root@kingson-test-fser6 maven]# source /etc/profile [root@kingson-test-fser6 maven]# mvn -v
(1) #cd /home/apaduser/.m2
(2) 如果没有.m2目录,则可以手动添加一个
(3) #mkdir .m2
十一、安装locate
1.yum安装
yum install mlocate
十二、安装evil
[root@kingson-test-fser6 bin]# ll
total 28
-rw-r--r-- 1 root root 1827 Jan 19 14:09 config.sh
-rw-r--r-- 1 root root 23287 Jan 19 14:08 evil
[root@kingson-test-fser6 bin]# evil
-bash: /usr/local/bin/evil: Permission denied
[root@kingson-test-fser6 bin]# chmod u+x evil
[root@kingson-test-fser6 bin]# evil
/etc/profile
rsync -avz root@10.199.144.198:/usr/local/bin/evil /usr/local/bin/evil
十三、中文乱码
yum groupinstall chinese-support
vi /etc/sysconfig/i18n
#LANG=en_US.UTF-8
LANG=zh_CN.UTF-8
参考:http://jingyan.baidu.com/article/ab69b270de8b4f2ca7189f1d.html
十四、安装证书
keytool -import -trustcacerts -alias casserver -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file /apps/cas.oa.vipshop.com.cer -storepass changeit
lftp介绍:
lftp 是一个功能强大的下载工具,它支持访问文件的协议: ftp, ftps, http, https, hftp, fish.(其中ftps和https需要在编译的时候包含openssl库)。llftp的界面非常像一个shell: 有命令补全,历史记录,允许多个后台任务执行等功能,使用起来非常方便。它还有书签、排队、镜像、断点续传、多进程下载等功能。
lftp 安装:
装好后看一下
# lftp -v
# man lftp
标签:linux
原文地址:http://blog.csdn.net/kingson_wu/article/details/42773557