LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-11-2012, 01:35 AM   #1
dreamcoder
LQ Newbie
 
Registered: Jul 2012
Distribution: Ubuntu 12.04
Posts: 22

Rep: Reputation: Disabled
Angry Installed Varnish, Migrated my site frm shared hosting to VPS -Sudden Loss in Traffic


Hi Guys,

Yesterday evening I took a backup of my wp site from my shared hosting and ftp'd it to my Ubuntu Linux VPS having nginx 1.2.3, php, mysql

After a bit of configurations in wp-config.php everything was working fine.
When I entered the Ip Address of my site in the browser I could see my wp site working perfectly

But before updating my dns records I installed APC and after that I installed Varnish and configured it to scan all the incoming traffic on port 80 and then send it to nginx listening on port 8080, Also I have iptables configured to block all the ports except the port 80, 8080, 443 and the ssh port

Now I created a dns zone using my vps control panel for my domain name, which then gave me nameservers to be updated on my domain name registrar, then I updated the nameservers details on my domain name registrar's control panel with the one provided by vps cp

I did this yesterday evening, now today after the dns propagation, in the morning I see that the statcounter is reporting very low traffic, whereas I used to get on average 16k unique visitors per day and around 3k visitors by morning but today I got only 300 unique visitors..... A HUGE DIFFERENCE !!


Guys, I'm worried about this sudden drop in my traffic, I don't know what might have caused this. Is this because of varnish on 80 and nginx on port 8080? or because my shared host had Apache and I'm having nginx on my vps?


Guys, please help me out, what has caused this deadly problem and how can I fix this, I want my traffic back


Thanks a lot
 
Old 08-11-2012, 03:59 AM   #2
dreamcoder
LQ Newbie
 
Registered: Jul 2012
Distribution: Ubuntu 12.04
Posts: 22

Original Poster
Rep: Reputation: Disabled
A Quick Update:

===================

Guys, when I see the access logs of nginx I see that my Server IP Address is shown as the visitors IP Address in the logs

could this be causing the problem and how can I fix this ?
 
Old 08-22-2012, 05:32 PM   #3
TheMadIndian
Member
 
Registered: Dec 2007
Distribution: Fedora Slackware CentOS slax RHEL
Posts: 117

Rep: Reputation: 23
Quote:
Originally Posted by dreamcoder View Post
A Quick Update:

===================

Guys, when I see the access logs of nginx I see that my Server IP Address is shown as the visitors IP Address in the logs

could this be causing the problem and how can I fix this ?
Two things, first if varnish is caching with high hit rates nginx logs will no longer be accurate and you can rectify this by using varnishncsa this is a decent article on configuring it http://go2linux.garron.me/linux/2011...d-awstats-1014

second if you want to see an ip other than you machine add this to the vcl_recv
Code:
if (req.restarts == 0) {
                if (req.http.x-forwarded-for) {
                        set req.http.X-Forwarded-For = req.http.X-Forwarded-For + ", " + client.ip;
                } else {
                        set req.http.X-Forwarded-For = client.ip;
                }
        }
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
traffic on Shared Hosting Server increased Anup D. Linux - Enterprise 5 08-09-2012 02:51 PM
How to migrate email server from shared hosting to Linux VPS dreamcoder Linux - Server 2 08-04-2012 02:30 PM
Shared or Dedicated or VPS or Cloud hosting to host a custom PHP application vikram_cvk Linux - Server 1 02-06-2012 06:01 AM
How to redirect all traffic from a VPS to another VPS 124748768 Linux - Networking 0 07-08-2011 10:36 AM
Apache and FTP vps to work more like godaddy shared hosting fishdink Linux - Server 1 06-19-2009 07:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration