Perform an update of the package details and the package list at the start of the script. Install the apache2 package if it is not already installed. Ensure that the apache2 service is running. Ensure that the apache2 service is enabled. Create a tar archive of apache2 access logs and error logs copy the archive to the s3 bucket.