Getting started with a blank PHP site

#1
I've been trying to convert to OLS from Apache and I think it's safe to say that I need a little help to get started. From the top: I have a machine running HyperVisor. One VM is running Ubuntu 18.04 (bionic). That VM has OLS and PHP 7.2 installed. The pre-installed example worked and I have access to the admin control panel. I have changed to listener ports, so that I'm using 80 and 443 for the regular requests and 8080 for the admin page.

What I would like to do is to use /var/www as the root directory for my webserver. When I punch in the domain that points to the VM, I want it to show the files in /var/www, which would preferrably be an index.php file.

My problem is that no matter what I do, I keep getting the 404 page from OLS.

I've added one virtual host.

Basic:

Virtual Host Name: my domain
Virtual Host Root: $SERVER_ROOT/conf/vhosts/$VH_NAME/
Config File: $SERVER_ROOT/conf/vhosts/$VH_NAME/vhconf.conf
Restrained: No
External App Set UID Mode: Server UID
suEXEC User: Not set
suEXEC Group: Not set

General:

Document Root: /var/www/
Domain Name: my domain
Enable compression: Yes

External App:

LiteSpeed SAPI App:
Name: lsphp
Address: uds://tmp/lshttpd/lsphp.sock
Environment: PHP_LSAPI_CHILDREN=35
Command: /usr/bin/php
Run As User: kiwhen
Run As Group: Not set

Script Handler:

php - LiteSpeed SAPI - lsphp

Context:

Static:
URI: /
Location: $DOC_ROOT/
Accessible: Yes
Rewrite Rules: RewriteFile .htaccess

For the Server Configuration I've got this:
Server Name: www
Number of Workers: 1
Running As: nobody : nogroup
Index Files: index.html, index.php

External App and Script Handler set up the same way as the VH.

I have tried some different settings. For example, I have created a group called www and put kiwhen (myself) and nobody into it. I then set ownership of /var/www to kiwhen:www. I've set ownership to nobody:nogroup and kiwhen:kiwhen. I've added nobody into the kiwhen group. I tried to set google.com as the custom 404 document, but it still only displays the built-in 404 (even that doesn't work! why?).

I also know that OLS can see the directory, because I initially got an error on the Rewrite File-directive. If I remove my .htaccess, I get an error saying that the file /var/www/.htaccess does not exist, so that means the path is correct and it is able to read the contents.

I can't recall ever getting asked what user OLS should run as, but ps tells me that the worker does indeed run as nobody.

Any hints? I've tried to look for a super basic getting-started-guide that doesn't contain any overhead (like "how to install wordpress" and whatnot), but I've had no luck.
 
Top