Welcome to Centmin Mod Community
Register Now

Installing Wordpress to existing vhost

Discussion in 'Blogs & CMS usage' started by radbrad, Jun 1, 2020.

  1. radbrad

    radbrad New Member

    21
    1
    3
    Feb 15, 2020
    Ratings:
    +1
    Local Time:
    10:39 PM
    Hi,
    I have already created the vhost and installed a script to the subdirectory now i want to install Wordpress to the main directory..but in centmin 22 menu you have to create the host and then you can install WordPress.

    My question is how do we install Wordpress to an existing Vhost?
     
  2. eva2000

    eva2000 Administrator Staff Member

    44,527
    10,170
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,742
    Local Time:
    3:09 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Yeah right now that isn't possible in an automated way as alot can go wrong if users actually have script/content in main directory web root on /public as well as normal content in subdirectories i.e /public/subdirectory. The risk is overwriting existing data in /public web root with Wordpress files and/or overwriting existing data in subdirectories.

    I guess I could add a check to see main web root at /public has no unexpected files beyond the default files expected and allow centmin.sh menu option 22 to proceed.

    What does your existing public web root look like for output for
    Code (Text):
    ls -lah /home/nginx/domains/yourdomain.com/public

    for posting code or output from commands to keep the formatting, you might want to use CODE tags for code How to use forum BBCODE code tags :)
     
  3. radbrad

    radbrad New Member

    21
    1
    3
    Feb 15, 2020
    Ratings:
    +1
    Local Time:
    10:39 PM
    Hi Eva,
    I followed this thread Wordpress - centmin.sh menu option 22 - How to switch Wordpress to subdirectory
    1. created vhost of subdomain app.domain.com
    2. Installed Wordpress on it.
    3. Changed the root directory inside app.domain.com.ssl.conf from app.domain.com/public to domain.com/public
    4. moved the Wordpress files from app.domain.com/public to domain.com/public
    5. Used WP-cli command
    6. Code:
      wp search-replace 'http://app.domain.com' 'http://domain.com' --skip-columns=guid --allow-root
      to replace app.domain.com to domain.com
    Everything was smooth and after that I can access Wordpress on domain.com but the problem is all internal pages showing "404 not found Nginx" error.
     
  4. eva2000

    eva2000 Administrator Staff Member

    44,527
    10,170
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,742
    Local Time:
    3:09 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    wordpress nginx rewrite/settings from app.domain.com.ssl.conf need to be added/migrated to domain.com.ssl.conf as well
     
  5. radbrad

    radbrad New Member

    21
    1
    3
    Feb 15, 2020
    Ratings:
    +1
    Local Time:
    10:39 PM
    Hi Eva, How will I do that?
     
  6. eva2000

    eva2000 Administrator Staff Member

    44,527
    10,170
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,742
    Local Time:
    3:09 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    you'd need to copy and paste the relevant wordpress settings over manually