日期:2014-05-16  浏览次数:20689 次

使用linux配置工作环境的一些日记
1、在文件./bashrc.sh中加入如下语句就可以在命令行中直接执行start_tomcat 和shutdown_tomcat进行执行和关闭程序
alias start_tomcat='/home/david/Applications/apache-tomcat-6.0.20/bin/startup.sh'
alias shutdown_tomcat='/home/david/Applications/apache-tomcat-6.0.20/bin/shutdown.sh'

也可以通过 startup_tomcat function(){}定义一个复杂的函数进行一系列的操作

2、$JAVAHOME PATH的配置为在/ect/profile中,加入如下代码
export JAVA_HOME=/home/david/Applications/jdk1.6.0_20
export CLASSPATH=$JAVA_HOME/jre/lib
export PATH=$PATH:$JAVA_HOME/bin

3、如果想要让其立即生效可以在当前命令行中写入 source /ect/profile
可以在当前终端立即加载修改后的文件

4、进行对整个目录的某些文件增加权限 chmod u+x ./*.sh 进行增加执行权限

5、linux切换工作平台的快捷方式ctrl+alt+->/<-  和移动窗口到别的平台,使用ctrl+shift+alt+->/<-

6、把现在使用的用户放到sodofile中,如下设置:
   在文件 /etc/soduers文件中 vim /etc/sudoers进行设置
   ## Allow root to run any commands anywhere
   root    ALL=(ALL)       ALL
   david   ALL=(ALL)       ALL
   ## Allows members of the 'sys' group to run networking, software,

7、Fedora RAR 软件安装
   下载RAR 3.71 for Linux这个文件:http://www.rarlab.com/rar/rarlinux-3.7.1.tar.gz
   文件大小759K,解压之后大小1.5M
   然后:
   [root@localhost rar]# cd ~/rar
   [root@localhost rar]# make
   mkdir -p /usr/local/bin
   mkdir -p /usr/local/lib
   cp rar unrar /usr/local/bin
   cp rarfiles.lst /etc
   cp default.sfx /usr/local/lib
   [root@localhost rar]#
   然后就可以打开了。
8、Fedora 配置软件源后要进行更新yum,使用如下命令:
    yum makecache
    yum check-update
    从系统-》管理-》软件更新和添加/删除软件中升级,加装,卸载软件包了。
    看自己情况决定是否在终端中全面更新系统,命令是终端中su -然后yum update
9、apache2 的使用, 在fedaro下,当更改apache2的DocumentRoot "/home/david/www" 、
   <Directory "/home/david/www"> 和把wordpress放到/home/#{user}目录下时,会出现
   Forbidden
     You don't have permission to access /wordpress on this server
   这时主要时apache2没有访问/home/#{user}目录的权限,因此应该给apache2权限,可以让apache2以#{user}的形式登录,如下配置
   # User/Group: The name (or #number) of the user/group to run httpd as.
   #  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
   #  . On HPUX you may not be able to use shared memory as nobody, and the
   #    suggested workaround is to create a user www and use that user.
   #  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
   #  when the value of (unsigned)Group is above 60000;
   #  don't use Group #-1 on these systems!
   #
   User david
   Group david

   这样的话,就有权限访问了