Refused Connection

Hello there,

I use one of my linodes for testing. I have re-installed the same application several times testing out different configurations. However my enabled-site config file has not changed. This is it:

ServerName astrocospace.com

ServerAdmin [email protected]

ServerAlias http://www.astrocospace.com astrocospace.com

DocumentRoot /var/www/html

DirectoryIndex index.html index.php

WSGIDaemonProcess allianceauth python-path=/home/allianceserver/allianceauth

WSGIProcessGroup allianceauth

WSGIScriptAlias / /home/allianceserver/allianceauth/alliance_auth/wsgi.py

Alias /favicon.ico /var/www/favicon.ico

Alias /static/ /home/allianceserver/allianceauth/static/

Alias /templates/ /home/allianceserver/allianceauth/templates/

Alias /forums "/var/www/html/forums/"

Alias /killboard "/var/www/killboard/"

Alias /info "/var/www/html/"

Require all granted

Require all granted

Require all granted

Options FollowSymLinks

AllowOverride None

Require all granted

Options Indexes FollowSymLinks MultiViews

AllowOverride None

Require all granted

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Require all granted

ErrorLog ${APACHELOGDIR}/error.log

Possible values include: debug, info, notice, warn, error, crit,

alert, emerg.

LogLevel warn

CustomLog ${APACHELOGDIR}/ssl_access.log combined

Alias /doc/ "/usr/share/doc/"

Options Indexes MultiViews FollowSymLinks

AllowOverride None

Require host 127.0.0.0/255.0.0.0 ::1/128

I am getting an error saying: astrocospace.com refused to connect.

I have updated the system, updated php, mysql. It should be noted that the app is running off a redis server and is running fine. The only problem is accessing it via a browser.

Accessing the logs I get this:

[Wed Mar 01 06:52:14.976863 2017] [mpm_event:notice] [pid 27714:tid 139685319960448] AH00489: Apache/2.4.18 (Ubuntu) configured – resuming normal operations

[Wed Mar 01 06:52:14.976970 2017] [core:notice] [pid 27714:tid 139685319960448] AH00094: Command line: '/usr/sbin/apache2'

[Wed Mar 01 06:52:23.971233 2017] [mpm_event:notice] [pid 27714:tid 139685319960448] AH00491: caught SIGTERM, shutting down

[Wed Mar 01 06:52:25.033479 2017] [mpm_prefork:notice] [pid 1218] AH00163: Apache/2.4.18 (Ubuntu) configured – resuming normal operations

[Wed Mar 01 06:52:25.033578 2017] [core:notice] [pid 1218] AH00094: Command line: '/usr/sbin/apache2'

[Wed Mar 01 06:52:26.414654 2017] [mpm_prefork:notice] [pid 1218] AH00169: caught SIGTERM, shutting down

[Wed Mar 01 06:52:27.512606 2017] [mpm_prefork:notice] [pid 1323] AH00163: Apache/2.4.18 (Ubuntu) configured – resuming normal operations

[Wed Mar 01 06:52:27.512685 2017] [core:notice] [pid 1323] AH00094: Command line: '/usr/sbin/apache2'

[Wed Mar 01 06:52:29.016091 2017] [mpm_prefork:notice] [pid 1323] AH00169: caught SIGTERM, shutting down

[Wed Mar 01 06:52:30.061758 2017] [wsgi:warn] [pid 1441] mod_wsgi: Compiled for Python/2.7.11.

[Wed Mar 01 06:52:30.061806 2017] [wsgi:warn] [pid 1441] mod_wsgi: Runtime using Python/2.7.12.

[Wed Mar 01 06:52:30.063803 2017] [mpmprefork:notice] [pid 1441] AH00163: Apache/2.4.18 (Ubuntu) modwsgi/4.3.0 Python/2.7.12 configured – resuming normal operations

[Wed Mar 01 06:52:30.063828 2017] [core:notice] [pid 1441] AH00094: Command line: '/usr/sbin/apache2'

[Wed Mar 01 07:19:32.244233 2017] [mpm_prefork:notice] [pid 1441] AH00169: caught SIGTERM, shutting down

When I do server status it shows that apache2 is not running.

Any help would be great.

7 Replies

I also checked my syntax and this is what I received:

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

Syntax OK

I also get this when I check the status:

[email protected]:~/allianceauth$ service apache2 status

● apache2.service - LSB: Apache2 web server

Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)

Drop-In: /lib/systemd/system/apache2.service.d

└─apache2-systemd.conf

Active: inactive (dead) since Wed 2017-03-01 09:03:15 UTC; 23min ago

Docs: man:systemd-sysv-generator(8)

Process: 10305 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)

Process: 10290 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

Not sure what else to put in here. Hope that is enough.

When I try to connect to your server over port 80 it's giving a connection refused, I'm thinking you may have a firewall blocking connections on that port. You can check your iptable rules with 'iptables -L'. You'll want to look for any rules either rejecting port 80 or a reject all type of rule without an accept from 80. I always check this guide for reference:

https://www.linode.com/docs/security/fi … by-address">https://www.linode.com/docs/security/firewalls/control-network-traffic-with-iptables#whitelistblacklist-traffic-by-address

You can also see if there's anything fishy going on with the ports you're already connected to with 'netstat -plntu'. Your original post has you stating that it's not running. If it's not running and refusing to start correctly, there may be something listening on 80 already. This command should help if that's the case.

Good luck!

Pretty much bet Apache won't have read access to some of those directories by default.

WSGIDaemonProcess allianceauth python-path=/home/allianceserver/allianceauth

WSGIScriptAlias / /home/allianceserver/allianceauth/alliance_auth/wsgi.py

Alias /static/ /home/allianceserver/allianceauth/static/

Alias /templates/ /home/allianceserver/allianceauth/templates/

Ok so I went and rebuilt my linode and went with the default apache2 config file. I did turn off "Keep Alive" in the apache2.conf and left everything else the same. Here is what I installed:

Apache2

mysql

php7.0 & php5.6

python python-dev python-mysqldb python-setuptools python-mysql.connector python-pip

screen unzip git redis-server curl libssl-dev libbz2-dev libffi-dev

the site was accessible until I installed php, python, & the other apps.

I did downgrade to php5.6 and enabled it. Now I have the basic site-enabled config file in use and I am getting the same error.

I know my dns is setup and working properly otherwise I would not have been able to access the site before the app installs.

This is my current apache2 site enabled config:

# The ServerName directive sets the request scheme, hostname and port that

the server uses to identify itself. This is used when creating

redirection URLs. In the context of virtual hosts, the ServerName

specifies what hostname must appear in the request's Host: header to

match this virtual host. For the default virtual host (this file) this

value is not decisive as it is used as a last resort host regardless.

However, you must set it for any further virtual host explicitly.

ServerName www.example.com

ServerName astrocospace.com

ServerAdmin [email protected]

ServerAlias www.astrocospace.com astrocospace.com

DocumentRoot /var/www/html

DirectoryIndex index.html index.php

Available loglevels: trace8, …, trace1, debug, info, notice, warn,

error, crit, alert, emerg.

It is also possible to configure the loglevel for particular

modules, e.g.

LogLevel info ssl:warn

ErrorLog ${APACHELOGDIR}/error.log

CustomLog ${APACHELOGDIR}/access.log combined

For most configuration files from conf-available/, which are

enabled or disabled at a global level, it is possible to

include a line for only one particular virtual host. For example the

following line enables the CGI configuration for this host only

after it has been globally disabled with "a2disconf".

Include conf-available/serve-cgi-bin.conf

vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I also have pinged the site using the ip address and the server alias name.

I am stumped as to what can be causing this.

Here is my DNS setup:

Name Server Subdomain TTL Options

ns1.linode.com astrocospace.com Default Edit | Remove

ns2.linode.com astrocospace.com Default Edit | Remove

ns3.linode.com astrocospace.com Default Edit | Remove

ns4.linode.com astrocospace.com Default Edit | Remove

ns5.linode.com astrocospace.com Default Edit | Remove

Hostname IP Address TTL Options

104.237.146.204 Default Edit | Remove

mail 104.237.146.204 Default Edit | Remove

www 104.237.146.204 Default Edit | Remove

2600:3c03::f03c:91ff:fee7:884a Default Edit | Remove

mail 2600:3c03::f03c:91ff:fee7:884a Default Edit | Remove

www 2600:3c03::f03c:91ff:fee7:884a Default Edit | Remove

My apache error log gives me this:

[Sat Mar 04 06:25:13.635621 2017] [wsgi:warn] [pid 6783] mod_wsgi: Compiled for Python/2.7.11.

[Sat Mar 04 06:25:13.635672 2017] [wsgi:warn] [pid 6783] mod_wsgi: Runtime using Python/2.7.12.

[Sat Mar 04 06:25:13.637625 2017] [mpmprefork:notice] [pid 6783] AH00163: Apache/2.4.18 (Ubuntu) modwsgi/4.3.0 Python/2.7.12 configured – resuming normal operations

[Sat Mar 04 06:25:13.637648 2017] [core:notice] [pid 6783] AH00094: Command line: '/usr/sbin/apache2'

[Sat Mar 04 06:38:18.581317 2017] [mpm_prefork:notice] [pid 6783] AH00169: caught SIGTERM, shutting down

I hope this is enough info to see what may be the issue here.

Thanks for any and all help!!!

[Sat Mar 04 06:25:13.635621 2017] [wsgi:warn] [pid 6783] mod_wsgi: Compiled for Python/2.7.11.

[Sat Mar 04 06:25:13.635672 2017] [wsgi:warn] [pid 6783] mod_wsgi: Runtime using Python/2.7.12.

Install 2.7.11 or get rid of mod_wsgi

I was able to fix that but now I get this error:

[Sat Mar 04 09:32:56.175863 2017] [core:notice] [pid 7458] AH00094: Command line: '/usr/sbin/apache2'

sh: 1: /usr/sbin/sendmail: not found

I am not using any kind of mail system if that is what it means.

//run like this if you use python only
$ python manage.py runserver 0.0.0.0:8080

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct