Cannot get new Mercury installation to answer on port 80

I've installed Mercury on Debian per the Linode library document. Works great (love their documentation). Just have one small problem: my new drupal site will not answer on port 80. It only will answer on port 9880 which means something with my Pressflow/Varnish configuration isn't working right? Below are my files:

hostname:

indiestudio-s2

hosts:

127.0.0.1 localhost

173.255.213.31 indiestudio-s2

173.255.213.31 indiewriterdirectory.com indiestudio-s2

173.255.213.31 www.indiewriterdirectory.com

ports:

NameVirtualHost 173.255.213.31:9880

Listen 9880

# SSL name based virtual hosts are not yet supported, therefore no

NameVirtualHost statement here

Listen 443

/etc/default/varnish

instance=pressflow

DAEMON_OPTS="-a :80 \

-T localhost:6082 \

-b localhost:9880 \

-f /etc/varnish/pressflow.vcl \

-S /etc/varnish/secret \

-u varnish -g varnish \

-s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,250MB"

/etc/varnish/pressflow.vcl

backend default {

.host = "127.0.0.1";

.port = "9880";

.connect_timeout = 600s;

.firstbytetimeout = 600s;

.betweenbytestimeout = 600s;

}

If anyone can give me a heads up as to what I'm not configuring correctly that would be AWESOME.

8 Replies

I reinstalled from scratch after not getting something to work but still having the above problem. Any help appreciated. THANKS.

help anyone….if you need more of my configs I'll paste them in.

how do I know if varnish is even working? i know pressflow is working to some extent because when i go to my new site at http://my-site.com:9880 the drupal login screen has a search field that isn't usually there.

drupal seems to be acting completely normal except that i cannot access at port 80.

Anyone on this? I continue to access the new site via port 9880. But port 80 will not serve anything up.

Could you please provide the Apache virtualhost configuration (from /etc/apache/sites-available) for your site?

Hey thanks! Here it is…

ServerName indiewriterdirectory.com

ServerAlias www.indiewriterdirectory.com

ServerAdmin admin@indiestudiofilms.com

DocumentRoot /srv/www/indie-studio

ErrorLog /srv/www/indie-studio/logs/error.log

CustomLog /srv/www/indie-studio/logs/access.log combined

I had the exact IP named in this and the ports.conf files, but just changed to an asterisk trying to troubleshoot. The site answers to the above DNS names IF the port 9880 is appended.

Current ports.conf…

NameVirtualHost *:9880

Listen 9880

# SSL name based virtual hosts are not yet supported, therefore no

NameVirtualHost statement here

Listen 443

If this helps…

When i try and restart varnish with /etc/init.d/varnish restart i get:

Starting HTTP accelerator: varnishd failed! /usr/sbin/varnishd: invalid option -- S usage: varnishd [options]

And in my Drupal it is saying:

Warning: socket_connect() [function.socket-connect]: unable to connect [111]: Connection refused in _varnishterminalrun() (line 197 of /srv/www/indie-studio/sites/all/modules/varnish/varnish.module).

Update:

Have moved ahead a little bit - Linode pointed out that there needed to be a folder created per the error message above. I created the folder and then Varnish didn't like the DAEMON OPTS switches. Removed the -b switch. Now restarting varnish produces:

Stopping HTTP accelerator: varnishd failed!

Starting HTTP accelerator: varnishd failed!

Expected ID got '.'

(program line 92), at

(/etc/varnish/pressflow.vcl Line 8 Pos 1)

.host = "127.0.0.1";

Line eight is the host line from below:

backend default {

.host = "127.0.0.1";

.port = "9880";

.connect_timeout = 600s;

.firstbytetimeout = 600s;

.betweenbytestimeout = 600s;

.max_connections = 800;

}

But everywhere online I check this is right. Very puzzled.

Before continuing, I LOVE the Linode docs so this isn't a slam in any way. Linode staff helped me troubleshoot.

1) I had to create the /usr/bin/varnishd folder. It didn't exist.

2) I think the sample /etc/default/varnish file in the doc is off. It shows the below configuration:

DAEMON_OPTS="-a :80 \

-T localhost:6082 \

-b localhost:9880 \

-f /etc/varnish/pressflow.vcl \

-S /etc/varnish/secret \

-s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,135MB"

However varnish griped at me and said only -b or -f could be used. Not both. So I used -f.

3) Then varnish didn't like the sample pressflow.vcl. Had to strip it down to this for varnish to even load:

If you're running a single site on a server, or else want all sites

on a server to go through Varnish you'd only need one of the following backends.

Showing different possibilities for those who have sites that they

don't want to run Varnish on. In this example file, Varnish is assumed to

be running on port 80, and Apache (or whatever) on port 8080.

backend default {

set backend.host = "127.0.0.1";

set backend.port = "9880";

}

sub vcl_hash {

if (req.http.Cookie) {

set req.hash += req.http.Cookie;

}

}

*Note that this uses "set backend.host" as opposed to just ".host". Varnish didn't like .host amongst other things. So I'll have to research ideal vcl settings for pressflow sites. If anyone has any post them!

All the linode doc steps were good, but the missing folder and configuration files were getting me. Not sure if varnish versions changed or what as I'm new to this.

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