Varnish install on Ubuntu 14.04: Apache2 restart problem

Hi all,

I've just followed this guide to install varnish on my Ubuntu 14.04 x64 server:

It all went smoothly till the stop that says:
service apache2 restart

I get this error:
lupocatttivo@octane:~$ sudo service apache2 start
 * Starting web server apache2                                                                                (98)Address already in use: AH00072: make_sock: could not bind to address [::]:8080
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems

Open in new window

I followed all the steps there to the letter. In /etc/apache2/ports.conf I changed the Listen 80 to Listen 8080 and in each .conf file for each of my sites in the /etc/apache2/sites-available folder I made the following adjustment:
#<VirtualHost *:80>

Open in new window

So the three questions are:


What am I doing wrong and how do I force the apache server to restart?


I have ISPConfig3 already installed on this server on port 8080. Could that cause conflict?


Is it possible to install Varnish on another port, like 8000 or 8888?

thanks in advance
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gerwin Jansen, EE MVETopic Advisor Commented:
You have another process that is listening on port 8080 - in your case ISPConfig3  - either change the portnumber there or the Apache port number. Try 9090 for example for Apache (or 8000 or 8888). Then (re)start Apache.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
badwolfffAuthor Commented:
Ok, I will try that now. By the way if I do that, do I have to open that new port on my Iptables and UFW firewalls?

Gerwin Jansen, EE MVETopic Advisor Commented:
Yes, if you want to access Apache from the outside.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

badwolfffAuthor Commented:
How do you mean access it from the outside? I only want my sites to work on it. I mean that I will only access the sites on this server from the outside, not the apache server itself. Does it make sense?

thanks again
Gerwin Jansen, EE MVETopic Advisor Commented:
I mean that if you now have a rule / port configured to access your ISPConfig3 (port 8080) then you need to do the same for Apache (port 8000 or 8888).
badwolfffAuthor Commented:
Sorry for being dumb. Just to clarify this: if during the varnish install I set the apache2 on port 8888, then I should open port 8888 on ufw and iptables, right?
I also have mod_security enabled with SecRuleEngine On
Will that make any difference?

thanks for all the help
badwolfffAuthor Commented:
Ah and one last question. At the top of the tutorial I needed to make changes to a file called: /etc/default/varnish
After the changes the file became:
## Alternative 2, Configuration with VCL
# Listen on port 6081, administration on localhost:6082, and forward to
# one content server selected by the vcl file, based on the request.
DAEMON_OPTS="-a :80 \
             -T localhost:6082 \
             -f /etc/varnish/default.vcl \
             -S /etc/varnish/secret \
             -s malloc,1G"

Open in new window

With reference to the -T localhost:6082 line, does that mean I have to open port 6082 too on UFW and IPTABLES?

Gerwin Jansen, EE MVETopic Advisor Commented:
Your example says: "Varnish serves contents on port 80 and gets data from Apache on port 8080", your 2nd bullet says "I have ISPConfig3 already installed on this server on port 8080. Could that cause conflict?" - you should not have both on the same port. That causes a conflict (only 1 service per port listening) .
Gerwin Jansen, EE MVETopic Advisor Commented:
>> With reference to the -T localhost:6082 line, does that mean I have to open port 6082 too on UFW and IPTABLES?
Probably not since you won't be accessing that 6082 port from the outside.
badwolfffAuthor Commented:
Thanks that is very clear.
Did you read the question about mod_security and about the port 8888?
badwolfffAuthor Commented:
Got it working :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.