netbox icon indicating copy to clipboard operation
netbox copied to clipboard

update docs to include installation in RHEL/CENTOS

Open aoyawale opened this issue 10 years ago • 43 comments

The getting started guide can be followed almost completely but, it looks like the packages have diff names. Will have to figure out then update docs.

aoyawale avatar Jul 01 '16 12:07 aoyawale

Getting started my have to become a general jump point to specific OS's -> web daemons -> etc

As this grows I expect the documentation to evolve but I don't know how much more can be stuffed into getting-started.md before people using it get overwhelmed

bellwood avatar Jul 01 '16 12:07 bellwood

that is fine. Which ever way works as long we have it documented. I'll try to lsit the packages that I think we might need for RHEL/CENTOS it might be a longer list since I use the minimal_install.iso

aoyawale avatar Jul 01 '16 12:07 aoyawale

Yes I agree, as I normally use CentOS. I hit some roadblocks, so I followed the getting started in Ubuntu for now. I'm also working on this list as well. I'll be happy to contribute and edit as you develop this guide.

ryanmerolle avatar Jul 01 '16 12:07 ryanmerolle

for the moment I did yum install openssl* setuptools python-de* libxml* libxs* libffi* and the pip install -r requirements.txt worked after a few tries. I'll have to try to identify which exactly it is or the RHEL/CENTOS correct name.

aoyawale avatar Jul 01 '16 12:07 aoyawale

OS or distro-specific setup guides do sound good, but indeed, getting-started.md is already pretty lengthy. It might make sense to begin splitting it into a few different guides and have getting-started.md link to OS or distro-specific guides instead.

mdlayher avatar Jul 01 '16 16:07 mdlayher

I can get started on the RHEL/CENTOS specific and do a pull request when I'm done if they are no issues.

aoyawale avatar Jul 01 '16 19:07 aoyawale

@ryanmerolle have you been able to successfully install on centos? I'm using centos 7 and I run into issues later on when trying to reach the webserver.

aoyawale avatar Jul 02 '16 20:07 aoyawale

Nope. I plan to work on it after the holiday weekend.

Sent from my iPhone

On Jul 2, 2016, at 4:00 PM, chagara [email protected] wrote:

@ryanmerolle have you been able to successfully install on centos? I'm using centos 7 and I run into issues later on when trying to reach the webserver.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

ryanmerolle avatar Jul 02 '16 20:07 ryanmerolle

@chagara - I've been able to get it running on RHEL7 with no issues, other than the noted differences in package names and a couple of quirks around the configuration of Gunicorn/Supervisor.

bradpeczka avatar Jul 05 '16 06:07 bradpeczka

@bradpeczka I was able to make a list of the rpms needed but, I think I started having problems with the nginx gunicorn/supervisor part. Its not working. What steps did you have to take to make that work? if you do not mind sharing.

aoyawale avatar Jul 05 '16 11:07 aoyawale

@chagara I found this blog (https://rayed.com/wordpress/?p=1496) to be quite useful. I had issues getting the config includes to work, so just pasted the example Supervisor config from the getting-started.md documentation there instead, though you'll need to modify the user to 'apache' or whatever nginx uses.

I also slightly edited gunicorn_config.py by changing the command path to '/bin/gunicorn' and the user to 'apache'.

bradpeczka avatar Jul 05 '16 15:07 bradpeczka

@bradpeczka thank you for the information. I'll try to see if I can make it work. So you used nginx or apache?

aoyawale avatar Jul 05 '16 16:07 aoyawale

@chagara We're currently using Centos 6 with netbox and no issues. I configured apache initially and switched everything to nginx for other reasons. Both worked with no apparent issues. What problems are you having?

dinoocch avatar Jul 05 '16 19:07 dinoocch

Well in Centos 7 the problem I'm having at the moment that it seems that nginx is not passing the config and just lands into the "It works !" page. At first I had issues with the packages but, I figured out the needed packages. Now I'm getting an error after I restart supervisord " ImportError: no module named netbox.wsgi" On centos 6 since it needs python 2.7 I need to install that. Do you mind sharing the steps you took or the commands? I must be missing something so simple that I'm over looking it.

aoyawale avatar Jul 05 '16 19:07 aoyawale

Hmm, sounds like a problem with your nginx configuration, and your gunicorn configuration, possibly your supervisord config. It may also be a permissions issue. I'd be happy to look at any of them if you can put them in a gist. Our steps are a bit convoluted because we're running netbox in a subdirectory, so a lot of the configuration looks a little different.

dinoocch avatar Jul 05 '16 19:07 dinoocch

I installed all the configs like described in the getting started guide. The only difference was the names of the packages and creating the sites-available since that is not on centos. Let me look at the config and post it. What other steps did you had to take?

aoyawale avatar Jul 05 '16 20:07 aoyawale

Just like the starting guide: server { listen 80;

server_name netbox-centos7;

access_log off;

location /static/ {
    alias /opt/netbox/netbox/static/;
}

location / {
    proxy_pass http://127.0.0.1:8001;
    autoindex on;
    autoindex_exact_size off;
    autoindex_localtime on;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}

}

command = '/bin/gunicorn' pythonpath = '/opt/netbox/netbox' bind = '127.0.0.1:8001' workers = 3 user = 'apache'

[program:netbox] command=gunicorn -c /opt/netbox/gunicorn_config.py netbox.wsgi directory=/opt/netbox/netbox/ user=apache

aoyawale avatar Jul 05 '16 20:07 aoyawale

Ah, that's one issue. Your nginx configurations ought to go in /etc/nginx/conf.d/ (Assuming you are using an up-to-date nginx from the nginx repository http://nginx.org/packages/centos/$releasever/$basearch/)

Also, in the gunicorn configuration file, I used: bind = '0.0.0.0:8001', not sure if this will make a difference for you or not. (I believe it will depend on your server setup)

What error is gunicorn yielding when you try to start it?

dinoocch avatar Jul 05 '16 20:07 dinoocch

I do have the netbox.conf in /etc/nginx/conf.d/ I just paste it all together in there so you can see it together sorry for the confusion. It looks like now the gunicorn error has gone away since I binded to 0.0.0.0 like you mentioned but, its not showing all the page completely. screenshot at 2016-07-05 16 39 09

Getting this errors: 14:07:52 [error] 11000#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:07:52 [error] 11000#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:07:52 [error] 11000#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:07:52 [error] 11000#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:07:52 [error] 11000#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:07:52 [error] 11000#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:20:25 [error] 11092#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:20:27 [error] 11092#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:20:57 [error] 11127#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:20:58 [error] 11127#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:20:58 [error] 11127#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:20:59 [error] 11127#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:20:59 [error] 11127#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:25:17 [error] 11199#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:25:18 [error] 11199#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:25:18 [error] 11199#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:28:06 [error] 11199#0: *2 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:37:46 [error] 11312#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:37:47 [error] 11312#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:07 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:07 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:08 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:08 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:08 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:08 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:08 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:09 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:09 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:09 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:09 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:09 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:09 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:09 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:10 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:10 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:14 [error] 11409#0: *1 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:25 [error] 11411#0: *2 opendir() "/opt/netbox/netbox/static" failed (13: Permission denied), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 14:39:25 [error] 11411#0: *2 open() "/opt/netbox/netbox/static/favicon.ico" failed (2: No such file or directory), client: 192.168.5.70, server: _, request: "GET /favicon.ico HTTP/1.1", host: "192.168.5.59", referrer: "http://192.168.5.59/" 2016/07/02 14:39:25 [error] 11411#0: *2 open() "/opt/netbox/netbox/static/404.html" failed (2: No such file or directory), client: 192.168.5.70, server: _, request: "GET /favicon.ico HTTP/1.1", host: "192.168.5.59", referrer: "http://192.168.5.59/" 2016/07/02 15:10:11 [error] 11411#0: *4 "/opt/netbox/netbox/static/index.html" is not found (2: No such file or directory), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 15:10:11 [error] 11411#0: *4 open() "/opt/netbox/netbox/static/404.html" failed (2: No such file or directory), client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 15:28:56 [error] 11833#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 15:31:29 [emerg] 11901#0: unexpected end of file, expecting "}" in /etc/nginx/nginx.conf:48 2016/07/02 15:32:06 [error] 11943#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 15:36:12 [error] 11998#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 15:37:45 [error] 12047#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 15:37:46 [error] 12047#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 15:37:46 [error] 12047#0: *1 directory index of "/opt/netbox/netbox/static/" is forbidden, client: 192.168.5.70, server: _, request: "GET / HTTP/1.1", host: "192.168.5.59" 2016/07/02 15:39:36 [error] 12082#0: *1 "/opt/netbox/netbox/static/site/index.html" is not found (2: No such file or directory), client: 192.168.5.70, server: _, request: "GET /site/ HTTP/1.1", host: "192.168.5.59" 2016/07/02 15:51:25 [emerg] 12250#0: directive "location" has no opening "{" in /etc/nginx/nginx.conf:38 2016/07/02 15:53:06 [emerg] 12286#0: "location" directive is not allowed here in /etc/nginx/nginx.conf:54 2016/07/02 15:53:26 [emerg] 12320#0: unexpected "}" in /etc/nginx/nginx.conf:56 2016/07/02 15:53:53 [emerg] 12357#0: unexpected end of file, expecting "}" in /etc/nginx/nginx.conf:55 2016/07/02 15:54:21 [crit] 12397#0: *1 connect() to 127.0.0.1:8001 failed (13: Permission denied) while connecting to upstream, client: 192.168.5.70, server: netbox-centos7, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8001/", host: "192.168.5.59", referrer: "http://192.168.5.59/" 2016/07/02 15:54:22 [crit] 12397#0: *1 connect() to 127.0.0.1:8001 failed (13: Permission denied) while connecting to upstream, client: 192.168.5.70, server: netbox-centos7, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8001/", host: "192.168.5.59", referrer: "http://192.168.5.59/"

Trying to figure out where the permission issue is. I have nginx permission for the files but, not sure if that is the correct way or not.

aoyawale avatar Jul 05 '16 20:07 aoyawale

Odd. Can you show the output of ls -la /opt/netbox/netbox/static?

dinoocch avatar Jul 05 '16 20:07 dinoocch