Getting web directory for domain programmatically

software development

#1

I’d like to know if there is a way to determine programmatically what the web directory is for a domain. I know that this information is available via the panel, but I was wondering if it can be determined in a shell script.


#2

Correct me if I’m wrong, but isn’t the web directory usually just /home//?


#3

$pwd will give the current working directory in shell.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#4

No, you’re right, but the key word in your question is “usually”. By convention, when a user creates a domain, she will specify that its web directory as /home//. But she’s free to use any other path in her home directory for a domain even if it’s unrelated. For example, the web directory for “foo.example.org” could be /home//bar/baz/qux.

I’m curious to know if there is a way for a shell script look up the web directory for a domain. Using the example above, if the user were to run the script and give “foo.example.org” as an argument, could the script somehow determine the web directory is /home//bar/baz/qux?


#5

No such function is provided. You will have to make your own way for a shell script to look up the web directory for a domain.

:cool: openvein.org -//-