@@ -109,45 +109,75 @@ This section builds all of the UI code using webpack and fires up a browser wind
1091094 . You should get a "Login to WeBWorK" screen. You can use the Lisa Simpson account with the username ` lisa ` and the
110110 password ` lisa ` .
111111
112- ### Production build and deployment (instructions for apache2 on Ubuntu2 )
112+ ### Production build and deployment (instructions for apache2 on Ubuntu )
113113
114114TODO: add instructions for other servers and operating systems and add a docker deployment approach
115115
116- 1 . Inside the ` webwork3 ` directory, execute ` yarn install ` or ` npm install ` .
117-
118- 2 . Build the client side user interface with ` quasar build ` .
119-
120- 3 . Copy ` webwork3/dist/spa ` to ` /var/www/html/webwork3 ` (or create a link).
121-
122- 4 . Add the following lines to your apache2 site configuration file:
123-
124- ``` apacheconf
125- # Vue Router configuration for webwork3
126- <IfModule mod_rewrite.c>
127- <Directory "/var/www/html/webwork3">
128- RewriteEngine On
129- RewriteBase /webwork3/
130- RewriteRule ^webwork3/index\.html$ - [L]
131- RewriteCond %{REQUEST_FILENAME} !-f
132- RewriteCond %{REQUEST_FILENAME} !-d
133- RewriteRule . /webwork3/index.html [L]
134- </Directory>
135- </IfModule>
136- # Mojolicious configuration for webwork3
137- <Proxy /webwork3/api/*>
138- Require all granted
139- </Proxy>
140- ProxyRequests Off
141- ProxyPreserveHost On
142- ProxyPass /webwork3/api http://localhost:8080/webwork3/api keepalive=On
143- ProxyPassReverse /webwork3/api http://localhost:8080/webwork3/api
144- ProxyPass /webwork3/api/* http://localhost:8080/webwork3/api/ keepalive=On
145- ProxyPassReverse /webwork3/api/* http://localhost:8080/webwork3/api/
146- RequestHeader set X-Forwarded-Proto "http"
116+ 1 . Install node version 16 with the following.
117+
118+ ``` sh
119+ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
120+ sudo apt install nodejs
121+ ```
122+
123+ 2 . Inside the ` webwork3 ` directory, execute ` yarn install ` or ` npm install ` .
124+
125+ 3 . Build the client side user interface with ` quasar build ` or ` npm run build ` .
126+
127+ 4 . Copy ` webwork3/dist/spa ` to ` /var/www/html/webwork3 ` (or create a link).
128+
129+ 5 . Enable the necessary apache2 modules.
130+
131+ ``` sh
132+ sudo a2enmod headers proxy proxy_http rewrite
133+ ```
134+
135+ 6 . Copy ` conf/apache2/webwork3-apache2.dist.conf ` to ` conf/apache2/webwork3-apache2.conf ` , and create a link to that
136+ file in ` /etc/apache2/conf-enabled ` . This can be accomplished by executing the following commands from the webwork3
137+ directory.
138+
139+ ``` sh
140+ cp conf/apache2/webwork3-apache2.dist.conf conf/apache2/webwork3-apache2.conf
141+ sudo ln -s $( pwd) /conf/apache2/webwork3-apache2.conf /etc/apache2/conf-enabled
142+ ```
143+
144+ 7 . Restart apache2 with ` sudo systemctl restart apache2 ` .
145+
146+ 8 . Set up permissions for the api with the following commands executed from the webwork3 directory.
147+
148+ ``` sh
149+ sudo chown -R youruser:www-data logs
150+ sudo chmod g+rw logs/*
151+ ```
152+
153+ 9 . Copy ` conf/apache2/webwork3.dist.service ` to ` conf/apache2/webwork3.service ` and modify ` WorkingDirectory ` with the
154+ correct path to the webwork3 location. Make sure to uncomment the hypnotoad ` pid_file ` setting in the ` webwork3.yml `
155+ file. Then enable and start the webwork3 api service by executing the following from within the ` webwork3 `
156+ directory.
157+
158+ ``` sh
159+ sudo systemctl enable $( pwd) /conf/apache2/webwork3.service
160+ sudo systemctl start webwork3
147161```
148162
149- 4 . Restart apache2 with ` sudo systemctl restart apache2 ` (or the appropriate command for your system).
163+ 10 . Set up permissions for the renderer with the following commands executed from the renderer directory.
164+
165+ ``` sh
166+ sudo chown -R youruser:www-data logs
167+ sudo chmod g+rw logs/standalone_results.log
168+ sudo chmod -R g+rw lib/WeBWorK/tmp/* lib/WeBWorK/htdocs/tmp/*
169+ ```
170+
171+ 11 . Copy ` conf/apache2/renderer.dist.service ` to ` conf/apache2/renderer.service ` and modify ` WorkingDirectory ` in the
172+ copied file with the correct path to the webwork3 location. Add ` pid_file => '/var/run/webwork3/renderer.pid' ` and
173+ ` proxy => 1 ` to the hypnotoad configuration in the ` render_app.conf ` file. Then enable and start the renderer
174+ service by executing the following from within the ` webwork3 ` directory.
175+
176+ ``` sh
177+ sudo systemctl enable $( pwd) /conf/apache2/renderer.service
178+ sudo systemctl start renderer
179+ ```
150180
151- 5 . Run ` hypnotoad bin/webwork3 ` from within the ` webwork3 ` directory .
181+ Note that anytime the server is rebooted the webwork3 api and renderer services will be automatically started .
152182
153- 6 . Visit ` localhost/webwork3 ` .
183+ 12 . Visit ` localhost/webwork3 ` .
0 commit comments