Want to subscribe to topics you're interested in?
Become a Member

Xenforo wordpress and xenforo on the same vhost

Discussion in 'Forum software usage' started by upgrade81, Jun 8, 2018.

  1. upgrade81

    upgrade81 Member

    290
    17
    18
    Sep 5, 2016
    CH
    Ratings:
    +30
    Local Time:
    11:40 PM
    1.17
    10.3
    Hello everyone, I installed Wordpress on domain.com and XenForo in the subdirectory /forum/

    is there any particular procedure to be respected?
    Wordpress was installed with option 22 and Cache Enabler.

    Can I generate the usual vhost relative to Xenforo 2.0 with the classic tool?
    Generate Centmin Mod Nginx Vhost - CentminMod.com LEMP Nginx web stack for CentOS

    Thank you very much.

     
  2. eva2000

    eva2000 Administrator Staff Member

    50,922
    11,805
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,263
    Local Time:
    8:40 AM
    Nginx 1.25.x
    MariaDB 10.x
  3. upgrade81

    upgrade81 Member

    290
    17
    18
    Sep 5, 2016
    CH
    Ratings:
    +30
    Local Time:
    11:40 PM
    1.17
    10.3
    Seen and read I have already added the parts of the Vhost related to the forum directory with the new part for Xenforo2.

    But that discussion does not answer my question if they can coexist without problems using option 22 (cache enabler) and then modifying the vhost with the Xenphoro data.
     
  4. eva2000

    eva2000 Administrator Staff Member

    50,922
    11,805
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,263
    Local Time:
    8:40 AM
    Nginx 1.25.x
    MariaDB 10.x
    Yes they can if you start with centmin.sh menu option 22 wordpress install first then edit for xenforo.
     
  5. upgrade81

    upgrade81 Member

    290
    17
    18
    Sep 5, 2016
    CH
    Ratings:
    +30
    Local Time:
    11:40 PM
    1.17
    10.3
    OK! I got it.

    then I leave unchanged:

    include /usr/local/nginx/conf/php-wpsc.conf;

    #include /usr/local/nginx/conf/php-rediscache.conf;
    includes /usr/local/nginx/conf/pre-staticfiles-local-domain.it.conf;
    includes /usr/local/nginx/conf/pre-staticfiles-global.conf;
    includes /usr/local/nginx/conf/staticfiles.conf;
    include /usr/local/nginx/conf/drop.conf;
     
  6. eva2000

    eva2000 Administrator Staff Member

    50,922
    11,805
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,263
    Local Time:
    8:40 AM
    Nginx 1.25.x
    MariaDB 10.x
    yes but in each xenforo location context, need to add php.conf include for processing php as wordpress config uses it's own include for php within it's own location contexts
    Code (Text):
    include /usr/local/nginx/conf/php.conf;
    
     
  7. upgrade81

    upgrade81 Member

    290
    17
    18
    Sep 5, 2016
    CH
    Ratings:
    +30
    Local Time:
    11:40 PM
    1.17
    10.3
    do you mean that?

    Code (Text):
    location ~* /wp-admin/(load-scripts\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-styles\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location /forum/ {
         index index.php index.html index.htm;
         include /usr/local/nginx/conf/php.conf;
         try_files $uri $uri/ /forum/index.php?$uri&$args;
    }
    
    #location /forum/admin.php {
    #     auth_basic "Private";
    #     auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
    #        include /usr/local/nginx/conf/php.conf;
    #        allow 127.0.0.1;
            #allow YOURIPADDRESS;
    #        deny all;
    #}
    
    location /forum/install/data/ {
         internal;
    }
    
    location /forum/install/templates/ {
         internal;
    }
    
    location /forum/internal_data/ {
         internal;
    }
    
    location /forum/library/ {
         internal;
    }
    
    # xenforo 2 uncomment / remove hash from next 3 lines
    location /forum/src/ {
         internal;
    }
    
    include /usr/local/nginx/conf/wpincludes/mbenz.it/wpsecure_domain.it.conf;
      include /usr/local/nginx/conf/php-wpsc.conf;
    
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/php-rediscache.conf;
      include /usr/local/nginx/conf/pre-staticfiles-local-domain.it.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
    
     
  8. eva2000

    eva2000 Administrator Staff Member

    50,922
    11,805
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,263
    Local Time:
    8:40 AM
    Nginx 1.25.x
    MariaDB 10.x
    yes for /forum as well as other xenforo `internal` locations too (whichever locations where php is processed/php files exist in xenforo locations use include file /usr/local/nginx/conf/php.conf). This allows you to separate it from Wordpress's caching.