Hello everybody!
I am quite new to Open LiteSpeed and as such am a bit struggling. So far I made perfect chroot environment for SSH users on CentOS 7, I am on my way of automating vhost/listener creation, however, I am struggling with ExtApps and the way they properly function.
What I have is a simple /home/user directory which is just a mount --bind of /var/jail/user/home directory.
There is a /home/user/public_html/index.php file with the following code:
Basically the code should list the root directory, get the current working directory and user it's been running from. Fortunately, it's working fine, listing the server root directory, getting the correct current directory /home/user/public_html and displaying the correct user: user. The issue is it's displaying the server root directory and not the virtual host directory.
I am a bit lost and am afraid I am unaware how to correct this one thus I would highly appreciate it if somebody would be able to help me. Basically, within the OLS panel, under Virtual Hosts -> my vhost -> Basic ->
shell_exec('ls /') to list: /home/user instead of just: /
Thank you in advance!
I am quite new to Open LiteSpeed and as such am a bit struggling. So far I made perfect chroot environment for SSH users on CentOS 7, I am on my way of automating vhost/listener creation, however, I am struggling with ExtApps and the way they properly function.
What I have is a simple /home/user directory which is just a mount --bind of /var/jail/user/home directory.
There is a /home/user/public_html/index.php file with the following code:
<?php
$output = shell_exec('ls -la / && pwd');
echo "<pre>$output</pre>";
echo get_current_user ();
?>
$output = shell_exec('ls -la / && pwd');
echo "<pre>$output</pre>";
echo get_current_user ();
?>
Basically the code should list the root directory, get the current working directory and user it's been running from. Fortunately, it's working fine, listing the server root directory, getting the correct current directory /home/user/public_html and displaying the correct user: user. The issue is it's displaying the server root directory and not the virtual host directory.
I am a bit lost and am afraid I am unaware how to correct this one thus I would highly appreciate it if somebody would be able to help me. Basically, within the OLS panel, under Virtual Hosts -> my vhost -> Basic ->
ExtApp Set UID Mode = DocRoot UID
Restrained = Yes
Enable Scripts/ExtApps = Yes
Virtual Host Root = /home/user/
Restrained = Yes
Enable Scripts/ExtApps = Yes
Virtual Host Root = /home/user/
General -> Document Root = $VH_ROOT/public_html
I am using the standard PHP_SuExec Template and default lsphp External App, which appears to be a VHost ExtApp. Hopefully I have included as much information as need, if anything else is needed please let me know. I will be happy provide with further information, all I want is when I run:
shell_exec('ls /') to list: /home/user instead of just: /
Thank you in advance!