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 DNS Server
  • Search

[SOLVED] Virtual Host

Questions regarding the DNS Server
BIND
Locked
  • Print view
Advanced search
7 posts • Page 1 of 1
inclanfunk
Posts: 1
Joined: Mon Mar 30, 2015 10:29 pm

[SOLVED] Virtual Host

Post by inclanfunk » Mon Mar 30, 2015 10:52 pm

I successfully configure a new domain to point at my sub-domain app.mydomain.com
Now I wish to have the main root folder set to: /home/admin/web/app.mydomain.com/public_html/public
And not to: /home/admin/web/app.mydomain.com/public_html/public

I try to do so by changing the Virtual Host in the Apache2 config (/etc/apache2/sites-available/app.mydomain.com.conf) as follow:

Code: Select all

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName mydomain.com
ServerAlias app.mydomain.com
DocumentRoot /home/admin/web/app.mydomain.com/public_html/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
And run:

Code: Select all

a2ensite app.mydomain.com.conf
And finally restart Apache.

But it does not work. I suspect Vesta to override the conf file somewhere.
I am far to be a DNS specialist and I guess there is a better way to achieve what I want. Maybe by adding a record to the domain app.mydomain.com?
Any good idea is welcome. Thanks
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Virtual Host

Post by skurudo » Thu Apr 02, 2015 7:18 pm

/home/admin/conf/web/apache2.conf - here is your config for your site
/home/admin/conf/web/nginx.conf - here is config for nginx

and not there:
/etc/apache2/sites-available/app.mydomain.com.conf)
a2ensite app.mydomain.com.conf
In folder with apache2:

Code: Select all

22:20:53 [root@:~ ] $ ls /etc/apache2/sites-enabled/
000-default
22:21:06 [root@:~ ] $ ls /etc/apache2/sites-available/
default  default-ssl
Top

donkfather
Posts: 8
Joined: Fri Apr 03, 2015 10:18 pm

Re: Virtual Host

Post by donkfather » Fri Apr 03, 2015 10:22 pm

you have to go to

Code: Select all

 `/home/$USER/conf/web/apache2.conf`
or on CentOS and RHEL

Code: Select all

`/home/$USER/conf/web/apache2.conf`
edit this file foreach VirtualHost where it says

Code: Select all

DocumentRoot and the tag <Directory ;
save and after that restart apache2.
Top

arafatx
Posts: 25
Joined: Tue Aug 11, 2015 4:51 pm

Re: Virtual Host

Post by arafatx » Wed Jan 06, 2016 3:25 am

donkfather wrote:you have to go to

Code: Select all

 `/home/$USER/conf/web/apache2.conf`
or on CentOS and RHEL

Code: Select all

`/home/$USER/conf/web/apache2.conf`
edit this file foreach VirtualHost where it says

Code: Select all

DocumentRoot and the tag <Directory ;
save and after that restart apache2.
Hi I cannot see apache2.conf in the directory. Where does vesta keep the apache2.conf? Very confusing.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Virtual Host

Post by skurudo » Thu Jan 07, 2016 10:35 pm

arafatx wrote: Hi I cannot see apache2.conf in the directory. Where does vesta keep the apache2.conf? Very confusing.
Well, if you don't see apache2, then you use CentOS / Rhel and your apache2 have different name - httpd
Top

arafatx
Posts: 25
Joined: Tue Aug 11, 2015 4:51 pm

Re: Virtual Host

Post by arafatx » Fri Jan 08, 2016 4:35 pm

skurudo wrote:
arafatx wrote: Hi I cannot see apache2.conf in the directory. Where does vesta keep the apache2.conf? Very confusing.
Well, if you don't see apache2, then you use CentOS / Rhel and your apache2 have different name - httpd
I solved this problem. Sorry I forgot to read the configuration file documentation :|. Thanks!!!
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Virtual Host

Post by skurudo » Mon Jan 11, 2016 2:41 pm

You're welcome
Close than.
Top


Locked
  • Print view

7 posts • Page 1 of 1

Return to “DNS 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