I want to configure my system with event + suEXEC + FPM on さくらの VPS.
For that I rebuilt php.rpms with ‘--enable-fpm’, but I got fed up with all the dependency things when I used ‘rpm -ivh’. So I decided to create a repository for my own, ha-ha.
- On the VPS
- $
sudo adduser --gid xxxx myrepo
‘myrepo’ is a user for the repository and ‘xxxx’ is the gid of the httpd user group.
$sudo passwd myrepo
- $
sudo chmod 710 /home/myrepo
- $
sudo su - myrepo
- $
mkdir public_html
- $
cd public_html
- $
mkdir x86_64
- $
exit
I haven’t written it yet, but I already configure Apache httpd for suEXEC Support. So I have new User and Group on the httpd.conf. If you use the settings on this post for your repository, read my words about httpd configuration on the post as your words on your system.
I removed ‘Options Indexes’ from the httpd conf files, but want to show the indexes of the repository directory. For that I need to use ‘Options Indexes’ in the .htaccess file. So I did the following things.
- About httpd on the VPS
- Change the followings about the userdir.conf (/etc/httpd/conf.d/userdir.conf).
UserDir enabled normuser1
—>>UserDir enabled normuser1 myrepo
↑ This is not for .htaccess but for the user ‘myrepo’.
AllowOverride FileInfo AuthConfig Limit Indexes
—>>AllowOverride FileInfo AuthConfig Limit Indexes Options=Indexes
- $
sudo systemctl restart httpd.service
- $
sudo su - myrepo
- $
cd public_html/x86_64
- $
vi .htaccess
Its text is ‘Options Indexes’. - $
chmod 640 .htaccess
- $
exit
- On the VM for development environment.
- Log on as the user ‘rpmbuilder’ and rebuild all the rpm files I want.
Note 1) On the post ‘First VPS #5’, I wrote how to rebuild php.rpm. That’s nothing wrong, but yum gives ‘Package PACKAGE_NAME.rpm is not signed’ when I used my repository. We need a signature for rpm files when we use them by yum though we can avoid it by the option ‘--nogpgcheck’ and I used the option for my filezilla.rpm installation. - Add my signature to the rpm files.
$rpm --addsign rpmbuild/RPMS/x86_64/*
Of course, I need GPG Keys before this step.- Log on the VM as a root privilege user.
$sudo gpg --gen-key
$sudo gpg --export -a 'o6asan' > RPM-GPG-KEY-o6asan
RPM-GPG-KEY-o6asan is my public key file. I upload this to /x86_64 in myrepo’s DocumentRoot on the VPS by Filezilla client.
$sudo gpg -o file.secret --export-secret-key o6asan
file.secret is my private key file. I move this to rpmbuilder’s home directory.
$sudo mv /home/vmowner/file.secret /home/rpmbuilder/file.secret
- Log on the VM as the user ‘rpmbuilder’
$gpg --import file.secret
This command imports both secret and public keys.
$vi .rpmmacros
Add the next two lines.
%_signature gpg
%_gpg_name <Owner name>
Note 2) Actually, I wanted to create the keys as ‘rpmbuilder’ because I rebuild the rpm files as ‘rpmbuilder’. But I couldn’t. To create GPG Keys requires root privilege.
- Log on the VM as a root privilege user.
- Upload all the rpm files to /x86_64 in myrepo’s DocumentRoot on the VPS.
- On the VPS.
$sudo yum install createrepo
$sudo createrepo /path to/x86_64
Now, I have a repository for my own and the URL is http://www17130ue.sakura.ne.jp/~myrepo/x86_64/.
I’ll write ‘How to use the repository for my own’ for the next post.