Need some help setting up Netbox with apache2

3,324 views
Skip to first unread message

JR McVicker

unread,
Apr 7, 2017, 12:43:08 PM4/7/17
to NetBox
Good afternoon.  Prior to installing apache2 I was able to issue ./manage.py runserver 0.0.0.0:8000 --insecure and netbox started up with no problems.  The following day I continued on with the instructions and installed apache2, gunicorn and supervisor.  When I try going to the IP address of my server it just loads the default apache page.  I can't seem to get netbox to load.  If I try disabling the 000-default site by issuing sudo a2dissite 000-default and refresh my browser I get a 503 Service Unavailable message.

Here is my netbox.conf from /etc/apache2/sites-available

<VirtualHost *:80>
    ProxyPreserveHost On

    ServerName netbox

    Alias /static /opt/netbox/netbox/static

    <Directory /opt/netbox/netbox/static>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Require all granted
    </Directory>

    <Location /static>
        ProxyPass !
    </Location>

    ProxyPass / http://localhost:8001/
    ProxyPassReverse / http://localhost:8001/
</VirtualHost>


Output from running apache2ctl -t

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK


Output from running apache2ctl -S

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
         port 80 namevhost netbox (/etc/apache2/sites-enabled/netbox.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex watchdog-callback: using_defaults
Mutex proxy: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33 not_used
Group: name="www-data" id=33 not_used

Here is the last chunk of my apache2 error log.

[Fri Apr 07 10:00:22.195722 2017] [proxy:error] [pid 6393:tid 140035655460608] AH00940: HTTP: disabled connection for (127.0.0.1)
[Fri Apr 07 10:00:22.437777 2017] [proxy:error] [pid 6393:tid 140035647067904] AH00940: HTTP: disabled connection for (127.0.0.1)
[Fri Apr 07 10:00:22.669626 2017] [proxy:error] [pid 6393:tid 140035638675200] AH00940: HTTP: disabled connection for (127.0.0.1)
[Fri Apr 07 10:00:22.859577 2017] [proxy:error] [pid 6393:tid 140035630282496] AH00940: HTTP: disabled connection for (127.0.0.1)
[Fri Apr 07 10:00:23.073271 2017] [proxy:error] [pid 6393:tid 140035621889792] AH00940: HTTP: disabled connection for (127.0.0.1)
[Fri Apr 07 10:00:23.253126 2017] [proxy:error] [pid 6394:tid 140035755075328] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8001 (127.0.0.1) failed
[Fri Apr 07 10:00:23.253310 2017] [proxy:error] [pid 6394:tid 140035755075328] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Fri Apr 07 10:00:23.253388 2017] [proxy_http:error] [pid 6394:tid 140035755075328] [client 172.16.72.1:63185] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Fri Apr 07 10:00:23.553368 2017] [proxy:error] [pid 6394:tid 140035746682624] AH00940: HTTP: disabled connection for (127.0.0.1)
[Fri Apr 07 10:23:17.337444 2017] [proxy:error] [pid 6394:tid 140035763468032] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8001 (127.0.0.1) failed
[Fri Apr 07 10:23:17.337479 2017] [proxy:error] [pid 6394:tid 140035763468032] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Fri Apr 07 10:23:17.337484 2017] [proxy_http:error] [pid 6394:tid 140035763468032] [client 172.16.72.1:63482] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Fri Apr 07 10:23:19.344661 2017] [proxy:error] [pid 6393:tid 140035605104384] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8001 (127.0.0.1) failed
[Fri Apr 07 10:23:19.344739 2017] [proxy:error] [pid 6393:tid 140035605104384] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Fri Apr 07 10:23:19.344744 2017] [proxy_http:error] [pid 6393:tid 140035605104384] [client 172.16.72.1:63483] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Fri Apr 07 10:23:33.073575 2017] [proxy:error] [pid 6393:tid 140035596711680] AH00940: HTTP: disabled connection for (127.0.0.1)
[Fri Apr 07 10:24:26.454721 2017] [proxy:error] [pid 6394:tid 140035596711680] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8001 (127.0.0.1) failed
[Fri Apr 07 10:24:26.455001 2017] [proxy:error] [pid 6394:tid 140035596711680] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Fri Apr 07 10:24:26.455077 2017] [proxy_http:error] [pid 6394:tid 140035596711680] [client 172.16.72.1:63537] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
[Fri Apr 07 10:26:10.525760 2017] [mpm_event:notice] [pid 6390:tid 140035883104128] AH00491: caught SIGTERM, shutting down
[Fri Apr 07 10:26:11.596669 2017] [mpm_event:notice] [pid 6640:tid 140540152878976] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 07 10:26:11.596822 2017] [core:notice] [pid 6640:tid 140540152878976] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 07 10:26:18.007698 2017] [proxy:error] [pid 6643:tid 140540066813696] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:8001 (localhost) failed
[Fri Apr 07 10:26:18.007753 2017] [proxy:error] [pid 6643:tid 140540066813696] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 60s
[Fri Apr 07 10:26:18.007791 2017] [proxy_http:error] [pid 6643:tid 140540066813696] [client 172.16.72.1:63604] AH01114: HTTP: failed to make connection to backend: localhost
[Fri Apr 07 10:29:30.436150 2017] [mpm_event:notice] [pid 6640:tid 140540152878976] AH00491: caught SIGTERM, shutting down
[Fri Apr 07 10:29:31.503483 2017] [mpm_event:notice] [pid 6798:tid 140465015555968] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 07 10:29:31.503564 2017] [core:notice] [pid 6798:tid 140465015555968] AH00094: Command line: '/usr/sbin/apache2'
[Fri Apr 07 10:30:17.502000 2017] [mpm_event:notice] [pid 6798:tid 140465015555968] AH00491: caught SIGTERM, shutting down
[Fri Apr 07 10:30:18.568534 2017] [mpm_event:notice] [pid 6922:tid 140183646152576] AH00489: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Fri Apr 07 10:30:18.568609 2017] [core:notice] [pid 6922:tid 140183646152576] AH00094: Command line: '/usr/sbin/apache2'


scrupul0us

unread,
Apr 10, 2017, 2:45:43 PM4/10/17
to NetBox
>> ServerName netbox

"netbox" is not a FWDN "fully qualified domain" and should be something like "netbox.yourdomain.com" - a domain over which you have DNS control and can place an A/PTR record for (ideally) 

JR McVicker

unread,
Apr 10, 2017, 3:38:41 PM4/10/17
to scrupul0us, NetBox
Thanks.  That is a mistype which I have corrected.  However, I should still be able to access Netbox via the IP of the server correct?

On Mon, Apr 10, 2017 at 2:45 PM, scrupul0us <brian....@gmail.com> wrote:
>> ServerName netbox

"netbox" is not a FWDN "fully qualified domain" and should be something like "netbox.yourdomain.com" - a domain over which you have DNS control and can place an A/PTR record for (ideally) 

--
You received this message because you are subscribed to a topic in the Google Groups "NetBox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/netbox-discuss/2TSZ1tnSpyc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/cf13b088-69b9-4392-b6fb-cebe25345a32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

That Guy

unread,
Jul 8, 2017, 8:01:22 PM7/8/17
to NetBox
Did you ever get this working? I've got two instances, one sitting on python 2.7 and one on python 3.5 both with the exact same results you are getting. Having a FQDN isn't make a difference, and still brings up just the Apache default page.


On Monday, April 10, 2017 at 3:38:41 PM UTC-4, JR McVicker wrote:
Thanks.  That is a mistype which I have corrected.  However, I should still be able to access Netbox via the IP of the server correct?
On Mon, Apr 10, 2017 at 2:45 PM, scrupul0us <brian....@gmail.com> wrote:
>> ServerName netbox

"netbox" is not a FWDN "fully qualified domain" and should be something like "netbox.yourdomain.com" - a domain over which you have DNS control and can place an A/PTR record for (ideally) 

--
You received this message because you are subscribed to a topic in the Google Groups "NetBox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/netbox-discuss/2TSZ1tnSpyc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to netbox-discus...@googlegroups.com.
To post to this group, send email to netbox-...@googlegroups.com.

That Guy

unread,
Jul 8, 2017, 8:14:51 PM7/8/17
to NetBox
Ah, I'm an idiot....for those who get stuck in the same situation....

under /etc/apache2/sites-available/netbox.conf

Servername:  <IP>:port

Brandon Strohmeyer

unread,
Jul 12, 2017, 12:32:22 PM7/12/17
to NetBox
It's been a while but I think I ran into the same (or similar) issues during my initial netbox install, was due to SELinux denying outbound connections. Might want to check it. 

/usr/sbin/setsebool -P httpd_can_network_connect 1

Huy Kon

unread,
May 31, 2020, 12:53:12 AM5/31/20
to NetBox
bash: /usr/sbin/setsebool: No such file or directory
Reply all
Reply to author
Forward
0 new messages