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/2023/. It'll then be immediately accessible at https://devweb2023.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/2023/info.php):
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/2023/ 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/' (where abc12345 is your username, and assuming you are deploying your application to the subdirectory myproject within your ~/DEVWEB/2023 directory). Note the trailing forward slash / - it will not work without this. 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.