Discover Centmin Mod today
Register Now

Wordpress Install wordpress in subfolder

Discussion in 'Blogs & CMS usage' started by Sunka, Jan 9, 2016.

Tags:
  1. Sunka

    Sunka Active Member

    917
    240
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +388
    Local Time:
    6:11 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    I have xenforo forum on address:
    Code:
    https://www.pijanitvor.com
    How to install wordpress in subfolder:
    Code:
    https://www.pijanitvor.com/shop
    And connect wordpress with all that magic things (redis, nginx...).
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  3. Sunka

    Sunka Active Member

    917
    240
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +388
    Local Time:
    6:11 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    Is there solution to install directly wordpress in subfolder of my forum?
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Informative Informative x 1
  5. Sunka

    Sunka Active Member

    917
    240
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +388
    Local Time:
    6:11 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    So complicated to install something in subdirectory.
    In Apache days, I just have to create database, upload files to subfolder and execute path to wordpress install file.

    I still can not understand why on nginx I just can not do it same way. I allready have forum, forum is on https, all "magic" connection with redis, nginx, php, fast x, fast y... are done.
    Is it so hard for sever configuration and server software to understand that all I need is just another program with same configuration like main program.

    I was wrong for thinking that creating new database and upload install files in forum subfolder will be enough to start.

    I just give up. Nginx is more and more closer to hell for me.
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    it's same with nginx just you need to edit nginx to support centmin.sh menu option 22 additional rewrite rules for default wp super cache or keycdn cache enabler options (in 123.09beta01)
    practise and more practise and it gets easier if you want better performance with nginx and wordpress cache addons

    and key is to practise on test site and test vps so you can afford to make mistakes and start over ;)
     
    • Optimistic Optimistic x 1
  7. ModeltogTossen

    ModeltogTossen I wish I could??

    313
    97
    28
    Dec 20, 2015
    Denmark
    Ratings:
    +143
    Local Time:
    6:11 AM
    1.9.12
    10.0.23
    Hi @Sunka

    I really do feel with you. I also came from Apache's enviroment and did had, or more precisely, still have issues to understand this 'hell' of Nginx configuration of stuff.

    Thats why I still don't have any centminmod live in production (sorry @eva2000) - because I still don't trust myself enough if things should goes wrong. But to be honest - with centminmod I do feel that things is easier. When beta09 gets stable I will move one production server to be using that, so I can learn more.

    @eva2000 is right - practice, practice and more practice is the way.. And most important things - stay positive - you will come after it in time, trust me here.
     
    • Like Like x 1
    • Friendly Friendly x 1
  8. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    yup can't stress this enough.. for anything in life, reading, learning & practice is key :)
     
  9. Sunka

    Sunka Active Member

    917
    240
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +388
    Local Time:
    6:11 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    But if I install wordpress via 22 menu option, then wordpress files have to go to public root of pijanitvor.com
    I do not want to mix xenforo files with wordpress files. Also if I have to upload something to wordpress folder, I will have to upload to original install folder, not to another one which is created after rewriting and changing install location folder.

    Also, why to create newdomain with option 22, and then relocate files?
    I read then this tutorial, and all is clear to me (I think) until I come to this part - Nginx vhost format for web root WordPress install at /. Edit /usr/local/nginx/conf/conf.d/yourdomain.com.conf to below format...

    Because I have domain allready, and xenforo forum is installed and configured on top of public path with all necessary magic (redis, nginx vhost, https...), what to do with wordpress which has to be in subfolder (aka pijanitvor.com/wordpress).

    Option 22 tutorial is good to me until change Nginx vhost part, which is confusing to me because I do not want to move wordpress to subfolder of this new vhost address, but to existed xenforo subfolder with existed vhost address.
    Tutorial shows how to create example.com, install wordpress at /public folder example.com and then relocate wordpress to example.com/blog, but I want to move to another vhost domain subfolder which is allready configured with https and conf files...
    It is confused what to do with wordpress /usr/local/nginx/conf/conf.d/newdomain1.com.conf because I do not move to exist domain in new directory but in totally another existed domain.

    So to recapitulate....
    I have xenforo forum at pijanitvor.com, redis is installed, https is installed... I just want to install wordpress in subfolder of that domain (pijanitvor.com/shop).
    Confusd parts in tutorials are vhost configuration and ssl configuration cause it is clashed with my brain because domain where I want to install wordpress already have all that configured.
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    cause centmin.sh menu option 22 isn't perfect as installing wp to subdirectory involves a slightly different nginx vhost to non-subdirectory installs for nginx configurations.. but working on that for 123.09beta01 https://community.centminmod.com/posts/23794/
     
    • Like Like x 1
  11. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    it's same process just moving to a different directory for moving target destination and editing a different target nginx vhost conf

    so instead moving from same vhost public to /blog
    Code:
    cd /home/nginx/domains/newdomain1.com/public
    mkdir blog
    mv license.txt wp-activate.php wp-blog-header.php wp-config.php wp-content wp-includes wp-load.php wp-mail.php wp-signup.php xmlrpc.php index.php wp-admin wp-comments-post.php wp-config-sample.php wp-cron.php wp-links-opml.php wp-login.php wp-settings.php wp-trackback.php blog
    change to moving different vhost from /home/nginx/domains/blog.newdomain1.com/public to /home/nginx/domains/newdomain1.com/public/blog
    Code:
    cd /home/nginx/domains/blog.newdomain1.com/public
    mkdir -p /home/nginx/domains/newdomain1.com/public/blog
    mv license.txt wp-activate.php wp-blog-header.php wp-config.php wp-content wp-includes wp-load.php wp-mail.php wp-signup.php xmlrpc.php index.php wp-admin wp-comments-post.php wp-config-sample.php wp-cron.php wp-links-opml.php wp-login.php wp-settings.php wp-trackback.php /home/nginx/domains/newdomain1.com/public/blog
    then update
    Code:
    cd /home/nginx/domains/newdomain1.com/public/blog/
    wp search-replace 'http://blog.newdomain1.com' 'http://newdomain1.com/blog' --skip-columns=guid --allow-root
     
    • Like Like x 1
  12. Sunka

    Sunka Active Member

    917
    240
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +388
    Local Time:
    6:11 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    Still do not understand that part - Changing Nginx Vhost
    For example, tutorial shows change
    from
    Code:
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    to
    Code:
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /blog/index.php?q=$uri&$args;
    to change to blog directory (subfolder), but in my example that would be complete new domain (from say shop.pijanitvor.com to pijanitvor.com/shop) and https is allready installed there.
     
  13. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    same as that line is relative to web root public

    so
    Code:
    try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /blog/index.php?q=$uri&$args;
    
    is relative to root path set in vhost so transplanting into any vhost is same as it's relative to /public of the vhost

    best to setup test VPS and test it out by using centmin.sh menu option 2 setup domain.com and then use centmin.sh menu option 22 to setup blog.domain.com and try the moving steps for blog.domain.com to domain.com vhost and directories
     
    • Like Like x 1
  14. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  15. Sunka

    Sunka Active Member

    917
    240
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +388
    Local Time:
    6:11 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    I have no resources for test instalation, so I have to give up.
    My plan was to create new database for wordpress
    Upload install files to pijanitvor.com/shop
    execute install of wordpress
    start using wordpress for shop for my forum

    ... but nginx said nop, you just can't do that

    I think that in future, on another move to another server one day I will give up from nginx. I just can not connect simple things to do it my self. I did not know that so simple step (install something in subfolder of existing domain) will be so complicated.
     
  16. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    because nginx doesn't support .htaccess apache style rewrites that's why you have to configure nginx rewrites for apache equivalents

    but that is partially why nginx performs better than apache as apache .htaccess rewrites will slow down performance
     
    • Agree Agree x 1
  17. Sunka

    Sunka Active Member

    917
    240
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +388
    Local Time:
    6:11 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    Yep, but in apache, if I want to install wordpress in subfolder of forum, I just have to create database, create subfolder, put install files there and install wordpress.

    maybe I can do it same way with nginx because main domain (forum) is installed (vhost), and maybe I can not. I do not know and I do not want to ruin forum if something goes wrong with instalation of wordpress
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    that's why need a test VPS to practise on.. even hourly cloud hosts so test for a few hours :)
     
    • Optimistic Optimistic x 1
  19. Sunka

    Sunka Active Member

    917
    240
    43
    Oct 31, 2015
    Rijeka, Croatia
    Ratings:
    +388
    Local Time:
    6:11 AM
    Nginx 1.13.3
    MariaDB 10.1.24
    yep
    I tried to understand, but I can not.
    To many things that confused me because in my case I have existing vsetup with existing configured https, cache etc...

    User in this thread has installation like I want to have (having xenforo in the root and wordpress in the subfolder).

    Let stay like it is now, just my forum and nothing else. I think that I will shotdown my forum in this year because I can not track all that new stuff with linux, nginx, php, mariadb, redis...
    It was my pleasure to be part of this community
     
  20. eva2000

    eva2000 Administrator Staff Member

    30,195
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    2:11 PM
    Nginx 1.13.x
    MariaDB 5.5
    Well at least you tried.. you can come back with a test vps in future I hope. Sometimes it takes a few attempts to get it to click to understand :)