-
Notifications
You must be signed in to change notification settings - Fork 13
Installing on RHEL 8
If you haven't already, you are going to need to install the following:
sudo yum install python3 python3-devel git gcc gdb libtiff-devel libjpeg-turbo-devel freetype-devel lcms2-devel libwebp-devel mysql-devel
If you're reading this outside of Github, you can skip this.
git clone https://github.com/WPI-LNL/lnldb.git
cd lnldb
We will make a virtualenv to keep all of these packages away from the system Python installation (ie. don't need root), and install our packages directly to the env
folder.
python3 -m venv env
source env/bin/activate
pip install -r requirements_userweb.txt
Make sure the ~/lnldb/lnldb/settings.py file's ALLOWED_HOSTS
variable contains the ip address and/or hostname of your system. This can be added in the .env file if desired.
The first line makes/loads the actual database schema, by walking through all of the previous schemas and making necessary changes to the database one-by-one so that no data is ever lost regardless of versions. In your debug environment, the database will by default be an Sqlite file in the runtime folder, but in production it's WPI's hosted MySQL server.
The second line will create a superuser account to let you log in once you've started the server.
python3 manage.py migrate
python3 manage.py createsuperuser
Note: If you will be using an existing database, do not load any fixtures as defined in the README.
This app includes a number of self-checks to sanity test new code. All new patches are expected to have tests included, and will be checked automatically when pushed to Github. Also try using the '-n' flag to speed it up.
python3 manage.py test
python3 manage.py runserver
or python3 manage.py shell_plus
Note that in future sessions, you must first call source env/bin/activate
to set up the local path. We recommend adding this to your .bashrc
file.
You can follow this guide to install Passenger on RHEL 8. Note the following:
- If you run into issues installing EPEL, make sure the specific RHEL 8 release you are using is compatible (LVM in Azure Cloud is not!)
- At time of writing, repo
rhel-8-server-optional-rpms
does not exist, you can skip enabling it
Apache should be installed automatically. Create a new virtual host in the httpd.conf file (or other as applicable).
<VirtualHost *:80>
ServerName lnl.example.com
# Be sure to point to 'public'!
DocumentRoot /home/lnl/public_html
PassengerAppRoot /home/lnl/lnldb
PassengerAppType wsgi
PassengerStartupFile passenger_wsgi.py
<Directory /home/lnl/public_html>
# Relax Apache security settings
AllowOverride all
Require all granted
# MultiViews must be turned off
Options -MultiViews
</Directory>
</VirtualHost>
Make sure all directories allow the webserver to read and potentially execute files where applicable.