1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Problems moving over existing Xenforo installation to brand new environment

Discussion in 'Installation, Upgrade, and Import Support' started by Nicky Vermeersch, Aug 4, 2013.

  1. Nicky Vermeersch

    Nicky Vermeersch Active Member

    I have an account currently at Bluehost in a shared environment, and want to move a new VPS. I already set the VPS up fine with a working php-fpm / nginx environment.

    I copied my already existing xenforo installation over to the new environment.

    There are a few major flaws which now take place:

    - 99% of all avatars have a 'missing image' icon.
    - Once logged in, you can no longer logout. If you press the button nothing happens.
    - When I click on my user profile, which is supposed to bring out the user card, it shows:
    Code:
    The following error occurred
    The server responded with an error. The error message is in the JavaScript console.
    I checked the JavaScript console, and this is what it gives me:

    Code:
    XenForo.activate(
    e.fn.init[1]
    ) xenforo.js?_v=3636f341:200
    Attempted to call XenForo.OverlayLoader.show() for members/q220.1/?card=1 before overlay is created xenforo.js?_v=3636f341:265
    OverlayLoader for members/q220.1/?card=1 xenforo.js?_v=3636f341:263
    Attempted to call XenForo.OverlayLoader.show() for members/q220.1/?card=1 before overlay is created xenforo.js?_v=3636f341:265
    OverlayLoader for members/q220.1/?card=1 xenforo.js?_v=3636f341:263
    Attempted to call XenForo.OverlayLoader.show() for members/q220.1/?card=1 before overlay is created xenforo.js?_v=3636f341:265
    OverlayLoader for members/q220.1/?card=1 
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    As I posted in the other thread.

    Have you run a file health check in the ACP?
    Are you sure you copied over the /data and /internal_data directories?
    Are the permissions correct on them?
     
  3. Nicky Vermeersch

    Nicky Vermeersch Active Member

    Yeah, all files are present.
    the data and internal_data directories are copied over, these folders also kept their 777 permissions.

    The website in questions is on http://78.47.78.158/ if you want to see the Javascript error
     
  4. Nasr

    Nasr Well-Known Member

    it loads fine except for the avatars.
     
  5. MattW

    MattW Well-Known Member

    Are there any files inside the avatars folder?

    /data/avatars/s/0/

    ??
     
  6. Nicky Vermeersch

    Nicky Vermeersch Active Member

    Yeah you can view threads and navigate, but some things which may be related to javascript simply don't work (logged out for example).

    I added a user called 'Xenforo' with the password 'Xenforo'. If you for example log in, and you click on your avatar on the right, it is supposed to bring out the user card. You'll receive my aforementioned javascript error. Once you are logged in, and try to logout, you'll find yourself unable too as well.

    Yeah, all the avatars moved over from the old installation
     
  7. Martok

    Martok Well-Known Member

    Check your folder permissions again. Right clicking on an avatar and opening the image in a new tab gives a 403 Forbidden error.
     
  8. Nicky Vermeersch

    Nicky Vermeersch Active Member

    I noticed that avatar jpg's all are 644
    Code:
    -rw-r--r-- 1 root root 5.1K May  3 20:08 992.jpg
    folders are 755
    Code:
    drwxr-xr-x 2 root root 4.0K Aug  3 15:52 7
    They should just work no?
     
  9. MattW

    MattW Well-Known Member

    what user is nginx running as? can nginx read those files? Are there any errors in the nginx logs?
     
    Brogan likes this.
  10. Brogan

    Brogan XenForo Moderator Staff Member

    You need to chmod -r 777 the /data and internal_data directories.
     
  11. Nicky Vermeersch

    Nicky Vermeersch Active Member

    Actually, I find out it might be that :\ the user and group has to be nginx and not root
     
    MattW likes this.
  12. Nicky Vermeersch

    Nicky Vermeersch Active Member

    I recursively chmod'd those folders and their contents.
    I also noticed that the file owner and group was different when I compared it to a brand new xenforo installation on the same machine. I set the owner and group to correspond with the working forum, but it makes no differenc, It's very confusing :confused:.

    This image is forbidden and has -rwxrwxrwx 1 nginx nginx 39K May 3 20:08 1.jpg
    While this image has -rw-rw-rw- 1 nginx nginx 24K Aug 4 18:41 1.jpg
     
  13. MattW

    MattW Well-Known Member

    I'm not as upto speed with nginx as I'd like to be, but maybe @Floren can suggest something?
     
  14. JulianD

    JulianD Well-Known Member

    Can you post your nginx configuration files?
     
  15. Nicky Vermeersch

    Nicky Vermeersch Active Member

    /etc/nginx/conf.d/default.conf
    Code:
    server {
        listen      80;
        server_name  localhost;
    
        #charset koi8-r;
        #access_log  /var/log/nginx/log/host.access.log  main;
    
        location / {
            root  /usr/share/nginx/html;
            try_files $uri $uri/ /index.php?$uri&args;
            index  index.php index.html index.htm;
        }
    
        #error_page  404              /404.html;
    
        # redirect server error pages to the static page /50x.html
        #
        error_page  500 502 503 504  /50x.html;
        location = /50x.html {
            root  /usr/share/nginx/html;
        }
    
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass  http://127.0.0.1;
        #}
    
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php$ {
            root          /usr/share/nginx/html;
            try_files $uri =404;
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    
        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    
    
        #These 'rules' depend on the previously set root directly, and start in that directory.
        #Avoid using paths like /usr/share/nginx/html/library/ if you have the root setup as
        #/usr/share/nginx/html/ in that case you just should write /library/ here.
        location /data/ {
            allow 127.0.0.1;
            deny all;
        }
        location /internal_data/ {
            allow 127.0.0.1;
            deny all;
        }
    location /library/ {
            allow 127.0.0.1;
            deny all;
        }
    }
    
    /etc/nginx/nginx.conf

    Code:
    user  nginx;
    worker_processes  4;
    
    error_log  /var/log/nginx/error.log warn;
    pid        /var/run/nginx.pid;
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include      /etc/nginx/mime.types;
        default_type  application/octet-stream;
    
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
    
        access_log  /var/log/nginx/access.log  main;
    
        sendfile        on;
        #tcp_nopush    on;
    
        keepalive_timeout  65;
    
        #gzip  on;
    
        include /etc/nginx/conf.d/*.conf;
    }
    
     
  16. JulianD

    JulianD Well-Known Member

    Remove this

    Code:
        location /data/ {
            allow 127.0.0.1;
            deny all;
        }
    
    
    from /etc/nginx/conf.d/default.conf
     
    Nicky Vermeersch, Brogan and MattW like this.
  17. Nicky Vermeersch

    Nicky Vermeersch Active Member

    Yeah, that made the avatars work. Weird, I was recommended to use these rewrite rules of someone I know. I still have some javascript problems though

    edit: and ofcourse because /library is also blocked, with the javascript in it...
    This made it all stop working :( I feel so dumb now
     
  18. MattW

    MattW Well-Known Member

    You are getting a 403 response on the JS as well

    Code:
    Request URL:http://78.47.78.158/members/homie.572/?card=1&&_xfRequestUri=%2Fforum%2Fcommunity-announcement.22%2F&_xfNoRedirect=1&_xfResponseType=json
    Request Method:GET
    Status Code:403 Forbidden
    Request Headersview source
    Accept:application/json, text/javascript, */*; q=0.01
    Accept-Encoding:gzip,deflate,sdch
    Accept-Language:en,en-GB;q=0.8
    Connection:keep-alive
    Cookie:xf_session=4cc6d6165e6d4e235f9c5de5d22edaf9; __utma=213346194.934085280.1375632029.1375635079.1375637734.3; __utmb=213346194.5.10.1375637734; __utmc=213346194; __utmz=213346194.1375637734.3.3.utmcsr=xenforo.com|utmccn=(referral)|utmcmd=referral|utmcct=/community/threads/problems-moving-over-existing-xenforo-installation-to-brand-new-environment.56589/
    Host:78.47.78.158
    Referer:http://78.47.78.158/forum/community-announcement.22/
    User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
    X-Ajax-Referer:http://78.47.78.158/forum/community-announcement.22/
    X-Requested-With:XMLHttpRequest
    Query String Parametersview sourceview URL encoded
    card:1
    :
    _xfRequestUri:/forum/community-announcement.22/
    _xfNoRedirect:1
    _xfResponseType:json
    Response Headersview source
    Cache-control:private, max-age=0
    Connection:keep-alive
    Content-Encoding:gzip
    Content-Length:5766
    Content-Type:text/html; charset=UTF-8
    Date:Sun, 04 Aug 2013 17:35:58 GMT
    Expires:Thu, 19 Nov 1981 08:52:00 GMT
    Last-Modified:Sun, 04 Aug 2013 17:35:58 GMT
    Server:nginx/1.4.2
    Vary:Accept-Encoding
    X-Frame-Options:SAMEORIGIN
    X-Powered-By:PHP/5.3.3
     
  19. MattW

    MattW Well-Known Member

  20. JulianD

    JulianD Well-Known Member

    /library can be blocked. The basic setup recommended by XenForo is:

    Code:
    location /xf/ {
    	try_files $uri $uri/ /xf/index.php?$uri&$args;
    	index index.php index.html;
    }
    
    location /xf/internal_data/ {
    	internal;
    }
    location /xf/library/ {
           internal;
    }
    
    location ~ \.php$ {
    	try_files $uri =404;
    	fastcgi_pass    127.0.0.1:9000;
    	fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
    	include         fastcgi_params;
    }
    
    
     

Share This Page