Wordpress Installation

Discussion in 'General' started by AndrewPienaar, May 19, 2020.

  1. AndrewPienaar

    AndrewPienaar New Member

    Hi,

    This is my first time using a site with ISPConfig 3. If a domain has an existing non WordPress wesbsite (written in PHP), and I use the ASP Installer to install WordPress. Will it overwrite the current site completely?

    What is the correct way to install Wordpress on ISPConfig 3?

    cheers,
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Don't use the APS installer for sites that contain a website. Install WordPress like this instead:

    1) Create a database user and database for Wordpress in ISPConfig.
    2) Download the Wordpress archive to the folder where you want to install it and unpack it (or download it to your desktop, unpack it and then upload it by ftp).
    3) Open the URL of the Wordpress install in a browser and follow the instructions on the screen.
     
  3. AndrewPienaar

    AndrewPienaar New Member

  4. AndrewPienaar

    AndrewPienaar New Member

    Hi,

    Just to clarify, if I want to start the site from scratch. Do I still use the method you describe above or do I use the APS installer?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    I would always install WordPress manually, the packages from APS project are not up to date anymore.
     
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I use this script:
    Code:
    read -p "Web folder: " webdir
    read -p "Client ID (only numbers): " clientid
    read -p "Web ID: " webid
    mkdir /$webdir/tmp-wp
    cd /$webdir/tmp-wp
    wget https://wordpress.org/latest.zip
    unzip latest.zip
    mv  ./wordpress/* ../
    cd ../
    mv index.html index-standard.html
    rm -r tmp-wp
    chown -R web$webid:client$clientid ./*
    When executed, it will ask for the webdir, clientid, and webid. If you would be installing Wordpress for client 1, web 2, you would do this:
    Web folder: /var/www/clients/client1/web2/web
    Client ID: 1
    Web ID: 2
     
  7. Antonio Sanguigni

    Antonio Sanguigni New Member

    Hello, I found comfortable to have the chance to install all automatically. Yes, Wordpress was dated but its update always worked well. Is there a chance to have back packages repositories or a way to configure my personal link into ispconfig interface (for example downloading last zip wordpress package).
    Thank you
    Antonio
     
  8. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You can modify the code, though that will take quite some work. It is not possible to use a different repository. You can temporarily re-enable APS, (System -> Main Config) but it will be removed soon. We are looking into the possibility to write our own installer. For single server setups, you can use Softaculous aswell.
     
    etruel likes this.
  9. Antonio Sanguigni

    Antonio Sanguigni New Member

    Thank you very much, right now I re-enabled APS and it works really well. What a pity having such a dismission. Anyway, I will have a look at Softaculous and install it. Thank you very much for your reply.

    Antonio
     
    Th0m likes this.
  10. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    you could install wp-cli on the server.
    if you create an ssh user for the account, and ssh in as that user and go to the webroot, all you need to do is run:

    Code:
    $ wp core download
    # Install WordPress in 5 seconds
    $ wp core install --url=example.com --title=Example --admin_user=supervisor --admin_password=strongpassword [email protected]
    Success: WordPress installed successfully.
    
    # Install WordPress without disclosing admin_password to bash history
    $ wp core install --url=example.com --title=Example --admin_user=supervisor [email protected] --prompt=admin_password < admin_password.txt
    
    just remember to add wp-cli to the jailkit configuration if using chroot'd ssh accounts.

    i believe you can even get away with just wp core download and then browse to the site to continue the install process and provide db details etc, but i never bother with that, i do it all from the cli.
     
    Antonio Sanguigni likes this.
  11. showe1966

    showe1966 Member

  12. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    do not follow that guide unless you want your site hacked within minutes, those file / folder permissions are way off.

    just create the subdirectory. and create the new database and db user (on the same site in ispconfig)
    install wordpress directly into the subdirectory as normal.

    edit the .htaccess file in the subdirectory afterwards.
    most of it will already exist, just make sure the rewritebase and rewriterule point to the subdirectory.
    Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /your-subdirectory/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /your-subdirectory/index.php [L]
    </IfModule>
    
    # END WordPress
    
     
    ledufakademy likes this.
  13. showe1966

    showe1966 Member

    Thanks for your reply. The real issue I have here is that i want everything on my machine to be easily updatable at the click of a button using the apt-get update command. So, I ideally, I want to install wordpress via the apt-get package. This installs wordpress in the directory /usr/share/wordpress.
    What I really need to do is to be able to create a link in my website under ispconfig which points to /usr/share/wordpress. Then, I will end up with the wordpress website in a sub-directory of my existing website, but then, it will also be updatable via apt-get. I have tried this , but ISPCONFIG does not allow me to follow the link. Any suggestions ?
    I was thinking of doing 2 installs. One i install with APT. Then I look at the directory structure and permissions. After, I manually install a second wordpress via ISPCONFIG. Then, I look at the location of those files and the permissions and work out how to map the one set of files onto the other one.
    I don't know much about wordpress, but I do know that it runs using the PHP in your apache 2 installation.
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    WordPress updates itself online, even automatically if you like, installing it via apt makes no sense in my opinion. What you try to do with using WP in a central location is insecure and that's why ISPConfig rejects it.

    Follow the instructions from @nhybgtvfr as that's the way that admins that know WordPress well will install it securely.
     
    Last edited: Jan 13, 2022
  15. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    don't bother with apt-get for wordpress.
    especially if you're going to have multiple wordpress sites under different user/client accounts, a central wordpress with symlinks from the client webfolder will be a nightmare. possibly with wp multisite and no client vhosts, but i'd still expect issues.

    if its just a private server, with a few of your own sites, you might get away with it, as soon as clients get involved, or you need more than just a couple of sites, it'll become a mess.

    they'll be plugin incompatibilities, some plugins/ themes won't work without the latest wp release, php etc, some plugins / themes won't work with the latest versions yet, some won't ever work with the latest wp / php.

    plus the wordpress version you update to using apt-get will always be way behind the actual latest wp release, and it won't apply plugin or theme updates anyway.

    just install wordpress manually. or via softaculous or similar. you can configure wordpress to update itself and all plugins / themes automatically (i personally don't like this, i don't like any software getting updated at completely random times with no warning)
    or just update everything from the wordpress backend, it's still only a few mouse clicks. or install wp-cli and write a little update script, then you can schedule regular, fixed update times via cron. or use a multi wordpress management system like managewp or infinitewp
     
    Last edited: Jan 13, 2022
  16. showe1966

    showe1966 Member

    I created a terminal user for my website, I logged in as that user, and then copied the wordpress that I wgetted into a sub directory of my website. However, the installer doesn't work. I get a 404 error except if I visit the "static" readme.html page, which I can see. If I just type in the web address of the new directory, I get a white screen, which I suppose is the famous "white screen of death". Where do I find the wordpress error log to diagnose problems ? How do i turn on error logging ? FYI, I checked that I had php enabled in my website settings.
     
  17. showe1966

    showe1966 Member

    I don't think I mentioned I am running Ubuntu 20.04 lts
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    Double check that you enabled PHP in the website settings, PHP mode should be php-fpm for WordPress and the suexec checkbox must be enabled.

    In the log folder of the website. /var/www/yourdomain.tld/log/error.log

    Errors are always logged, no need to turn something on.
     
  19. Gordon Fielden

    Gordon Fielden New Member


    Has there been any progress on getting ispconfigs own installer yet
     
  20. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    No, none that I am aware of.
     
    Th0m likes this.

Share This Page