Tag: fedora

  • Reboot is still the best remedy in Linux

    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

    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

  • CentOS Debian Fedora FreeBSD Ubuntu Comparison

    我还远没有资格做评测,CentOS Debian Fedora FreeBSD Ubuntu 里,除了用过 Fedora,其他的都没试用过。还有一些 linux distribution 有些近期不够活跃,有些在开源路线上不够明朗,对从零学起的用户来说,还是不用考虑把它们也加进 shortlist,就这些主流的 linux distribution 都已很让人困惑,该怎么选择?

    总的来说,选择谁都没有错,殊途同归。但可能这样的回答不会让人满意,那么根据我的研究结果,我用最短的词语来概括 CentOS Debian Fedora FreeBSD Ubuntu 特点,希望有助大家选择。

    • CentOS: 保证兼容(如果以后想买 redhat 其他产品的话)
    • Debian: 承诺免费(不用担心开发者日后见利起意)
    • Fedora: 技术追新(新版本的组件首先在 Fedora 实现,隔好久才能在 redhat 其他产品上见到)
    • FreeBSD: 发布活跃(相对Debian而言)
    • Ubuntu: 面向桌面(虽然近来在服务器领域日渐流行,但它毕竟是针对 laptop 和 desktop 设计的)
  • I am with Fedora

    今天 Fedora 11 alpha 发布了。Fedora 10 我还没摸熟呢,Fedora 11 就来了,真让我高兴之中疲于奔命。

    无意中还发现 drupal, mediawiki, planet, wordpress 都包含在 Fedora 发行包中,这是不是跟 Fedora Project 自身使用了这几种技术有关?我的意思是:为什么不包含别的 packages,比如 magento, joomla, etc?

    Fedora 倡导的东西咱就支持一下。不管有用没有,咱全安装了(也就 drupal 暂时派不上用场)。

  • My very first time setting up a perfect Fedora server

    说来惭愧,我虽然知道 Linux 是王道,但迄今学得支离破碎,平时会用 SSH 玩几个 command line,一直没有亲密接触 Linux。今天终于有机会(需要静下心做这件事)开始安装 Fedora,我的目标是在 Vmware server 里安装 Fedora server,为 LAN 用户提供更多更快更稳定的应用。具体点讲,这台Fedora server将兼任

    1. DNS server
    2. Apache http / https server
    3. Ftp / Sftp server
    4. Mysql server
    5. Svn server
    6. Samba server

    我的环境是 Windows XP Host 下的 Vmware Server 2.0.0,用Fedora Live CD 安装 Fedora 10。安装过程中遇到的问题和解决方案都记录在此。

    我碰到的第一个问题:无法在Fedora guest OS 里安装 Vmware Tools

    原因:need to install the kernel-source, kernel-devel, kernel-headers packages that matches your running kernel version

    解决办法:root 用户运行yum install kernel-devel kernel-header

    第二个问题:在运行yum install kernel-devel kernel-header
    企图解决上一个问题时提示“Could not retrieve mirrorlist http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-10&arch=i386”

    原因:Fedora DNS解析出错(这时 Fedora 虚拟网卡运行在 Bridge 模式,Fedora Firefox 已经可以访问 internet,DNS 解析出错的原因不明)

    解决办法:在/etc/hosts文件里加入手动解析80.239.156.215        mirrors.fedoraproject.org

    第三个问题:如何让 host OS 访问到 guest OS 的服务

    解决办法:Fedora 虚拟网卡不可运行于 Bridge 模式,需改为 NAT 模式。Vmware server 修改 guest hardware 后必须重启 guest OS,然后 enable Fedora firewall 对应的端口。

    第四个问题:Vmware 充当 DHCP 服务器,如何得知 Fedora IP address

    解决办法:运行 ifconfig (看仔细了,是 ifconfig,不是 ipconfig)。

    第五个问题:如何加载 .iso 文件

    解决办法:GNOME 里双击 .iso 文件,太简单了(我老拿 Windows 的思维办事,很不好)。

    第六个问题:安装 ISPConfig 3.0 时运行rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
    提示 “import failed”

    原因:不明,大概是gpg key无效。

    解决办法:不用管它,继续执行 ISPConfig 安装命令,最后 ISPConfig 同样能成功安装。

    第七个问题:无法在 Fedora 10 上安装 ISPConfig 3.0。提示错误:

    PHP Notice:  Undefined variable: distver in /tmp/trunk/install/lib/install.lib.php on line 120
    PHP Notice:  Undefined variable: distid in /tmp/trunk/install/lib/install.lib.php on line 120
    PHP Notice:  Undefined variable: distbaseid in /tmp/trunk/install/lib/install.lib.php on line 120
    Linux Distribution or Version not recognized.

    原因:Fedora 10 新鲜出炉,ISPConfig developers 还没回过神来。

    解决办法:自己动手做点小修改就可以了。目前 ISPConfig 能认出 Fedora 9,那就让它认为这是 Fedora 9 的环境。可以修改 Fedora /etc/redhat-release 文件,把其内容改为 Fedora release 9 (Sulphur)。但这不是好办法,有可能影响其它软件正确识别 OS 版本。另个办法是修改 ISPConfig install/lib/install.lib.php 文件,在 line 99-105 找到

    
    if(stristr($content,'Fedora release 9 (Sulphur)')) {
    	$distname = 'Fedora';
    	$distver = '9';
    	$distid = 'fedora9';
    	$distbaseid = 'fedora';
    	swriteln("Operating System: Fedora 9 or compatible\n");
    }
    

    改为

    
    if (stristr($content, 'Fedora release 10 (Cambridge)')) {
    	$distname = 'Fedora';
    	$distver = '9';
    	$distid = 'fedora9';
    	$distbaseid = 'fedora';
    	swriteln("Operating System: Fedora 10 or compatible\n");
    }
    
    elseif (stristr($content, 'Fedora release 9 (Sulphur)')) {
    	$distname = 'Fedora';
    	$distver = '9';
    	$distid = 'fedora9';
    	$distbaseid = 'fedora';
    	swriteln("Operating System: Fedora 9 or compatible\n");
    }
    
    

    第八个问题:在安装 samba + openldap 过程中,执行 ldapadd 命令时提示“Bash: ldapadd: command not found”

    原因:缺少 ldapadd 文件。

    解决办法:有人说要装 ldap-utils package,但这不适用于 Fedora。我用了 yum install samba-client。

    第九个问题:/etc/init.d/sshd restart 时出错,提示

    compileuser is not in the sudoers file. This incident will be reported.

    解决办法:
    visodu
    compileuser ALL=(ALL) ALL

    第十个问题:/usr/bin/freshclam 出错,提示

    ERROR: Please edit the example config file /etc/freshclam.conf.
    ERROR: Can’t parse the config file /etc/clamd.conf

    解决办法:
    /etc/freshclam.conf
    comment a line “Example”

  • Fedora services command line restart

    To restart some services of Fedora linux using command line –

    apache: /etc/init.d/httpd restart
    named: /etc/init.d/named restart
    mysql: /etc/init.d/mysqld restart

    To turn on and off firewall –

    off: /etc/init.d/iptables save
    /etc/init.d/iptables stop

    on: /etc/init.d/iptables start

  • Open Source with Commercial Quality Assurance

    我在VMWare Server下装linux,屡装不成,令人气馁。

    很早就想装个Fedora,因为Godaddy给我的服务器用的就是Fedora, 一直很稳定,所以我想桌面上也装Fedora,可以多了解Fedora习性,从而多了解我的Fedora Server。从Fedora 6开始,我就尝试着在VMWare里安装。结果Fedora 6没能装上VMWare Tools,我没怎么用。Fedora 7根本就安装不成,症状是找不到VMWare默认的SCSI硬盘;我按别人的推荐换上了IDE硬盘,但更糟,安装一开始加载驱动就死在那里;又有别人建议在虚拟机里安装linux要安装到物理硬盘,那要虚拟机来干嘛?我怕麻烦,不想试下去了。现在Fedora 8也有了,Fedora 9 Alpha也有了,我正在下载。如果最新版的Fedora再装不成,那我彻底对Fedora失望了。

    回想Windows在VMWare下安装很顺利,Redhat Linux安装也没碰到问题,SCSI或IDE硬盘种类选什么都可以,同是Redhat公司推出的开源版本Fedora就这么折腾人?我不怀疑满足特定硬件要求的Fedora可以跑得很稳定,就如你正看着的blog用的server,但Fedora的兼容性实在不能恭维。其实Fedora不是一个特例,我在VMWare试装好几个基于linux的LiveCD,一个没成。如果哪一天真要启用这些开源产品,那我还得花钱买Commercial Support,这样,开源的优势就抵消了很多。

    综上,既是开源,又有达到商业级的质量保障(这里我主要指兼容性好,让用户省心),才是我希望见到的软件。