Installing Astra

Installing Astra on a custom PHP application - Manual Installation

867 views April 29, 2019 June 12, 2019 admin 1

To secure your PHP application with Astra, you can perform a ‘manual’ installation by following these steps:

    1. Login to the Astra Dashboard and navigate to the ‘Settings’ tab of your website
    2. Click on ‘Re-install Astra’ and in the next screen select ‘PHP’ as your CMS
    3. Login to your web server via FTP or cPanel
    4. Upload the Astra ZIP (secure-*.zip) to the website root (public_html folder)
    5. If you are using a VPS/Dedicated server, make sure the ‘astra’ folder you just extracted is owned by the web server user. The ssh command to do this is: sudo chown -R www-data:www-data astra
    6. Unzip the file so that <your-domain.com>/astra/api.php is accessible in the web browser
    7. Depending on your server configuration, set the ‘auto_prepend_file’ rule in the PHP configuration after correcting the path:
      .user.ini
      auto_prepend_file=/change/this/to/correct/absolute/path/to/astra/astra-inc.php
      OR
      php.ini
      auto_prepend_file=/change/this/to/correct/absolute/path/to/astra/astra-inc.php
      OR
      .htaccess
      php_value auto_prepend_file /change/this/to/correct/absolute/path/to/astra/astra-inc.php
    8. If you’re using an Nginx server, the above methods may not work. Instead, you can modify the nginx configuration as shown below:
      location ~ \.php$ {
              fastcgi_param  PHP_VALUE   "auto_prepend_file=/change/this/to/correct/absolute/path/to/astra/astra-inc.php";
          }
    9. If you’re using a VPS, you may have to restart Apache/Nginx for the settings to take effect
    10. Confirm that the auto_prepend_file rule is working by checking the output of phpinfo() (Learn how to create a phpinfo file)

Was this helpful?