Thanks Ian -- your suggestion about /var/www/httpdocs helped me figure out how to use mkdir in a local website context.
chrism01 -- What I'm trying to figure out is how to use scripting (PHP) to create new users "on the fly" -- complete with user name and password and also create a new user area (restricted folder) -- for each "client" that logs into my website.
This endeavor is proving quite difficult because I have no Linux background and I'm not familiar with any of the Linux syntax or commands. Everything is a completely new learning experience. For example -- all of the code I've seen showing how to use mkdir
is from the "root" perspective /home/user
... But I wanted to use mkdir from my website perspective -- (i.e. mkdir mywebsite.com/newfolder). The difficulty I had was that I'm using a VPS server and "mywebsite" is created in a Plesk control panel -- so I could not find any way to connect the "root" directory to my Plesk website. Using Ian's suggestion I found I was able to ignore the "root" directory and just use the mkdir command in a "local" context.
The actual PHP command looks like.
/* creates folder in the current website directory*/
@exec("echo 'apache' | /usr/bin/sudo mkdir newfolder");
/* creates folder in a different website directory */
@exec("echo 'apache' | /usr/bin/sudo mkdir ../othersite.com/newfolder");
I was able to figure out how to use the Linux adduser
command -- now I need figure out how to create valid passwords for a user.... and that's proving difficult because it seems I need to (somehow) programmatically enter the password twice using the passwd
Any help about creating a user password (in a script) would be appreciated :-)