分享、学习、提高
Thank you for reading...
2008/11/10 20:01
Tags: ,


一般Linux系统会自带设置alias cp='cp -i',搞的覆盖时每次都会提示,加-f都没用。

这里有两种解决方法:

1.unalias cp
取消cp的alias。
也可以执行:alias cp=cp,来重置cp。

2.执行命令时cp前加\。
即cp aaa /opt/aaa
输入:\cp aaa /opt/aaa
\的意思就是该命令不使用alias。
2008/07/10 10:25
Tags: ,
默认在linux下是没rar的解压软件的,因此一般本地压缩使用winrar,选择压成ZIP后上传,使用unzip来解压。
但昨天下了一个大文件rar文件,没办法,只好去找来linux下的rar解压软件,来完成解压。

还找了一段时间,才找到。发到软件下载那边共享,rarlinux下载

这个是3.6.0的版本
tar -zxf rarlinux-3.6.0.tar.gz
cd rarlinux-3.6.0
make
没看到configure,所以就直接make了。

解压hx.rar文件:
rar x hx.rar

具体参数可以rar -h查看,下面例出一些。
RAR 3.60   Copyright (c) 1993-2006 Alexander Roshal   5 Aug 2006
Shareware version         Type RAR -? for help

Usage:     rar <command> -<switch 1> -<switch N> <archive> <files...>
               <@listfiles...> <path_to_extract\>

<Commands>
  a             Add files to archive
  c             Add archive comment
  cf            Add files comment
  ch            Change archive parameters
  cw            Write archive comment to file
  d             Delete files from archive
  e             Extract files to current directory
  f             Freshen files in archive
  i[par]=<str>  Find string in archives
  k             Lock archive
  l[t,b]        List archive [technical, bare]
  m[f]          Move to archive [files only]
  p             Print file to stdout
  r             Repair archive
  rc            Reconstruct missing volumes
  rn            Rename archived files
  rr[N]         Add data recovery record
  rv[N]         Create recovery volumes
  s[name|-]     Convert archive to or from SFX
  t             Test archive files
  u             Update files in archive
  v[t,b]        Verbosely list archive [technical,bare]
  x             Extract files with full path

最新的版本可以去官方获取,官方主页是:http://www.rarlab.com

2007/10/16 12:53
Tags:
一台Linux服务器,早在message中就看到许多
引用
CPU2: Temperature above threshold
CPU2: Running in modulated clock mode
问了下网管,网管说是CPU 温度过高的提示,没问题,不用管它。

今天上服务器更改些东西,发现不断弹出这类消息,严重影响我操作:(

搜索了一下,发现屏蔽此类消息的方法。

vi /etc/syslog.conf
注释掉 *.emerg 这一行
/etc/init.d/syslog restart

这样就不会出现 CPU 温度过高的警告了。
2006/11/24 17:14
Tags: ,
新建用户
useradd ftphx -s -s /sbin/nologin -d /home/hx/www
 -d设置用户默认目录
 -s不允许其登录,即无登录系统的权限

给用户设置密码
passwd ftphx
使ftphx能控制/home/hx/www下所有文件
chown -R ftphx:ftphx /home/hx/www
这样就可以使用ftphx用户来控制这个目录了。


新建mysql用户管理某数据库。
Grant All on db.* to db identified by '123456'


如果你认为每次启动apache都必须去这个目录,或者输入这么长的路径很麻烦,可以用ln做链接如
ln -s /usr/local/apache2/bin/apachectl /usr/sbin/apache
就可以用 apache start/stop/restart等操作了。


上次安装apache忘了加--enable-module=rewrite,因此不支持rewrite。
这次重装
#./configure --prefix=/usr/local/apache2 --enable-modules=most --enable-rewrite --enable-so
make;make install

后gump告诉我,原来可以不用重装,如加上expires模块:
bin/apxs -i -a -c /root/software/httpd-2.0.55/modules/metadata/mod_expires.c

以下命令查看已安装的模块
bin/httpd -l
2006/11/03 12:33
Tags: , , , ,
下载官方推荐的稳定版本httpd-2.2.3.tar.gz,下载地址:http://down.itlearner.com/soft/2356.shtml

安装apache2
#./configure --prefix=/usr/local/apache2 --enable-module=alias  --enable-module=most \
--enable-module=vhost_alias --enable-shared=vhost_alias --enable-module=so --enable-shared=max
# make;make install

--------------------------------------------------------------

下载目前最新稳定版本mysql-standard-5.0.27-linux-i686-glibc23.tar.gz
无需安装,解压后移至/usr/local/mysql.

# groupadd mysql #建立mysql组
# useradd mysql -g mysql #建立mysql用户并且加入到mysql组中

# cd /usr/local/mysql

然后设置权限

# chown -R root . #设定root能访问/usr/local/mysql
# chown -R mysql data #设定mysql用户能访问/usr/local/mysql/data ,里面存的是mysql的数据库文件
# chown -R mysql data/. #设定mysql用户能访问/usr/local/mysql/data下的所有文件
# chown -R mysql data/mysql/. #设定mysql用户能访问/usr/local/mysql/data/mysql下的所有文件
# chgrp -R mysql . #设定mysql组能够访问/usr/local/mysql

安装mysql表:
bin/mysql_install_db --user=mysql
运行mysql:

# /usr/local/mysql/bin/mysqld_safe --user=mysql &

修改root密码,默认为空:

/usr/local/mysql/bin/mysqladmin -u root password 'newpassword'

MYSQL安装完成

----------------------------------------------------------------

下载最新稳定版本php-5.1.6.tar.gz,下载地址:http://down.itlearner.com/soft/2355.shtml

1. 安装zlib (安装libpng和gd前需要先安装zlib),下载地址:http://down.itlearner.com/soft/2359.shtml
# tar zxvf zlib-1.2.3.tar.gz
# cd  zlib-1.2.3
# ./configure
# make;make install

2. 安装libpng,下载地址:http://down.itlearner.com/soft/2362.shtml
# tar zxvf libpng-1.2.12.tar.gz
# cd libpng-1.2.12
# ./configure
# make;make install

3. 安装freetype,下载地址:http://down.itlearner.com/soft/2361.shtml
# tar zxvf freetype-2.2.1.tar.gz
# cd freetype-2.1.10
# ./configure --prefix=/usr/local/freetype
# make;make install

4. 安装jpeg,下载地址:http://down.itlearner.com/soft/2360.shtml
# tar zxvf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# mkdir /usr/local/jpeg
# mkdir /usr/local/jpeg/bin
# mkdir /usr/local/jpeg/lib
# mkdir /usr/local/jpeg/include
# mkdir /usr/local/jpeg/man
# mkdir /usr/local/jpeg/man/man1
# ./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
# make;make install

5. 安装gd,下载地址:http://down.itlearner.com/soft/2357.shtml
# tar zxvf gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure --prefix=/usr/local/gd --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype --with-png --with-zlib
//编译过程中会看到如下信息
** Configuration summary for gd 2.0.33:

   Support for PNG library:          yes
   Support for JPEG library:         yes
   Support for Freetype 2.x library: yes
   Support for Fontconfig library:   no
   Support for Xpm library:          no
   Support for pthreads:             yes
//可以看到png 、 jpeg 、 freetype都已经安装上了
# make
# make install

6. 正式安装php
# tar zxvf php-5.1.6.tar.gz
# cd php-5.1.6
# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd --with-zlib --with-png --with-jpeg --with-freetype --enable-sockets --with-iconv --enable-mbstring --enable-track-vars --enable-force-cgi-redirect --with-config-file-path=/usr/local/php5/etc

7.整合php和apache
cp php.ini-dist  /usr/local/php5/etc/php.ini
vi /usr/local/php5/etc/php.ini
将extension=php_mysql.dll前面的#去掉

8. 安装ZendOptimizer,下载地址:http://down.itlearner.com/soft/1023.shtml
# tar zxvf ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
# cd ZendOptimizer-3.0.1-linux-glibc21-i386
# ./install.sh
安装操作: [ok] -> [EXIT] -> [YES] -> [/httpd/zend] -> [/httpd/apache/conf] -> [yes] -> [OK] -> [OK] -> [NO]

遇到的一些错误解决:

1.php5在configure时提示:configure: error: mysql configure failed.,只用--with-mysql参数提示:Cannot find MySQL header files under yes,去掉--with-mysql参数可以安装,php5将无法连接mysql,页面提示为:Fatal error: Call to undefined function mysql_connect()。查阅了一下,发现是mysql5对应的版本不对导致的,换个版本就可以了。
我用mysql-standard-5.0.27-linux-i686.tar.gz时会提示,换了mysql-standard-5.0.27-linux-i686-glibc23.tar.gz后就正常了。

2.重装mysql后启动出错,提示:
Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/xmcncn.pid
061103 15:25:32  mysqld ended
请教高手gump,解决方法:
touch /tmp/mysql.sock
killall -9 mysqld
/usr/local/mysql/bin/mysqld_safe -user=mysql &
成功启动

PS:偶是新手,当初找齐这些软件都化了一整天时间,特别是几个小软件比较难找,现在全部列出来了。测试装的时候也遇到了不少问题,在gump同志的帮助下解决了不少。我站上本来转载了好几篇安装的文章,有的版本较旧,有的不太全面,所以把这次安装过程写出来,以后安装也就方便了:)希望也对一些新手有帮助。

首发:http://www.itlearner.com/article/2006/3540.shtml
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]