Difference between revisions of "Create WeBWorK Amazon Machine Image (AMI) File"
(Created page with "===Instructions for creating a WeBWorK Amazon Machine Image (AMI) === Build the server on VMWare Workstation Player # 12 GBk disk (single file) # 4 GB memory # 2 cpu The...") |
|||
(11 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
+ | Log into EC2 Dashboard |
||
+ | Locate the current Ubuntu LTS AMI in http://cloud-images.ubuntu.com/locator/ec2/ and search us-east-2 and click on link |
||
− | Build the server on VMWare Workstation Player |
||
+ | Choose an Instance Type e.g. T4g small or T3a small |
||
− | # 12 GBk disk (single file) |
||
+ | ADD Storage |
||
− | # 4 GB memory |
||
− | # 2 cpu |
||
− | The above resources are small. |
||
+ | 20 GM storage |
||
− | # Download the ubuntu live CD (server version) |
||
− | # Install following the standard directions with the following options |
||
− | # Don't partition disks separately |
||
+ | Launch |
||
− | # User name: wwadmin |
||
− | # login: wwadmin |
||
− | # password: wwadmin |
||
− | # Computer name: wwserver |
||
+ | Follow direction in |
||
+ | https://webwork.maa.org/wiki/WeBWorK_2.17_Ubuntu_Server_22.04_LTS_Amazon_Machine_Image |
||
+ | about adding security groups, etc |
||
+ | Security groups have to be setup from the AMS dashboard |
||
− | ====Workstation Player==== |
||
+ | add the wwadmin user |
||
− | When you see REBOOT, reboot and login (wwadmin/wwadmin) |
||
− | Do not accept any updates (save disk space) |
||
+ | sudo adduser wwadmin |
||
− | Check if tools are installed |
||
− | vmware-toolbox-cmd -v |
||
− | (they should be) and if so, remove them |
||
− | |||
− | sudo apt remove open-vm-tools |
||
− | sudo apt autoremove |
||
+ | Install WW following |
||
+ | # [[Installation_Manual_for_2.17_on_Ubuntu]] |
||
+ | and |
||
+ | # [[Create WeBWorK Virtual Machine (.OVA) File]] |
||
− | After system boots check that openssh-server is installed |
||
+ | Before configuring WeBWork, set the server time zone |
||
− | run |
||
− | sudo lsof -i -P -n | grep LISTEN |
||
− | to check if it is listening on port 22 |
||
− | If not install openssh-server |
||
− | sudo apt install openssh-server |
||
− | Find the ip address of your guest |
||
+ | sudo timedatectl set-timezone America/New_York |
||
− | The Guest IP is the IP address your guest WeBWorK server is using. You can find it (after you login) by entering the command |
||
− | $ ip address show |
||
− | and looking at the output, something like |
||
− | link/ether 00:0c:29:4f:2c:1d brd ff:ff:ff:ff:ff:ff |
||
− | inet 192.168.204.128/24 brd 192.168.204.255 scope global dynamic ens33 |
||
− | ====Login from Terminal program==== |
||
+ | Configure WeBWorK, set URL to ip address in site.conf. Use Google domains to forward aws.apizer.org to ip address for testing. |
||
− | At this point you can login to your server from your host machine using SSH (non secure telnet and FTP are not allowed but secure SSH and SFTP are) using your favourite terminal emulator program. |
||
+ | Note using aws.apizer.org in site.conf caused errors in the Library Browser. |
||
− | E.g. set your terminal to connect to 192.168.204.128 |
||
+ | Set up HW sets with due dates, class lists, etc the same way as in current AMI's or the current virtual machine image |
||
− | You can do all of the remaining installation from a terminal emulator on your host. The advantage of doing this is that you can copy commands from these instructions (with copy from the Edit menu or ^C) and paste them into a terminal window (with paste from the Edit menu list or <Shift> <Ctrl> <V> or <Shift> <Insert> depending on your application). |
||
+ | Create the AMI see https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/tkv-create-ami-from-instance.html |
||
− | ===Follow the standard instructions=== |
||
− | ====site.conf and localoverrides.conf==== |
||
− | # use the ip address (e.g. 192.168.201.128) everywhere. Do not use localhost |
||
− | # set password for webworkWrite (wwadmin) |
||
− | |||
− | === set up MyTestCourse=== |
||
− | # add practice users and jsmith/jsmith to myTestCourse |
||
− | # add profa |
||
− | # add the standard sets to myTestCourse |
||
− | |||
− | ===Implement all options A-E === |
||
− | |||
− | |||
− | ====Clean up the system==== |
||
− | * rm apache's error.log's in /var/log/apache2/ |
||
− | * rm apache's access.log's in /var/log/apache2/ |
||
− | * rm webwork's timing.log's in /opt/webwork/webwork2/logs/ |
||
− | * Remove unneeded backup's in /opt/webwork/webwork2/conf/ |
||
− | * Remove contents of /var/www/html/wwtmp/ |
||
− | |||
− | wwadmin@wwserver:~$ du -sh /var/cache/apt/archives/ |
||
− | du: cannot read directory '/var/cache/apt/archives/partial': Permission denied |
||
− | 71M /var/cache/apt/archives/ |
||
− | wwadmin@wwserver:~$ sudo apt clean |
||
− | [sudo] password for wwadmin: |
||
− | wwadmin@wwserver:~$ du -sh /var/cache/apt/archives/ |
||
− | du: cannot read directory '/var/cache/apt/archives/partial': Permission denied |
||
− | 44K /var/cache/apt/archives/ |
||
− | |||
− | |||
− | sudo apt autoremove --purge |
||
− | |||
− | ====Remove openssh-server==== |
||
− | Keeeo openssh |
||
− | |||
− | sudo apt remove openssh-sftp-server |
||
− | sudo apt autoremove |
||
− | |||
− | ====Reset CPU's amd Memory==== |
||
− | Set the memory to 4 GB and processors to 2 |
||
− | |||
− | ===Export to an .ova file=== |
||
− | |||
− | ====Workstation Player==== |
||
− | Find the path to your VM. |
||
− | |||
− | Open a command prompt as administrator |
||
− | |||
− | cd E:\Programs\VMware\OVFTool\ |
||
− | |||
− | Enter |
||
− | ovftool “C:\the path to your VM\your VMname.vmx” c:\new directory\name.ova |
||
− | |||
[[Category:Developers]] |
[[Category:Developers]] |
Revision as of 14:58, 5 September 2023
Instructions for creating a WeBWorK Amazon Machine Image (AMI)
Log into EC2 Dashboard
Locate the current Ubuntu LTS AMI in http://cloud-images.ubuntu.com/locator/ec2/ and search us-east-2 and click on link
Choose an Instance Type e.g. T4g small or T3a small
ADD Storage
20 GM storage
Launch
Follow direction in https://webwork.maa.org/wiki/WeBWorK_2.17_Ubuntu_Server_22.04_LTS_Amazon_Machine_Image about adding security groups, etc
Security groups have to be setup from the AMS dashboard
add the wwadmin user
sudo adduser wwadmin
Install WW following
and
Before configuring WeBWork, set the server time zone
sudo timedatectl set-timezone America/New_York
Configure WeBWorK, set URL to ip address in site.conf. Use Google domains to forward aws.apizer.org to ip address for testing. Note using aws.apizer.org in site.conf caused errors in the Library Browser.
Set up HW sets with due dates, class lists, etc the same way as in current AMI's or the current virtual machine image
Create the AMI see https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/tkv-create-ami-from-instance.html