ppc64 環境 nginx

Pocket

なかなか大変

環境

# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (AltArch)

# uname -a
Linux ppc-server-06.localdomain 3.10.0-327.36.3.el7.ppc64 #1 SMP Tue Oct 25 13:28:54 GMT 2016 ppc64 ppc64 ppc64 GNU/Linux

普通にrepo追加してだとエラーでる
というかppc64leはサポートされてるけどppc64はサポートされてない? 
http://nginx.org/en/linux_packages.html


# yum install nginx
読み込んだプラグイン:fastestmirror, langpacks
http://nginx.org/packages/rhel/7/ppc64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
他のミラーを試します。
To address this issue please refer to the below knowledge base article

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/



 One of the configured repositories failed (nginx repo),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable nginx

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=nginx.skip_if_unavailable=true

failure: repodata/repomd.xml from nginx: [Errno 256] No more mirrors to try.
http://nginx.org/packages/rhel/7/ppc64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

userを作ってtar.gzもってきてmakeする


# groupadd -g 500 nginx
# useradd -g nginx -u 500 -s /sbin/nologin -d /var/www nginx
# wget http://nginx.org/download/nginx-1.11.8.tar.gz
# tar zxf nginx-1.11.8.tar.gz
# cd nginx-1.11.8
# ./configure --user=nginx --group=nginx --with-cpu-opt=ppc64 --conf-path=/etc/nginx/nginx.conf --prefix=/usr/local


./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

# yum -y install pcre-devel
# ./configure --user=nginx --group=nginx --with-cpu-opt=ppc64 --conf-path=/etc/nginx/nginx.conf --prefix=/usr/local
# make
# make install

公式からinitスクリプトを持ってきて自分用にいじって配置
https://www.nginx.com/resources/wiki/start/topics/examples/initscripts/


# cat /usr/lib/systemd/system/nginx.service
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPre=/usr/local/sbin/nginx -t
ExecStart=/usr/local/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

最低限の設定をしてconfを配置
pidがnginx.serviceに書いてあるから別にいらんやろって進めてたらdemonとして起動しかなkったのでちゃんと書く
(デフォルトはコメントアウトされてた

# grep -vE '^\s*(#|$)' /etc/nginx/nginx.conf
user  nginx;
worker_processes  1;
error_log  /var/log/nginx/error.log;
error_log  /var/log/nginx/error_notice.log  notice;
error_log  /var/log/nginx/error_info.log  info;
pid        /var/run/nginx/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   /var/www;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /var/www;
        }
    }
}

/var/log/nginx ディレクトリとかも作る
起動する

# systemctl start nginx
# systemctl status nginx
● nginx.service - The NGINX HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: active (running) since 火 2017-01-17 17:27:08 JST; 9s ago
  Process: 19284 ExecStart=/usr/local/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 19281 ExecStartPre=/usr/local/sbin/nginx -t (code=exited, status=0/SUCCESS)
 Main PID: 19285 (nginx)
   CGroup: /system.slice/nginx.service
           ├─19285 nginx: master process /usr/local/sbin/nginx
           └─19286 nginx: worker process

 1月 17 17:27:08 ppc-server-06.localdomain systemd[1]: Starting The NGINX HTTP and reverse proxy server...
 1月 17 17:27:08 ppc-server-06.localdomain nginx[19281]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
 1月 17 17:27:08 ppc-server-06.localdomain nginx[19281]: nginx: configuration file /etc/nginx/nginx.conf test is successful
 1月 17 17:27:08 ppc-server-06.localdomain systemd[1]: Failed to read PID from file /var/run/nginx/nginx.pid: Invalid argument
 1月 17 17:27:08 ppc-server-06.localdomain systemd[1]: Started The NGINX HTTP and reverse proxy server.
# cat /var/www/index.html
aaa
# curl localhost
aaa

よさげ

コメントを残す

メールアドレスが公開されることはありません。