-
Notifications
You must be signed in to change notification settings - Fork 0
Installing
Costanza uses Vue and the Laravel PHP framework. Its requirements therefore mirror those of Laravel 5.8.
- SQLite
- Composer
- PHP > 7.1.3 with the following extensions (hopefully most of these are included in your default PHP install)
- OpenSSL
- PDO
- Mbstring
- Tokenizer
- XML
- Ctype
- JSON
- BCMath
- Vue 2.6
- Apache 2.4+
- Costanza may run under another web server, like nginx, but it has only been tested with Apache
Costanza (like many other applications written using PHP frameworks such as Laravel or Symfony) contains a lot of code that should not be accessible via the browser. DO NOT checkout the Costanza code into the document root (or any other web accessible folder) of your web server.
On many web servers, the default folder for web content is /var/www/html. The following installation instructions
assume will assume that, and may need to be adjusted depending on your server setup.
-
Costanza requires the
usask-library/ezproxy-stanzasrepository. You may clone that repository locally to improve speed (especially during the export process) but you will need to keep it up to date by runninggit pullwhen stanzas are updated. Alternatively, Costanza can fetch stanza information from theezproxy-stanzasrepository in real time. This ensures it always has the latest versions of the EZproxy stanzas, but with a slight reduction in speed. Whichever method you choose, be sure to set theGITHUB_STANZASandSTANZA_PATHsettings appropriately as mentioned in the Configuration File and Application Key section below.To check out the
ezproxy-stanzasrepo locally:# cd /var/www git clone https://github.com/usask-library/ezproxy-stanzas.git -
Check out the Costanza code
# cd /var/www git clone https://github.com/usask-library/costanza.git
Install the Laravel and Vue dependencies:
cd /var/www/costanza
composer install
npm installCostanza uses SQLite to store user account information. The initial database creation can be done by simply creating an empty file with the correct name. The database itself initialized later.
touch database/database.sqliteLaravel requires the SQLite database and the directories storage and bootstrap/cache be writable
by the web server user. Again, assuming your web server is Apache, directory permissions can be
adjusted with the following commands:
sudo chgrp -R apache storage bootstrap/cache database/database.sqlite
sudo chmod -R g+w storage bootstrap/cache database/database.sqlite A sample configuration file is shipped with Costanza. Before Costanza can be used, a copy of that config file needs to be made, and new application keys generated.
cp .env.example .env
php artisan key:generate
php artisan jwt:secret
php artisan migrate
Some further changes to the .env file are needed.
-
APP_URLneeds to be set to the URL from which you will be serving Costanza --https://costanza.example.com/orhttps://example.com/costanza/for example -
MIX_APP_PATHshould match the path portion of the aboveAPP_URL--/or/costanza/for example -
STANZA_PATHshould point to the location where you checked out theezproxy-stanzasrepo. If you followed the documentation exactly, this will be/var/www/ezproxy-stanzas -
GITHUB_STANZASshould be set tofalseif you elected to clone theezproxy-stanzasrepository locally, ortrueif you wish to have Costanza fetch stanza information data from the GitHub repository in real time - The
MAIL_*entries may need to be adjusted, depending on the mail configuration of your server
⚠️ The GitHub API limits unauthenticated requests to 60 per hour, which may not be enough to successfully use GitHub as a backend datastore in a production environment. It is recommended therefore that you also supply values forGITHUB_USERNAMEandGITHUB_PASSWORD. This will allow Costanza to make authenticated requests to the GitHub API, which have a much higher request limit.
Run the following to generate production ready Vue code for Costanza. Note, this must be done after creating
and modifying the .env file in the above step.
npm run productionThe last step is to configure Apache. The only web accessible folder should be the public folder.
If you are serving Costanza from the root of your web server (something like https://costanza.example.com/ for example),
you can update the DocumentRoot directive in your Apache config, changing it to /var/www/costanza/public.
Don't forget to update the corresponfing Directory directive as well.
If you are serving Costanza from a sub-folder of your web server (https://example.com/costanza/ for example) add something similar to the following to your Apache config:
Alias /costanza /var/www/costanza/public
<Directory /var/www/costanza/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
You will probably need to restart Apache after making this change.