Join the community today
Become a Member

vBulletin vBulletin 3.x nginx configuration ?

Discussion in 'Forum software usage' started by VIP_Hawaii, May 6, 2016.

  1. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    OK ... this is *almost* a duplicate of my introduction post ...

    I found CentminMod when I was doing searches trying to get ffmpeg-php working ... after a huge amount of research with no success, I finally tried (I think it was the first build of) CentminMod 123.09Beta01 ...

    Apparently that first build of the new Beta works! : I was able to get everything installed correctly, INCLUDING the elusive ffmpeg-php ... however :

    I am running VBulletin versiion 3.8.4 PL2, which, according to VBulletin.Com, does NOT support Nginx; only VB versions 5.0.4 appear to support Nginx at all : vBulletin Manual - Using vBulletin with NGINX ... maybe I can configure Apache to use the current PHP-FPM configuration with FFMPEG-PHP working? If so, please tell me what I need to change to make Apache use the new, awesome, all-inclusive PHP settings that Nginx now enjoys via CentminMod!

    Thanks so much for this awesome set of scripts and the support you provide online!

    VIP
     
    • Like Like x 1
  2. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    no need if you're lucky my vBulletin 5.x nginx config still works (haven't tested it in ages) see listing at Nginx Configuration Examples - CentminMod.com LEMP Nginx web stack for CentOS and directly at Nginx and vBulletin Connect 5 Vhost

    long term wise, you may want to consider migrating from vB5 to Xenforo Nginx Rewrites for Xenforo Friendly Urls - CentminMod.com LEMP Nginx web stack for CentOS

    As to Apache, no working setup for Centmin Mod as yet still work in progress for custom built Apache 2.4 RPMs and integration work at Beta Branch - custom Apache 2.4 RPMs for Centmin Mod LEMP stack | Centmin Mod Community Unfortunately, have many other things to develop for getting Centmin Mod 123.09beta01 released as stable first.
     
    Last edited: May 6, 2016
  3. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    Thanks for the speedy reply ...

    However, 1. I am not even using VBulletin 5.x, I'm using 3.8 ... did too much work on styles and other stuff in 3.8 (and paid too much money) to upgrade VBulletin now ... and 2. I'm using CentOS 32bit ... it looks there are not even any plans to include 32-bit installations in the Beta Apache/CentminMod project ... I'm not even asking for built-in RPMs, I was just hoping for a simple fix, i.e. manually editing some files to make Apache use the current PHP configuration which includes FFMPEG-PHP ... anyone have any suggestions? 3. CentMAP? Is that still available? Maybe that should be my solution! ??

    I would hate to waste the last several weeks of work on this including CentminMod installation ...

    VIP
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah Apache custom RPMs will be 64bit only. Unfortunately, no support by me for Apache setup to use current Centmin Mod's PHP-FPM setup. It is possible with alot of manual elbow work though.

    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such.

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    Next best option besides vB3 to Xenforo migration (highly recommended), would be vB3 to vB4 upgrade then using Nginx vBulletin 4.1.x inbuilt friendly URLs - CentminMod.com LEMP Nginx web stack for CentOS vB3 and vB4 will still give you a path to Xenforo and numerous other forum software importers down the road in the future.
     
  5. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    This is good, but ... what kind of manual elbow work? Anyone here care to help? Would it be just some modifications of config files or what? How much do you charge for help with this?

    VIP
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    For starters you need to install and properly configure Apache on Centmin Mod, config file changes etc and you'd have to manually update Apache for upgrades etc. As you're on 32bit OS i suspect you have low memory amount installed as such you'd probably run into Apache memory hogging situations alot too.

    Unfortunately, my rates are higher than most starting at 4 $$$$ figures for base 4 days optimisation work and even then I am booked up weeks and months in advance. Though right now i don't have much time as my mother just had quad bypass heart surgery so looking after her too.

    If you're not using vBSEO/dbSEO with vB 3.8 you can try this simple Centmin Mod Nginx config replacing domain.com with your domain. But mileage will vary and no support provided by me especially if there's conflicts with other site web app/php apps installed on same domain which may need nginx rewrite rules of their own. Though other forum members are welcome to help if they want :)

    nginx vhost created by centmin.sh menu option 2 and edited for vB 3.8 assuming using Centmin Mod 123.09beta01 as it has a few extra include files compared to Centmin Mod 123.08stable

    edit nginx vhost at /usr/local/nginx/conf/conf.d/domain.com.conf where domain.com is your domain name which you'd need to replace in below nginx vhost
    Code (Text):
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
    
      server_name domain.com www.domain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
      #add_header  X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=60m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      root /home/nginx/domains/domain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      # prevent access to ./directories and files
    #  location ~ (?:^|/)\. {
    #   deny all;
    #  }
    
    location ~ /archive {
      include /usr/local/nginx/conf/php.conf;
      rewrite ^/archive/index.php/t-([0-9]+)\.html /archive/index.php?t-$1.html last;
      rewrite ^/archive/index.php/f-([0-9]+)\.html /archive/index.php?f-$1.html last;
    }
    
    location / {
      include /usr/local/nginx/conf/503include-only.conf;
      try_files    $uri $uri/ /index.php;
    
    }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }

    Uncomment this line removing front hash # if it's a test install and you don't want search engines indexing the test install and restart nginx server
    Code (Text):
    #add_header  X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
    


    upload_2016-5-6_2-7-33.png

    upload_2016-5-6_2-8-35.png

    vb3810-centminmod-ffmpeg-00.png
     
    Last edited: May 6, 2016
  7. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    Thanks a lot for the effort; I tried creating a virtual host (although I'm only connecting via localhost), substituting "domain.com" with "localhost". ... tried restarting Nginx and PHP-FPM. I also had to create a symlink again to an external hard drive, because one very important script I use can only have one document root, and I want the most possible storage space for videos, etc. so I use an external 4 TB drive as my SATA on the motherboard only supports up to 2 TB ... and for the life of me, I could not figure out (even with lots of web searching) any way to get Nginx to use the external hard disk drive for document root ... :

    ln -s /mnt/4tbhome/www/html /home/nginx/domains/localhost/public
    service nginx restart
    fpmrestart

    but all that got me was a "404 Not Found", even though the directory and files are there .... I have no idea why. Nginx may be faster, but it is sure a pain to configure correctly compared with Apache ... I don't know what is wrong or what to do now.

    Anyone have any ideas?

    VIP

    P.S. : I can't even afford 2-digit prices right now really ... and my own mom and dad went through a quad bypass and everything went well ...
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah my dad had triple bypass 20yrs ago and now my mum had quad bypass recently and both still here with me :D

    It ain't much of pain with Centmin Mod LEMP stack if you just had /home partitioned to a size that is suited for your web site's disk usage requirements ;)

    Just change webroot in nginx vhost from /home/nginx/domains/domain.com/public to the new webroot path
    Code (Text):
    root /home/nginx/domains/domain.com/public;
    

    but permission wise Getting Started step 2 is still applicable for uploaded files to be chown'd to nginx user and group however pure-ftpd virtual ftp user won't work without symlink i believe.

    rest is up to you and members to chime in
     
  9. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    Yes, already fixed the webroot path before I got the 404 error ... have no idea what is wrong now.

    VIP
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    To troubleshoot Nginx and PHP-FPM issues you'd want to check the domain site's vhost access.log and error.log logs located within directory at /home/nginx/domains/yourdomain.com/logs. You can see a full overview at centminmod.com/configfiles.html

    FAQ item 19 has more info on all Centmin Mod relevant log files locations and how to use tail command to view a sample of the entries.

    Also post the contents of your site's nginx vhost http /usr/local/nginx/conf/conf.d/yourdomain.com.conf and/or /usr/local/nginx/conf/conf.d/yourdomain.com.ssl.conf in BBCODE CODE tags as outlined at How to use forum BBCODE code tags | Centmin Mod Community
     
  11. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    OK, looking into the log files now :

    access.log is empty ...
    error.log seems to be showing me that it doesn't like the fact I renamed the /public directory so I could create a substitute symlink to the external HDD ... it keeps looking for /public/maintenance.html .... I really need a *real* way to use the external HDD for document root ... otherwise, I will have to copy all the files in my recently-renamed /public folder to the actual, symlinked external HDD document root folder ?

    NOTE : for whatever reason, clicking on "Use BB Code Editor" does NOT show any clickable BBCodes, so I clicked the button and had to enter CODE and /CODE manually ... I did search for the CODE tag ... I am still used to VBulletin (3.8.x) :

    error.log :
    Code:
    2016/05/05 19:28:38 [error] 13746#13746: *1 open() "/home/nginx/domains/localhost/public/maintenance.html" failed (2: No such file or directory) while sending to client, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
    2016/05/05 19:28:39 [error] 13746#13746: *1 open() "/home/nginx/domains/localhost/public/maintenance.html" failed (2: No such file or directory) while sending to client, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
    2016/05/05 19:29:04 [error] 13746#13746: *4 open() "/home/nginx/domains/localhost/public/maintenance.html" failed (2: No such file or directory) while sending to client, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
    2016/05/05 19:29:05 [error] 13746#13746: *4 open() "/home/nginx/domains/localhost/public/maintenance.html" failed (2: No such file or directory) while sending to client, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
    2016/05/05 19:37:38 [error] 13748#13748: *7 open() "/home/nginx/domains/localhost/public/maintenance.html" failed (2: No such file or directory) while sending to client, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
    ... here is my localhost.conf file :
    Code:
    # Centmin Mod Getting Started Guide
    # must read [URL='http://centminmod.com/getstarted.html']Getting Started Guide - CentminMod.com LEMP Nginx web stack for CentOS[/URL]
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #  listen  80;
    #  server_name localhost;
    #  return 301 $scheme://localhost$request_uri;
    #  }
    
    server {
      server_name localhost localhost.localdomain;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
      #add_header  X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/localhost/log/access.log combined buffer=256k flush=60m;
      error_log /home/nginx/domains/localhost/log/error.log;
    
      root /home/nginx/domains/localhost/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      # prevent access to ./directories and files
    #  location ~ (?:^|/)\. {
    #  deny all;
    #  }
    
    location ~ /archive {
      include /usr/local/nginx/conf/php.conf;
      rewrite ^/archive/index.php/t-([0-9]+)\.html /archive/index.php?t-$1.html last;
      rewrite ^/archive/index.php/f-([0-9]+)\.html /archive/index.php?f-$1.html last;
    }
    
    location / {
      include /usr/local/nginx/conf/503include-only.conf;
      try_files  $uri $uri/ /index.php;
    
    }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    

    VIP
     
    Last edited: May 6, 2016
  12. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  13. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    if you deleted that file then yes, it would be used both include files in vhost
    Code (Text):
    include /usr/local/nginx/conf/503include-main.conf;
    

    and
    Code (Text):
    include /usr/local/nginx/conf/503include-only.conf;
    

    try removing them and restart nginx and php-fpm and see
     
  14. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    Obviously I did not understand what you meant by "try removing *them*" ... thought you meant the
    503include-main.conf and 503include-only.conf files ... not sure where to make this edit : nginx.conf isn't it apparently : it's still looking for those files (I only renamed them, now renaming them back) ...

    VIP
     
  15. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    remove include lines from your nginx domain vhost file /usr/local/nginx/conf/conf.d/yourdomain.com.conf
     
  16. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    OK, sorry for my stupidity ... I did delete those two include lines and don't get a 404 anymore ... but I am back to my other problem (which I have not mentioned yet) which is that for whatever reason, despite the fact that I have just (from the commandline) restored an SQL database I know to work (and have checked the contents just by eye using Adminer ... [I gave up using PHPMyAdmin due to its many funky pecularities for now] and everything seems to be fine in the database ... all tables appear to be there ... BUT : I keep getting a "Database Error" with no details included when hitting http://localhost ... instead of seeing my VB homepage. Checking /var/log/mysqld.log I see no obvious errors ... same with the Nginx log ... I won't paste it unless asked, to save space here though. Still not sure what to do ... what's strange is that if I stop Nginx, then start Apache, I have the same problem, "Database Error", even though before installing CentminMod I was able to serve these pages using Apache, using the exact same database SQL file, with no database error.

    VIP
     
  17. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
    What version of vB 3.8, some older versions do not support newer PHP versions 5.5+ and higher and do not support Mysql 5.5+ syntax and need vB config.php using mysqli and not mysql for dbtype.
    Code (Text):
            //      ****** DATABASE TYPE ******
            //      This is the type of the database server on which your vBulletin database will be located.
            //      Valid options are mysql and mysqli, for slave support add _slave.  Try to use mysqli if you are using PHP 5 and MySQL 4.1+
            // for slave options just append _slave to your preferred database type.
    $config['Database']['dbtype'] = 'mysqli';
    

    You'd want to be running vB 3.8.9 or 3.8.10 betas as Centmin Mod uses MariaDB 10.0.x with 123.08stable and MariaDB 10.1.x with 123.09beta01.
     
  18. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    I'm using 3.8.4 PL2 but I have patched it (hopefully correctly) to be able to use PHP 5.5 to 5.6 ...

    VIP
     
  19. eva2000

    eva2000 Administrator Staff Member

    30,152
    6,782
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,133
    Local Time:
    8:21 AM
    Nginx 1.13.x
    MariaDB 5.5
  20. VIP_Hawaii

    VIP_Hawaii Member

    34
    6
    8
    May 6, 2016
    Ratings:
    +7
    Local Time:
    1:21 AM
    1.11.3
    10.1.13 (?)
    Checked PHP-FPM error log ... all I get is this :
    Code:
    [05-May-2016 14:10:27 UTC] PHP Strict Standards:  Non-static method vBulletinHook::init() should not be called statically in /mnt/4tbhome/www/html/install/init.php on line 212
    [05-May-2016 14:10:27 UTC] PHP Strict Standards:  Non-static method vBulletinHook::fetch_hook() should not be called statically in /mnt/4tbhome/www/html/includes/adminfunctions.php on line 399
    [05-May-2016 14:10:27 UTC] PHP Strict Standards:  Non-static method vBulletinHook::init() should not be called statically in /mnt/4tbhome/www/html/includes/class_hook.php on line 118
    
    I have read all about how to suppress PHP errors but none of the methods I have read about actually work. Still do not know what to do.

    VIP