amazon-web-servicesubuntu-18.04opencpu

No welcome page after openCPU install in fresh Ubuntu 18.04 instance


I am trying to install OpenCPU 2.1 on a fresh free tier AWS server. I followed

[https://aws.amazon.com/getting-started/tutorials/?awsf.getting-started-content=use-case-tmt%23websites-apps], and launched a Ubuntu Server 18.04 LTS (HVM), x86, free tier server, and obtained public and private IP's. Then I follow [https://opencpu.github.io/server-manual/opencpu-server.pdf], section 2.2

sudo apt-get update
sudo apt-get upgrade

I respond to grub prompt to keep local version installed

sudo add-apt-repository ppa:opencpu/opencpu-2.1 -y
sudo apt-get update
sudo apt-get install opencpu-server

and OK to defaults on pop-up on mailname and smarthost prompts.

The results all look OK. The last section reads:

To activate the new configuration, you need to run:
   systemctl restart apache2
Enabling opencpu in apache...
Reloading apparmor...
Restarting apache...
Installation done!
Setting up libxml-twig-perl (1:3.50-1) ...
Setting up libnet-dbus-perl (1.1.0-4build2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.13) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for ufw (0.35-5) ...

When I then try to point my browser to http(s)://your.server.com/ocpu (of course with the the IP replaced by public IP I got from AWS, and using either http:// or https://), then I get a time-out in the browser window after a minute or so.

Checking sudo systemctl status apache2.service provides

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
         └─apache2-systemd.conf
 Active: active (running) since Thu 2019-02-28 09:41:19 UTC; 1min 14s ago
Process: 30750 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
Process: 30755 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 30771 (apache2)
   Tasks: 6 (limit: 1152)
   CGroup: /system.slice/apache2.service
           ├─30771 /usr/sbin/apache2 -k start
           ├─30773 /usr/sbin/apache2 -k start
           ├─30774 /usr/sbin/apache2 -k start
           ├─30775 /usr/sbin/apache2 -k start
           ├─30776 /usr/sbin/apache2 -k start
           └─30777 /usr/sbin/apache2 -k start

Feb 28 09:41:19 ip-zzz-zz-zz-zz systemd[1]: Stopped The Apache HTTP Server.
Feb 28 09:41:19 ip-zzz-zzz-zz-zz systemd[1]: Starting The Apache HTTP Server...
Feb 28 09:41:19 ip-zzz-zzz-zz-zz systemd[1]: Started The Apache HTTP Server.

which seems OK. Also, trying a restart:

sudo a2ensite opencpu
Site opencpu already enabled

does not activate the welcome page. Is there something else that needs to be activated or set?


Solution

  • First try to connect to the server locally to test if it running. On the server run:

    curl --insecure http://localhost/ocpu/info
    

    If you get a response with some info about the server, opencpu is running and the issue is likely the amazon security group is blocking HTTP traffic. See the section below on how to enable this.

    On the other hand if the curl command above did not work (it gave a timeout erorr), there is a problem with the server and you need to check /var/log/apache2/error.log.

    Enable HTTP(S) in the amazon security group (firewall)

    If you still not connect from your browser, the issue is likely that your have not opened the http ports in your EC2 firewall (security group). To check this, open the EC2 management console in your browser and lookup the security group is associated with your EC2 instance. Then add inbound rules to this secruity group to allow port 80 and 443 from any host.

    First lookup the security group that is associated with your instance:

    screenshot1

    And then add an inbound rule to allow port 80 (HTTP) and 443 (HTTPS):

    securitygroup