Home directory

Hello,

I wondering if I can organize better the public_html directory. I will explain...

I would like the main domain.tld to look into a custom folder different for each domain like "public_html/custom_folder". I know this is easy to do by creating a folder under public_html but after that to access the site you must enter domain.tld/custom_folder. I would like to enter the domain.tld and access the site that it will be on "custom_folder". Is it possible?

Status: 
Active

Comments

Howdy -- hmm, I'm not entirely sure I understand what you're looking to do.

However, I can offer that public_html is always the default directory for websites.

And for any Sub-Server, it will always use place those in /home/USERNAME/domains/DOMAIN-NAME/public_html.

However, once a domain is created, if you wish to change the DocumentRoot being used, you can change it by going into Server Configuration -> Website Options, and there, you can set "Website documents sub-directory".

By default, it's set to "public_html". But you can change it to use a directory under public_html if you wish.. for example, you could change it to "public_html/custom_folder".

itwebservices's picture
Submitted by itwebservices on Mon, 04/11/2016 - 13:59

There is a problem changing the Document root directory to "public_html/custom_folder".

The problem is that the website is working but the other services such as phpmyadmin, owncloud, webmain doesn't function.

Let me explain what exactly I would like.

I would like the /public_html to be like the following structure

/custom_folder = website
/webmail = Roundcube webmail
/owncloud = owncloud
/phpmyadmin = phpmyadmin

So, I would like all services to run outside the custom_folder but under the public_html. Is it possible?

Hmm, there unfortunately isn't really a way to do that.

You could use public_html as the main DocumentRoot, and then use sub-directories such as webmail for storing applications like RoundCube.

But there isn't really a way to do what you're requesting.

However, you could always create multiple Sub-Servers.

You could create a phpmyadmin.domain.com, owncloud.domain.com, and webmail.domain.com, all with their own separate home directories.

But there isn't really a way to use the a directory structure like you described above, sorry!

itwebservices's picture
Submitted by itwebservices on Sun, 04/17/2016 - 14:56

I don't like to be all directories and files into public_HTML. There are website and all custom script folders all together.

You tell me that I can't seperate them. May I make them "protected directories" in order not to be able to delete them?

If yes, I would like this option to be when I create the virtual server or the subserver. Is it possible?

Unfortunately, the files and folders within public_html are all designed so that they can be managed and deleted by the Virtual Server owner.

There isn't really a way to prevent that.

My best suggestion would be to place the code you have into different sub-domains, such as phpmyadmin.domain.com.

Or, rather than placing the code into each Virtual Server, to have one central installation.

For example, if you created "phpmyadmin.mywebfiles.gr", all users on your server could access that one installation in order to manage their own databases.

itwebservices's picture
Submitted by itwebservices on Mon, 04/18/2016 - 13:51

Good ideas but

1) How can I set in the Server Templates to be installed by default when I create a virtual server the script installations? For example, how can I set the path in the script installer to install it as a subdomain?

2) yes this already works --For example, if you created "phpmyadmin.mywebfiles.gr", all users on your server could access that one installation in order to manage their own databases--

There unfortunately isn't a way to set that up automatically using the Virtualmin GUI.

It could be done manually each time a domain is created.

Or, there is another way, but it is very complicated and involves custom programming. It could be done if you were to create a custom script, and program it to do that. You can configure Virtualmin to run a script each time a domain is created. It would take a bit of coding to do that, but it would be possible if you or someone on your team has programming experience.

You can configure Virtualmin to run a script when creating a domain in System Settings -> Virtualmin Config -> Actions upon server and user creation.

Personally, I usually recommend just setting up one central location for RoundCube, phpMyAdmin, and so on, rather than having multiple installations. Then, you can personally make sure they work, you can setup SSL for them, and overall ensure that they are working properly.

itwebservices's picture
Submitted by itwebservices on Mon, 04/18/2016 - 14:20

in the server template (Default script installers) I can set the scripts to be installed automatically but into a path. In this section is there any way to install it in subdomain instead of path?

Sorry, there isn't a way to automatically create a sub-domain and install a script there. It can only be installed into the current domain being created.