2015年8月7日 星期五

2013年12月12日 星期四

強制停止yum

當在執行yum時出現下面的錯誤訊息

another app is currently holding the yum lock;waiting for it to exit...

這時可執行

rm -f /var/run/yum.pid

來強制停止yum其他的工作

2013年11月25日 星期一

安裝FTP Server

1. 安裝 vsftpd:
yum -y install vsftpd
touch /etc/vsftpd/chroot_list
chkconfig vsftpd on
2. 安裝完後讓防火牆可以通過 21 Port:
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
service iptables save
3. 編輯 "/etc/vsftpd/vsftpd.conf",找到:
anonymous_enable=YES
將 YES 改成 NO。
4. 啟動 vsftpd:
service vsftpd start
5.因為使用匿名帳號登入,所以目前是無法上傳檔案的,所以我們到CentOS中新增一個使用者,等等就使用這個使用者帳號密碼連線到FTP。
useradd leo
passwd leo
6.修改使用者的資料夾權限
chown -R leo /var/www/html
chgrp -R leo /var/www/html

2013年10月21日 星期一

把SELinux關閉的方法

vi /etc/sysconfig/selinux

# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are: 

檔案太大無法匯入phpMyAdmin

修改php.ini檔

memory_limit = 128M (這裡可用預設或自行修改)

post_max_size = 72M (改成希望可上傳的容量)

upload_max_filesize = 64M (改成改成希望可上傳的容量)

重點是: 這三個數值的大小,必須是 memory_limit > post_max_size > upload_max_filesize

Linux 【CentOS】用yum安裝phpMyAdmin

rpm -Uvh http://download1.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm

yum install phpMyAdmin

vi /etc/httpd/conf.d/phpMyAdmin.conf

改下面設定

Allow from 127.0.0.1 192.168.1.0/24

打開vi編輯器出現E325: ATTENTION的解決方法

E325: ATTENTION
Found a swap file by the name "/home/.backup.sh.swp"
          owned by: root   dated: Tue Oct 22 09:09:25 2013
         file name: /home/backup.sh
          modified: YES
         user name: root   host name: js-adways.com.tw
        process ID: 5807 (still running)
While opening file "/home/backup.sh"
             dated: Tue Oct 22 09:14:43 2013
      NEWER than swap file!

(1) Another program may be editing the same file.
    If this is the case, be careful not to end up with two
    different instances of the same file when making changes.
    Quit, or continue with caution.

(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r /home/backup.sh"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file "/home/.backup.sh.swp"
    to avoid this message.
"/home/backup.sh" 36L, 1075C

解決方式 vi進去編輯按 :q! 退出vi 然後再到終端機輸入rm -f /home/.backup.sh.swp