Posts Tagged ‘fedora’

vnc vs vino

Monday, June 15th, 2009

我刚刚弄明白,Fedora 有两种远程桌面:VNC 和 Vino,软件包的名称分别是:

  • 服务器端:vnc-server & vino
  • 客户端:vnc & vinagre

有关 VNC 的介绍很多,以致把 Vino 都湮没了。Vino 随着 GNOME 而来,菜单项的名称就叫 Remote Desktop。我找了一会,没找到 Vino 的配置文件是哪个。如果只有图形界面,我反而会觉得不方便。而且 Vino 使用 5901 端口,我也没找到什么方法修改。

启用 Vino 后,/etc/sysconfig/vncservers 里就无法使用 Display 1 了,5901 端口被用掉了嘛。这么启动 vncserver 会报错,“A VNC server is already running as :1”。

VNC 和 Vino 有两大不同。

  1. VNC 进入的虚拟桌面,Vino 进入的是桌面 Session(不知道这样表达妥不妥当?)
  2. VNC 必须设置 password (by running vncpasswd),Vino 则可以不设密码。

Easiest way to install Flash Player in Fedora

Saturday, June 13th, 2009

Fedora 发行时不带 Flash Player,因为 Fedora 说 Flash is not free。我没去仔细研究这句话的意思,大概是指生成 Flash 的软件不免费吧。我也不喜欢 Flash,但是有那么多的资源得用 Flash Player。虽然 Fedora 推荐了两款 Open Source Flash Player,但播放时还是有七七八八的问题。除非大家都不用 Adobe Flash 制作 Flash,否则我还是离不开 Adobe Flash Player。

因此,面对现实,怎么在 Fedora Firefox 下安装 Fedora 最简单?今天发现一法,一分钟内搞掂,笔记如下:

  1. 从 http://labs.adobe.com/downloads/flashplayer10.html 下载一个压缩包。
  2. 解压其中的 so 文件 放到 /usr/lib64/mozilla/plugins
  3. 在终端中运行 mozilla-plugin-config -i -g -v

Fedora LiveCD installation is not perfect

Saturday, June 13th, 2009

Fedora 各版本都制作了 LiveCD, installation DVD, installation CD 等形式方便用户下载。刚接触 Fedora 时,我很难决定该选哪个来下载。既然 Fedora 把 LiveCD 放在下载首页,我就下载来刻成 CD。我用这张 CD 装了好几台机器,主要是用作文件服务器或 local dns 服务器或后备 http 服务器,都没有发现大的问题。在 intel 845 芯片安装过程中遇到困难,但也被我克服了。

直到最近我用这张 CD 安装了我的 desktop,用了几天,日常使用没有什么问题,但虚拟机总是启动不了。VMWare 的虚拟客户端都是启动到 95% 时报错,Fedora 自带的 xen 或 qemu 也总是连接不上。我查来查去查不出毛病,最后一个指令 remove kernel-xen 就让 Fedora 彻底瘫痪(启动出现 Error 5)。

我在尝试修复 Fedora 时查阅了很多论坛,我的最后结论是:LiveCD 不适合用来安装,虽然它可以 install to harddisk。我曾认为 LiveCD 和 installation DVD 或 CD 装出来的系统是一样的,但以我的实际情况结合其他人反映的情况(特别相似的一例是有人说用 ubuntu desktop cd 安装后 VMWare 虚拟机启动到95%时出错,改用 ubuntu server cd 安装后问题消除),我再不会用 LiveCD 来装机。

顺便提一下,LiveCD 对初次接触 Fedora、想先评估后安装的用户确实是个不错的选择。我的系统瘫痪以后,我一时没有找到拯救硬盘文件的最佳途径,就只好用 LiveCD 在无硬盘的条件下工作了两天半,它也出色地帮我完成了两天半的任务。当然还得感谢网络化的办公环境——邮件全在服务器上,文件也在服务器上,真的很少用到本地硬盘了。只是 dns lookup 比较慢,几乎每次访问都要重新 lookup,估计 LiveCD 考虑到内存有限,不缓存 dns lookup result?我用本地另一台已启用 dnsmasq 的机器为我作 dns 代理,这样 LiveCD 访问 internet 速度就正常了。

回过头来看 Fedora,为什么 Fedora 把 LiveCD 高高推荐在下载的首页?我觉得没有必要,除非 Fedora 对自己没有信心,才拼命拉拢用户来试用(Fedora 应该早就过了这个苦命的阶段了吧)。我没有试过用 Fedora installation DVD 去安装 intel 845 芯片的机子, 我猜 Fedora installation DVD 不会有显卡驱动的问题。现在我也理解了为什么没有 rescue mode、为什么 grub linux 命令无效,因为这些都是 LiveCD 没有的。Fedora 对 LiveCD 的下载用户警告不足,为此走了一圈弯路的用户应该不止我一个吧。

Nice looking wqy fonts

Friday, June 5th, 2009

装 Fedora 时我选 locale 是 United Kingdom,所以中文字体没有装。但能读中文,也能输入中文,大概得感谢 utf-8 之类的标准。

但英文 Fedora 显示中文的方式太别扭了,一句话里会夹杂几个字黑体,几个字宋体。我不理解为什么会这样,不研究了,用
yum install wqy*

把文泉驿字体装上就好看多了。

Linux talks to Linux using Windows languages

Friday, June 5th, 2009

MyBook World Edition 基于 Linux,却是面向 Windows 用户的产品。Linux 用户怎么访问它?我一时犯傻了。

因为我早就破解了我的 MyBook World 的根密码,所以我首先想着用 root 身份、sftp 方式去访问 MyBook World。但是 Windows 用户上载到 MyBook World 的文件所有者是 www-data, root 上载上去的文件 www-data 不可写。我无从得知 www-data 的初始密码,否则我就用 www-data 身份、sftp 方式去访问 MyBook World。如果我强行修改 www-data 初始密码,万一把 MyBook World 搞瘫痪了,一个 network drive 只能当 external drive 用就不值了。

好长时间以后才想到,Fedora 自带 Connect to server -> Windows share 就可以 samba client 去访问 MyBook World。Samba 本来就是为 Windows 和 Linux 之间的通讯开发的,但现在两台 Linux 的机器,因为要照顾到其他 Windows 用户,所以只能用 Samba 来对话。

不管怎么说,问题解决了。只留下一个小小的问题—— Windows 下,\\ip address or netbios name 就可以看到所有的共享文件夹,在 Fedora 的 Connect to server -> Windows share 则必须把共享文件夹作为 share 的名字输入后才能连接,如果只输入 ip address or netbios name 则出现 Cannot display location “smb://ip address or netbios name/” ,no application is registered as handling this file. 那怎么查看所有共享文件夹?

Install Fedora 10 on a machine with Intel 845 chipset

Thursday, May 28th, 2009

前面讲过,Fedora 是不太注重兼容性的,碰上杂七杂八问题的概率就高。我在 Dell Dimension 2400 上安装 Fedora 10 总是进行不下去,换一台机子也是如此,具体的症状是在 Live User login 界面时花屏、黑屏、或干脆死机。我猜是显卡驱动的原因,Google 了几下基本证实我的判断,问题集中在使用 Intel 845 chipset 的机型上。当年 Intel 845 的畅销如今使得面临这个问题的用户还不少。(但是 Fedora 为什么不解决一下这个问题?)

原因定位得很快,对策就是让 Fedora Live CD 启动时不加载显卡驱动,或按特殊的参数加载显卡驱动。可是,具体怎么做?我又 Google 了好久,一开始找到的方法最后发现在 Fedora 10 上已经不适用了,这些过时的方法浪费我好多时间。我把我走过的弯路也写出来,希望后来者少走弯路。

弯路一:输入启动参数 vmlinux initrd=initrd.img text,试图以文本方式安装,可 kernel 已经不叫 vmlinux,改称 vmlinux0,initrd.img 也不存在,改名 initrd0.img,但就算你把名称弄对了,也别想进入文本模式。

弯路二:追加启动参数 linux xdriver=vesa resolution=1024×768 (我还试过 linux xdriver=vesa resolution=1024*768),试图加载 vesa 通用显卡驱动,强制分辨率。Fedora 10 根本不理这一套。

真正能在 Intel 845 chipset 机型上成功安装 Fedora 10 的办法在 Fedora forum 上有提及,我这里总结一下:

Config CentOS to use the latest software

Saturday, May 23rd, 2009

1and1 VPS OS 可选清单里没有 Fedora,不得不说是个遗憾。当然 CentOS 也不错,可是以前都没接触,使用 CentOS 会有很长的学习过程,但没办法,只能装个 CentOS 用用看。

以前我调查过,CentOS 讲究兼容性,Fedora 追求技术领先。CentOS 安装真得比当初装 Fedora 要容易(Fedora 从6开始到10,我没有一次是一次启动就安装成功的),今天装CentOS 5很顺利(CentOS 兼容性真的那么好?还是我从 Fedora 学来的经验丰富了?)

装完 CentOS,我就面临一个问题:不能 yum install nginx;yum install php 得来的版本也只是 5.1.6。这个简单的比较才觉得 Fedora 的好。我无法想象我还要下载编译 nginx(那一套我还不熟,怕搞砸了)。不过,Extra Packages for Enterprise Linux (EPEL) 已经做好了一个 repository,只要添加这个 repository,

sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-3.noarch.rpm

然后就可以用 yum install nginx。

但是,yum install php 得来的版本只能是 5.1.6,目前还没找到好办法。

一语惊醒梦中人

Friday, May 22nd, 2009

由于某种原因,我删掉了 /usr/bin/php, /etc/php.ini 等文件,我指望 yum reinstall php 能把这些文件重新装回去。但是 yum install / remove / reinstall 交替使用了 n 次,还是没见这些文件。

于是我又在想,可能 Fedora 把我以前的安装信息保存在某个地方,毕竟直接去删 /usr/bin/php, /etc/php.ini 等文件不是卸载 package 的正当做法,所以再次用 yum 安装时,它不会把这些文件送回来。怎么让 Fedora 认为我是要象第一次安装 php 那样把这些文件都给装上去呢?我想了好久不得要领,只好去 Fedora forum 提问,由于我的提问也没切中要害,一开始得到的回答也不得要领。

直到突然一个好心人告诉我,/usr/bin/php 是在 php-cli package 里,/etc/php.ini 是在 php-common package 里。一语惊醒梦中人——怎么我总以为这些文件是由一个 php 全包了呢?

Reboot is still the best remedy in Linux

Friday, May 22nd, 2009

Long time ago, I read an article about moving from Windows to Linux, the top differences a system administrator should keep in mind. I still remember one of the difference is reboot in Linux does not cure the problem as it does for Windows in 99% occasions.

However, today I tried to fix a problem after I manually compiled php 5.2.9 (phpMyAdmin stop working, server response 500 error). I lack of knowledge of configure, make install, so I decided to remove php 5.2.9 and reverse to php 5.2.6 came with Fedora. I like yum install. Yum make my life so easy and it can also install packages perfect for me.

php 5.2.9 executables was installed to /usr/local/bin (as php’s default), but php 5.2.6 was installed to /usr/bin (as fedora yum default). After I yum reinstalled php 5.2.6, I found

If I typed “php-cgi -v”, Fedora could find php-cgi in /usr/bin
If I typed “php -v”, Fedora still looked for php in /usr/local/bin

I did not know why Fedora behave so strangely. After hours trying to correct Fedora mis-behavior without success, I reboot Fedora hopelessly. Then what? Fedora now is willing to load php executable in /usr/bin.

Install php-fpm on Fedora

Tuesday, May 19th, 2009

Use fedora yum install to install php is very easy. But, there is no yum install available to install php-fpm. I have to download php source and compile it from source.

I do not know why Fedora configures its php this way, but it works fine for me. So I want to configure my php source the same way as Fedora did. I only add –enable-fpm to the configure.

./configure --build=i386-redhat-linux-gnu --host=i386-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-libdir=lib --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-debug --with-pic --disable-rpath --without-pear --with-bz2 --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --enable-gd-native-ttf --with-t1lib=/usr --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-expat-dir=/usr --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-kerberos --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --without-mime-magic --without-sqlite --with-libxml-dir=/usr --with-xml --with-system-tzdata --enable-force-cgi-redirect --enable-pcntl --with-imap=shared --with-imap-ssl --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --with-ncurses=shared --with-gd=shared --enable-bcmath=shared --enable-dba=shared --with-db4=/usr --with-xmlrpc=shared --with-ldap=shared --with-ldap-sasl --with-mysql=shared,/usr --with-mysqli=shared,/usr/bin/mysql_config --enable-dom=shared --with-dom-xslt=/usr --with-dom-exslt=/usr --with-pgsql=shared --with-snmp=shared,/usr --enable-soap=shared --with-xsl=shared,/usr --enable-xmlreader=shared --enable-xmlwriter=shared --enable-fastcgi --enable-fpm --enable-pdo=shared --with-pdo-odbc=shared,unixODBC,/usr --with-pdo-mysql=shared,/usr --with-pdo-pgsql=shared,/usr --with-pdo-sqlite=shared,/usr --enable-json=shared --enable-zip=shared --with-readline --enable-dbase=shared --with-pspell=shared --with-mcrypt=shared,/usr --with-mhash=shared,/usr --with-tidy=shared,/usr --with-mssql=shared,/usr

I had several errors when run ./configure

checking for BZip2 in default path… not found
configure: error: Please reinstall the BZip2 distribution
solution: yum install bzip-devel bzip-libs

configure: error: DBA: Could not find necessary header file(s).
solution: yum install gdbm-devel
Well, someone suggests that, I did that, but error still exists. Then under my own decision, I run
yum install php-dba
Error still exists.
yum install qdbm*
Error still exists.
yum install db4*
Pass!

configure: error: libjpeg.(a|so) not found.
solution: yum install libjpeg libjpeg-devel

Configure: error: libpng.(also) not found.
solution: yum install libpng libpng-devel

configure: error: libXpm.(a|so) not found.
solution: yum install libXpm*

Configure: error: freetype.h not found.
solution: yum install freetype-devel

configure: error: Unable to locate gmp.h
solution: yum install mysql-devel

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
solution: yum install libc-client-devel

configure: error: Cannot find ldap.h
solution: yum install openldap-devel

configure: error: mcrypt.h not found. Please reinstall libmcrypt.
solution: yum install libmcrypt-devel

configure: error: Please reinstall libmhash – I cannot find mhash.h
solution: yum install mhash-devel

configure: error: Directory /usr is not a FreeTDS installation directory
solution: yum install freetds-devel

Configure: error: Please reinstall the ncurses distribution
solution: yum install ncurses-devel

checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
solution: yum install unixODBC-devel

configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
solution: yum install postgresql-devel

configure: error: Please reinstall the sqlite3 distribution
solution: yun install sqlite-devel

Configure: error: Cannot find pspell
solution: yum install pspell-devel

configure: error: Please reinstall readline – I cannot find readline.h
solution: yum install readline-devel

configure: error: SNMP sanity check failed. Please check config.log for more information.
solution: yum install net-snmp-devel

configure: error: Cannot find libtidy
solution: yum install libtidy-devel

configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
solution: yum install libxslt-devel