|
22 Feb 2015 01:27:13 pm |
CentOS mount CDrom and USB |
|
|
mount -t vfat /dev/sdb1 /media/USB
mount -r -t iso9660 /dev/sr0 /mnt/cdrom |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
08 Jan 2015 10:23:53 am |
centos 改变语言并立即生效 |
|
|
[root@dlp ~]# echo $LANG # show current system language
en_US.UTF-8
[root@dlp ~]# vi /etc/sysconfig/i18n
[root@dlp ~]# source /etc/sysconfig/i18n
[root@dlp ~]# echo $LANG # show current system language
ja_JP.UTF-8# changed |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
07 Jan 2015 10:42:19 pm |
centos vpn 接通后无法连接internet |
|
|
vpn可以连接到服务器并成功连接,但是无法上任何外网网站。
经查:
1.在vpn client pc上ping 服务器的pptpd地址192.168.80.1,可以ping通,ping服务器的外网地址也可以ping通,ping google或任何internet地址都不能。
2.因此怀疑是服务器没有做ip转发。
上到服务器上,查iptables, (实际上iptables是centos的防火墙,但是也是用来ip转发forward的)。
用来查转发的命令是 :
iptables -t nat -nL
发现由于多次调试,里面杂乱无章,用下面命令清空:
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
然后重新做:
iptables -t nat -A POSTROUTING -s 192.168.80.0/24 -o seth0 -j MASQUERADE
这个指令完成后立刻生效绝对不要重启iptables, 应为错误的 iptables设置还在/etc/sysconfig/iptables中,一重启反而还是错的。
立刻测试vpn,发现问题解决,的确是转发有问题。
这时把/etc/sysconfig/iptables移走,然后
/sbin/service iptables save
把正确的/etc/sysconfig/iptables文件保留下来,这样重启iptable service才不会依然是错误的。
参考:
http://blog.csdn.net/kuailedesky/article/details/41551077
http://bbs.aliyun.com/read/163732.html?spm=5176.7189909.0.0.fnGeeC&page=2 |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
29 Dec 2014 09:14:36 am |
centos 取消屏保 |
|
|
发现centos 时间一长,就自动黑屏屏保,这样不方便监控,查后只要这样做,
setterm -blank 0
并在/etc/rc.d/rc.local 加入这句,就可以在启动后自动把屏保关掉。 |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
17 Dec 2014 02:14:49 pm |
CentOS检查,添加,删除自启动服务 |
|
|
自启动列表:chkconfig --list
关闭:
chkconfig {service-name} off
添加:
chkconfig --add {service-name}
开启:
chkconfig {service-name} on
防火墙是iptables |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
17 Dec 2014 01:56:54 pm |
CentOS中开机自动启动某个服务 |
|
|
To auto start a new service:
1.Find out the name of service’s script from /etc/init.d/ directory e.g. mysqld or httpd
2.Add it to chkconfig
sudo /sbin/chkconfig --add mysqld
3.Make sure it is in the chkconfig.
sudo /sbin/chkconfig --list mysqld
4.Set it to autostart
sudo /sbin/chkconfig mysqld on
To stop a service from auto starting on boot
1.sudo /sbin/chkconfig mysqld off |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
17 Dec 2014 01:54:06 pm |
Top命令中的翻页 |
|
|
Centos, linux中Top命令翻页方法
在Top中用键盘来翻页
Shift+< (Shift和大于号同时按)
Shift+> |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
20 Nov 2014 11:05:57 am |
centos two service not start |
|
|
service php-fmp start
service mysqld start |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
16 Oct 2014 10:38:41 am |
nginx限制站点登陆 |
|
|
# access to sqladmin
location /sqladmin {
alias /var/www/html/sqladmin/;
allow 127.0.0.1;
allow your.ip.addr.ess;
deny all;
index index.php index.html index.htm;
}
http://www.nginxtips.com/how-to-install-phpmyadmin-on-nginx/ |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
13 Oct 2014 10:03:25 pm |
nginx phpmyadmin 报错 |
|
|
我靠,
我在nginx上安装phpMyAdmin
1.Yum Install phpMyAdmin,
2.mv phpMyAdmin 到 home folder下,/usr/share/nginx/html/
3.用ip address/phpMyAdmin报,
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.
4.google后要开通权限给/etc/php.ini提到的session路径,chmod 777 /var/lib/php/session,没有的话自己创建下.
http://my.oschina.net/grail/blog/158515
5.还是报3的错误,refresh下ie.
6. install mysqli extension,重启php-fpm
真复杂。 |
|
| |
Category : Unix&Linux
| Posted By : Eric Shan | Comments[0] | Trackbacks [0] |
|
|
|
1 2 Next |