Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1285621
  • 博文数量: 273
  • 博客积分: 5865
  • 博客等级: 准将
  • 技术积分: 3280
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-11 10:01
文章分类

全部博文(273)

文章存档

2015年(33)

2014年(11)

2013年(11)

2012年(136)

2011年(32)

2010年(50)

分类: LINUX

2012-02-21 13:38:03

检查更新

1
sudo yum check-update

安装更新

1
sudo yum update

安装网易的源,参考

1
2
3
4
5
## 下载源 ##
wget
wget
 
yum makecache

安装fastmirror,presto,使系统自动优先使用速度快的源

1
2
sudo yum -y install yum-fastestmirror
sudo yum install yum-presto
常用软件安装(此部分建议跳过……)

安装一坨视频相关软件

1
2
sudo yum install ffmpeg ffmpeg-libs gstreamer-ffmpeg xvidcore libdvdread libdvdnav lsdvd
sudo yum install gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly

安装gnome-tweak-tool,用于设置gnome桌面,简单易用。当然,如果想要华丽丽的效果,可下载compiz,(鉴于开发机,华丽丽桌面容易崩溃不说,还浪费性能,故pass掉,感兴趣的童鞋,自行股沟安装)

1
sudo yum install gnome-tweak-tool

为nautilus(相当于win下的explorer)安装右键打开终端

1
sudo yum install nautilus-open-terminal

鉴于Fedora对中文字体的显示不够友好,so~

1
2
3
sudo rpm -Uvh
sudo yum install freetype-infinality infinality-settings
sudo vim /etc/profile.d/infinality-settings.

找到USE_STYLE,注释掉原来的,更改为:

1
USE_STYLE="OSX"

安装chrome

添加以下依赖

1
2
3
4
5
6
7
8
9
## 添加google依赖 ##
vim /etc/yum.repos.d/google.repo
## 64-bit,粘帖以下内容 ##
[google-chrome]
name=google-chrome - 64-bit
baseurl=
enabled=1
gpgcheck=1
gpgkey=

管理员下安装对应chrome版本

1
2
3
4
5
6
## 稳定版 ##
yum install google-chrome-stable
## beta版 ##
yum install google-chrome-beta
## 开发者版(不稳定版) ##
yum install google-chrome-unstable

安装Filezilla(FTP客户端)

1
sudo yum install filezilla

安装即时通讯IM

1
sudo yum install pidgin

安装utter,截图、截屏,很好用,媲美win下的snagit

1
sudo yum install utter

安装流程图工具dia

1
sudo yum install dia

安装图像浏览器gthumb

1
sudo yum install gthumb

安装p7zip,强大的压缩解压缩工具,winRar在他面前就是个战斗力不足5的渣,弱爆了

1
sudo yum install p7zip

安装星际字典starDict(个人对他无爱,好吧,软件我还是喜欢web端的)

1
sudo yum install stardict

安装chm阅读器chmsee(有点儿弱)

1
sudo yum install chmsee
javaEE开发环境 java安装

去该页面下载

切换到root,给下下来的bin文件添加可执行权限,然后执行,安装

1
2
3
su -
chmod +x /home/stupig/Downloads/jdk-6u29-linux-x64-rpm.bin
/home/stupig/Downloads/jdk-6u29-linux-x64-rpm.bin

java目录

1
/usr/bin/java

javac目录

1
/usr/bin/javac

安装eclipse

先到下载eclipseSDK, 当前最新版是Indigo;

首先,切换到管理员

1
2
3
su -
## OR ##
sudo -i

解压缩eclipse tar文件到/opt目录下

1
2
## x86_64 - 64-bit ##
tar -xvzf eclipse-SDK-3.7.1-linux-gtk-x86_64.tar.gz -C /opt

对eclipse整个文件夹添加读权限

1
chmod -R +r /opt/eclipse

在/usr/bin里创建可执行文件

1
2
3
4
5
6
7
8
9
10
touch /usr/bin/eclipse
chmod 755 /usr/bin/eclipse
 
vim /usr/bin/eclipse
 
## 粘帖以下内容到文档中 ##
#!/bin/
export ECLIPSE_HOME="/opt/eclipse"
 
$ECLIPSE_HOME/eclipse $*

创建gnome桌面的快速启动图标

1
2
3
4
5
6
7
8
9
10
11
12
13
vim /usr/are/applications/eclipse.desktop
 
## 粘帖以下内容到文档中 ##
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse SDK 3.7.1
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true

鉴于Linux下的程序面板都有个巨大的标题栏,让本来就小的屏幕的编辑区域更小,所以俺又安装了国人开发的eclipse全屏插件,件google code

使用时,全屏切换快捷键为 + alt + z

安装svn(Subclipse)、maven、apatana插件(安装的V2.0,因为V3.0 键方法跟踪有问题)

安装完Subclipse,重启eclipse可能会出现以下错误:

1
2
3
4
5
Failed to load JavaHL Library.
These are the errors that were encountered:
no libsvnjavahl-1 in java.library.path
no svnjavahl-1 in java.library.path
no svnjavahl in java.library.path

原因是subversion缺少javaHL包,解决办法就是补上这个包XD:

1
sudo yum install subversion-javahl

至此,eclipse安装完毕

安装svn客户端
1
sudo yum install svn
安装maven2
1
sudo yum install maven2
node 开发环境 安装node

先去上下来tar包,然后解压到/opt文件夹下,最新的nodejs稳定版是0.6.6

安装nodejs需要安装gcc-c++来编译c++代码(node的底层代码实现),以及git和openssl

1
2
3
sudo yum install git gcc-c++ openssl-devel
tar -xzf node-0.6.6 -C /opt
sudo /opt/node-0.6.6/.configure && sudo make && sudo make install

安装npm(node仓库,包管理软件)

1
curl | sh

nodejs至此已经安装完毕

php开发环境(Linux nginx MySql php apache) MySql

切换到管理员

1
2
3
su -
## OR ##
sudo -i

检查可用MySql 版本, 并安装

1
2
yum list mysql mysql-server
yum install mysql mysql-server

启动MySql server并且设置开机启动MySql服务

1
2
systemctl start mysqld.service ## use restart after update
systemctl enable mysqld.service

安装设置MySql 安全相关

1
/usr/bin/mysql_secure_installation

将输出以下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
In order to log into MySQL to secure it, we\'ll need the current
password for the root user.  If you\'ve just installed MySQL, and
you haven\'t set the root password yet, the password will be blank,
so you ould just press enter here.
 
Enter current password for root (enter for none):
OK, successfully used password, moving on...
 
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
 
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
 
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You ould remove them before moving into a
production environment.
 
Remove anonymous users? [Y/n] Y
 ... Success!
 
Normally, root ould only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
 
Disallow root login remotely? [Y/n] Y
 ... Success!
 
By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and ould be removed
before moving into a production environment.
 
Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
 
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
 
Reload privilege tables now? [Y/n] Y
 ... Success!
 
Cleaning up...
 
All done!  If you\'ve completed all of the above steps, your MySQL
installation ould now be secure.
 
Thanks for using MySQL!

连接本地MySql数据库

1
2
3
mysql -u root -p
## OR ##
mysql -h localhost -u root -p

设置firewall,允许远程链接数据库

1
2
3
4
5
6
7
8
## 修改/etc/sysconfig/iptables ##
vim /etc/sysconfig/iptables
## 在COMMIT之前添加这一行 ##
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
## 重启firewall的ip允许列表 ##
service iptables restart
## OR ##
/etc/init.d/iptables restart
安装Nginx, PHP 5.3.8 and PHP-FPM

Nginx, PHP 5.3.8 和 PHP-FPM

1
yum install nginx php php-fpm php-common

安装PHP5.3.8相关模块

1
yum install php-pear php-pdo php-mysql php-pgsql php-pecl-memcache php-gd php-mbstring php-mcrypt php-xml

安装apache, PS: 开始没打算装Apache的,因为已经装了nginx,但既然说打造集成开发环境的话,so~

1
yum install httpd

启动HTTP server (httpd) 并设置开机启动 Apache

1
2
3
4
5
/etc/init.d/httpd start ## 重启apache服务时用到的命令
## OR ##
service httpd start ## 用重启apache服务时用到的命令
 
chkconfig --levels 235 httpd on ## 设置开机启动

为Apache开启远程连接

1
2
3
4
5
6
7
8
## 还是编辑firewall ip信任端口表 ##
vim /etc/sysconfig/iptables
## 在COMMIT之前添加 ##
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
## 重启firewall ##
service iptables restart
## OR ##
/etc/init.d/iptables restart

Apache 、Nginx 、Maven、Subversion默认安装目录都在/etc下

由于Apache和Nginx默认都侦听80端口,最关键的,他俩位置重了,都是组织后卫,so~我们应当有所选择的设置关掉另外一项服务.

这里以关掉Apache为例

1
2
3
4
5
6
7
8
## 关掉httpd服务 ##
/etc/init.d/httpd stop
## OR ##
service httpd stop
##  开启nginx服务
/etc/init.d/nginx start
## OR ##
service nginx start

但是这样做完,下次开机后,两项服务还是都会启动,还是会冲突,so~,直接关掉httpd的开机启动

1
2
3
4
5
## 阻止Apache的开机自启动 ##
chkconfig httpd off
## 设置Nginx的开机启动,设置过了就不需要了 ##
chkconfig --add nginx
chkconfig --levels 235 nginx on

至此,Apache安装结束

原创文章,转载请注明: 转载自

本文链接地址:

StuPig


阅读(1764) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~