Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Vhost to Subdirectory

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
SimonErich
Posts: 3
Joined: Mon Apr 14, 2014 1:30 pm

Vhost to Subdirectory
  • Quote

Post by SimonErich » Mon Apr 14, 2014 2:06 pm

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
Top

SimonErich
Posts: 3
Joined: Mon Apr 14, 2014 1:30 pm

Re: Vhost to Subdirectory
  • Quote

Post by SimonErich » Tue Apr 22, 2014 3:19 pm

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
Top

Graham
Posts: 57
Joined: Wed Sep 25, 2013 6:32 pm

Re: Vhost to Subdirectory
  • Quote

Post by Graham » Thu May 01, 2014 12:36 pm

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.
Top

Graham
Posts: 57
Joined: Wed Sep 25, 2013 6:32 pm

Re: Vhost to Subdirectory
  • Quote

Post by Graham » Thu May 01, 2014 12:38 pm

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.
Top

kandalf
Posts: 87
Joined: Tue May 13, 2014 11:53 pm

Re: Vhost to Subdirectory
  • Quote

Post by kandalf » Mon Oct 13, 2014 3:27 pm

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.
Top

sauvegardezvous99
Posts: 25
Joined: Mon Nov 24, 2014 11:48 pm

Re: Vhost to Subdirectory
  • Quote

Post by sauvegardezvous99 » Wed Dec 03, 2014 1:49 am

in my case, I also need to change :

in httpd.conf

Code: Select all

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


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password