Litespeed issues with PHP SSH configuration

Milos

New Member
#1
Hello nice people,

I'm using this image: https://marketplace.digitalocean.com/apps/openlitespeed-wordpress that comes with litespeed integrated. I'm not a server guy so first of all, excuse any stupid stuff that I say :)

What I'm doing is that I setup my droplets via php, through DO API, and I want to configure litespeed the same way. On top of that, I have a somewhat specific situation with vhosts that I will explain below.

My ideal setup consist of the following.
1. Setup vhost for main doman, without ssl
2. Setup vhost for alt domain, that targets main domain directory (i can handle wordpress side and implications of this just fine)
3. When user points the domain to that droplet, update vhost for main domain with ssl info.

My problems:
1. If I configure everything and it seems to be working fine, when I connect via bash ssh this thing runs - /opt/domainsetup.sh and it screws up my config - all my domains get 404. I think it removes listeners.
2. It seems that server is not ready immediately when droplet gets up and running - /opt/domainsetup.sh and .litespeed_password are not available immediately, as far as I can see.
3. When I connect via php to ssh, domainsetup.sh does not run (i figured its because i do not connect in interactive mode (no bash?)), which makes me worried that some other stuff does not get done as well?
4. Its spotty if things will work once I do step number 3 rom the list above (when I add ssl).

I'm using official docs for all my vhost manipulation: https://docs.litespeedtech.com/cloud/images/wordpress/#how-do-i-create-additional-virtual-hosts

If anyone can shed any light on whats going on and what I might be dong wrong, that would be awesome.
 

Cold-Egg

Administrator
#2
The /opt/domainsetup.sh (the same script that you saw when login in to the server) is for a one-time setup only. Once completed, the script will be removed. Because it will set the input domain as the only value to the listener, other domains under the listener will return a 404 which is expected. To fix it manually, please insert a wildcard "*" to the listener > domain.

1. So, if you already configure everything correctly, then you can skip the prompt script setup or remove it.
2. You need to give it a minute or two before SSH in, the server needs some time to be ready.
3. Not sure what the connect via php to SSH means.

Let me know if you have any questions.
 

Milos

New Member
#3
Lets do easy ones first:
3. I use phpseclib3 to connect to ssh from php.
2/1. Is there an exact check that I can do to know if the server is ready? I boot up the droplet and wait for SSH to be available, and now on top of that I wait for the server to create /opt/domainsetup.sh before I do anything else but it's a stupid check as there might be some relevant stuff that's happening after the script is actually created. Waiting a random amount of time will not work for me as I need to be 100% sure that the server has completed initialization. Or I guess, that LiteSpeed has completed initialization.
Do you know if there is some kind of flag/file that is created after the complete initialization is done? What script is creating domainsetup.sh? Maybe through it I can get some insight on how the process actually goes?
 
Top