[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Varnish install on Ubuntu 14.04: Apache2 restart problem

Posted on 2014-08-13
11
Medium Priority
?
2,173 Views
Last Modified: 2014-08-13
Hi all,

I've just followed this guide to install varnish on my Ubuntu 14.04 x64 server:
http://www.namhuy.net/3147/install-configure-varnish-apache-ubuntu-14-04.html

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>
<VirtualHost 127.0.0.1:8080>

Open in new window


So the three questions are:

1.

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

2.

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

3.

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

thanks in advance
0
Comment
Question by:badwolfff
  • 6
  • 5
11 Comments
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 2000 total points
ID: 40259594
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.
0
 

Author Comment

by:badwolfff
ID: 40259602
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?

thanks
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40259608
Yes, if you want to access Apache from the outside.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:badwolfff
ID: 40259623
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
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40259636
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).
0
 

Author Comment

by:badwolfff
ID: 40259639
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
0
 

Author Comment

by:badwolfff
ID: 40259645
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?

thanks
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40259648
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) .
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40259652
>> 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.
0
 

Author Comment

by:badwolfff
ID: 40259655
Thanks that is very clear.
Did you read the question about mod_security and about the port 8888?
0
 

Author Comment

by:badwolfff
ID: 40259701
Got it working :)
thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month18 days, 11 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question