Static websites and PHP #
For general devweb documentation, see the main devweb page.
To setup a static or PHP-based site, copy your content into ~/DEVWEB/2022/. It'll then be immediately accessible at https://devweb2022.cis.strath.ac.uk/~USERNAME.
The web server expects to find an index.html, index.htm or index.php file at the site root. If you'd like more information about the current PHP version, you can create a file with the following contents (e.g. called ~/DEVWEB/2022/info.php):
<?php phpinfo(); ?>
and access it in your browser to see configuration information for your PHP container.
You can run classic-mode CGI scripts by copying them into your ~/DEVWEB/2022/ folder, making sure they have a
.cgi extension and making them executable (e.g.
chmod +x myscript.cgi).
Many languages and frameworks (including Perl, Ruby and C) support running web apps in CGI mode (although performance will be poorer than running as an app server).
Setting the base URL #
For Angular apps, you can do this by passing the --base-href- parameter to ng build, e.g.
ng build --base-href '~/abc12345/myproject' (assuming your deploying your application to the subdirectory myproject within your ~/DEVWEB/2022 directory). See the Angular docs for more information.
For React apps, how you achieve this depends on how you initially create your app. If you're using the Create React App tool, you need to add the homepage configuration value to your package.json file, e.g.:
See the Create React App docs for more information.
For Vue (vuejs) you need to set the publicPath config as per the Vue docs.