First VPS #5 : To rebuild php.rpm.

   My original plan for this post was to write an article about suEXEC Support. I want to configure my system with event + suEXEC + FPM on さくらの VPS. About event + suEXEC on Apache httpd it’s OK by CentOS7 default. But about FPM I found a big problem. The default php.rpm of CentOS 7 seems to have no ‘--enable-fpm‘ option at its build. This information you can have by the following command. For this you need to install the package ‘php-devel’. We cannot get the information by ‘php -i’ when we use CentOS rpms.
$ php-config --configure-options
 
   So I have to rebuild the php.rpm with ‘--enable-fpm’. Is this really necessary? Well, OK (^^;).
   I don’t build rpms on my VPS because I don’t want to install devel packages on the VPS, so I created a virtual PC for development environment in the NJ2100. For the virtual PC I used VMware(R) Player 6.0.4 build-2249910 and CentOS7 (Select ‘Development and Creative Workstation’ and check ‘Development Tools’). See the post “How to create a Virtual PC in Windows7 and run CentOS6.4 on it” for reference.
 
   I almost had the same results except about Ethernet. The NJ2100 has SiS Ethernet Controller and CentOS7 on VMware(R) Player couldn’t find the device out. How can I fix this issue? I found a lot of pages about it on the Internet and I’ll recommend this page for you though it’s Japanese.
 
   They tell me the same thing, i.e. use vmnetcfg.exe and vmnetcfglib.dll. They say that VMware Workstation Free Trial version like VMware-workstation-full-10.0.x-xxxxxxx.exe includes the two files. But there was a problem. We can download VMware Workstation 10 still now if we need a production version, but about Free Trial version we can download VMware Workstation 11 only from the vender site right now. Though I downloaded ‘VMware-workstation-full-11.0.0-2305329.exe’ and took a look in the file, I couldn’t find the two files.
 
   I looked for VMware Workstation 10 on the Internet. FINALLY, I got it from filehorse.com and had the two files. Do you need them? I made a zip for you. Is this act gray or illegal? Anyway I had a VM for development environment.
 
   Now I’ll write to rebuild the php.rpm. All procedures I did on the virtual machine and see the official page for reference.

  1. I make an unprivileged user(rpmbuilder) for building RPMs and and create the user mockbuild which is a no logon user. It seems to be used by the command ‘rpm’ and originated in IUS.
    $ sudo useradd rpmbuilder
    $ sudo passwd rpmbuilder
     
    $ sudo useradd -s /sbin/nologin mockbuild
  2. Create directories for RPM building under rpmbuilder’s home.
    $ sudo su - rpmbuilder
    $ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
    $ echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
  3. Download the source rpm from vault.centos.org.
    $ wget http://vault.centos.org/7.0.1406/updates/Source/SPackages/ \
    php-5.4.16-23.el7_0.3.src.rpm
  4. Install.
    $ rpm -ivh php-5.4.16-23.el7_0.3.src.rpm
  5. Edit php.spec
    $ $ cd ~/rpmbuild/SPECS/
    $ vi php.spec
    Add ‘--enable-fpm \’ as the line 869.
  6. $ rpmbuild -ba php.spec
     
    It shows packages resolving Dependencies. Install all of them. After that try again.
    $ rpmbuild -ba php.spec
     
    Now I had a php.rpm with ‘--enable-fpm’ option.

   By the way, my VM has GUI, so I wanted to use FileZilla as FTP client software. But I couldn’t find its rpm on the official repositories. Then I made a filezilla.rpm. For this I needed the package wxGTK3-devel, so I installed epel repository.

  1. $ sudo yum install epel-release
  2. $ wget ftp://fr2.rpmfind.net/linux/fedora/linux/development/rawhide/source/ \
    SRPMS/f/filezilla-3.10.0-1.fc22.src.rpm

    $ rpm -ivh filezilla-3.10.0-1.fc22.src.rpm
    $ cd ~/rpmbuild/SPECS/
    $ rpmbuild -ba filezilla.spec

   That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.