Problems trying to build from source using ansible role

OK - maybe there is a bug in nightly. Remove that conf file and /etc/ood/config/ood_portal.sha256sum (I pulled that name from memory so it could be wrong)

To that apache2 command.

sudo su - root
. /etc/apache2/envvars && /sbin/apache2 -S

Thanks. I forgot to mention that I saw the same error (I think more than once) during my install, but everything exited with exit code 0 so I thought it was ok.

I removed those 2 files but it did not magically add any virtual hosts. Not sure what to do now.

After you remove those, then you can bounce apache2. The systemd unit file runs /opt/ood/ood-portal-generator/sbin/update_ood_portal (also pulled from memory) which takes the /etc/ood/config/ood_portal.yml and writes the conf file.

So that’s the advantage of our deb install. You don’t have to run update_ood_portal - you can just use systemctl to bounce apache2 and the conf will get written out (and/or you’ll see errors in systemctl status)

OK, I bounced apache using systemctl and I still see the default apache home page.

apache -S does now show that virtual host though:

# apache2 -S
VirtualHost configuration:
*:80                   ip-[redacted].us-west-2.compute.internal (/etc/apache2/sites-enabled/000-default.conf:1)
*:*                    ip-[redacted].us-west-2.compute.internal (/etc/apache2/sites-enabled/ood-portal.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex lua-ivm-shm: using_defaults
Mutex proxy: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

What am I missing?
Thanks…

I added

ServerName ec2-[redacted].us-west-2.compute.amazonaws.com

to /etc/apache2/sites-available/000-default.conf and bounced apache - no change.

The way you request the page (i.e., what’s in your browser URL) matters too. Also if you continue to read those docs, you may have to set the servername and use it in the browser. Though you’re setting the servername for the OOD portal, not the default VHOST.

Really - if you don’t want that default page, you can remove that file or back it up (apache will only recognize .conf so .conf.bak will be ignored).

What I am using in the browser matches the ServerName I defined.

OK, now I am in business it seems. I moved /etc/apache2/sites-available/000-default.conf into /tmp to get it out of the way and bounced apache. Reloaded the browser and now I see the OOD start page telling me I have to configure authentication. Thanks for your help.

OK, I hate to keep coming back with questions, but I figure eventually I will know enough to ask fewer, and maybe even answer some.

I tried to set up authentication using PAM. This is just a kick-the-tires installation so I do not need anything fancier. I followed the instructions at Add PAM Authentication — Open OnDemand 2.0.20 documentation with suitable modifications given that I am Ubuntu 20.04.

One thing I notice is that the file referenced at the end of that page (/opt/ood/ood_auth_map/bin/ood_auth_map.regex) does not exist.

I did all that and restarted apache, then when I go to the page in the browser it still shows me the page saying I need to set up authentication. Note that I removed /public/need_auth.html from the URL but it still redirected me back there.

I can verify that the authnz_pam_module is installed:

# apachectl -M|grep pam
 authnz_pam_module (shared)

I looked in the apache logs and did not see anything that seemed relevant.

Sorry if this is a little vague - any idea what I could be missing?

Yes that has been removed in 2.0. The default should work just fine. Did you enable authentication through this configuration in ood_portal.yml?

auth:
  - 'AuthType Basic'
  - 'AuthName "Open OnDemand"'
  - 'AuthBasicProvider PAM'
  - 'AuthPAMService ood'
  - 'Require valid-user'

Then bounce apache. Anytime you edit the ood_portal.yml you need to bounce apache2.

Yes, I did that and bounced apache…same results.
Also ran

/opt/ood/ood-portal-generator/sbin/update_ood_portal

I guess bouncing apache runs that for me…

When you run update_ood_portal does it complain about checksums not matching? Did you edit the ood-portal.conf (the apache conf file) manually? That’s what that checksum is checking for. There’s a -f|--force option with that. Also you can wipe the conf and sha256sum files again and that may fix it.

Either way it says there is no change.

Can you share the output of the command and/or systemctl status apache2


# sudo /opt/ood/ood-portal-generator/sbin/update_ood_portal
No change in Apache config.
Completed successfully!

# systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/apache2.service.d
             └─ood-portal.conf, ood.conf
     Active: active (running) since Wed 2022-05-11 21:11:41 UTC; 16min ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 13595 ExecStartPre=/opt/ood/ood-portal-generator/sbin/update_ood_portal --rpm (code=exited, status=0/SUCCESS)
    Process: 13604 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 13608 (apache2)
      Tasks: 55 (limit: 19185)
     Memory: 5.7M
     CGroup: /system.slice/apache2.service
             ├─13608 /usr/sbin/apache2 -k start
             ├─13609 /usr/sbin/apache2 -k start
             └─13610 /usr/sbin/apache2 -k start

May 11 21:11:41 ip-172-31-25-207 systemd[1]: Starting The Apache HTTP Server...
May 11 21:11:41 ip-172-31-25-207 update_ood_portal[13595]: No change in Apache config.
May 11 21:11:41 ip-172-31-25-207 systemd[1]: Started The Apache HTTP Server.

And what’s you’re ood_portal.yml look like and/or ansible configurations. ARe you using ansible to configure or are you editing ood_portal.yml?

I am just editing ood_portal.yml and it looks like this.
ood_portal.yml (13.1 KB)

I tried to replicate but couldn’t. What does this file /etc/apache2/sites-available/ood-portal.conf look like? I wonder if you’ve cached that blank html page? Does a private window have the same behavior?

Good call, that was it. I should have figured that one out, I’ve been bitten by stale caches before.
Thanks.