Vhost to Subdirectory
-
- Posts: 3
- Joined: Mon Apr 14, 2014 1:30 pm
Vhost to Subdirectory
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
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
-
- Posts: 3
- Joined: Mon Apr 14, 2014 1:30 pm
Re: Vhost to Subdirectory
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
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
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:
Try changing that to
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.
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>
Code: Select all
<Directory /home/admin/web/yourdomain.com/public_html/public>
AllowOverride All
Options +Includes -Indexes +ExecCGI
</Directory>
Let me know if that works, I haven't got around to trying it myself yet.
Re: Vhost to Subdirectory
I just spotted there's also a reference to the web root in nginx.conf in the same directory:
You might need to change that too.
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;
Re: Vhost to Subdirectory
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.
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.
-
- Posts: 25
- Joined: Mon Nov 24, 2014 11:48 pm
Re: Vhost to Subdirectory
in my case, I also need to change :
in httpd.conf
in httpd.conf
Code: Select all
DocumentRoot /home/admin/web/yourdomain.com/public_html/public