Page 1 of 1

Vhost to Subdirectory

Posted: Mon Apr 14, 2014 2:06 pm
by SimonErich
Hi guys,

I just installed Vesta CP and I have a question.
How do I set the root domain dir to another folder than public_html.

In my case I use laravel, which will be uploaded in public_html, but for security reasons the framework takes the "public_html/public" dir as the entry point.
So how do I get Vesta CP my domain domain.com to lookup public_html/public/index.php instead of public_html/index.php.

thanks

best regards
Simon

Re: Vhost to Subdirectory

Posted: Tue Apr 22, 2014 3:19 pm
by SimonErich
Sorry to push this thread, but is it seriously not possible to show the vhost to a subdirectory?
I thought everyone here would probably laugh at me, because I just missed something, and then push me in the right direction, but if this is the only reason why I can't use VestaCP, that I like apart from that, that seems absurd.

Has anyone an idea how I could do a hack to get this to work?
I would like to avoid changing the Control Panel for a reason like this.

Thank you
best regards
Simon

Re: Vhost to Subdirectory

Posted: Thu May 01, 2014 12:36 pm
by Graham
I'm trying to work this out myself.

I think the answer lies in the .conf files for your hosting account:

/home/username/conf/web

in the apache2.conf file you'll see a section like this:

Code: Select all

<Directory /home/admin/web/yourdomain.com/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
</Directory>
Try changing that to

Code: Select all

<Directory /home/admin/web/yourdomain.com/public_html/public>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
</Directory>
You may need to restart apache after you've made the change.

Let me know if that works, I haven't got around to trying it myself yet.

Re: Vhost to Subdirectory

Posted: Thu May 01, 2014 12:38 pm
by Graham
I just spotted there's also a reference to the web root in nginx.conf in the same directory:

Code: Select all

    location / {
        proxy_pass      http://95.85.56.225:8080;
        location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|css|zip|tgz|gz|rar|bz2|exe|pdf|doc|xls|ppt|txt|odt|ods|odp|odf|tar|bmp|rtf|js|mp3|avi|mpeg|flv|htm$
        root           /home/admin/web/lima.trypress.com/public_html;
You might need to change that too.

Re: Vhost to Subdirectory

Posted: Mon Oct 13, 2014 3:27 pm
by kandalf
Your solution works but I think we should have an option to change the webroot on vesta panel, without need to edit the files directly.

For exampel in my case I change directly the files nginx.conf and httpd.conf then a few months later I rebuild the user account by mistake and lose all my configs.

Re: Vhost to Subdirectory

Posted: Wed Dec 03, 2014 1:49 am
by sauvegardezvous99
in my case, I also need to change :

in httpd.conf

Code: Select all

DocumentRoot /home/admin/web/yourdomain.com/public_html/public