Page 1 of 1

[SOLVED] Virtual Host

Posted: Mon Mar 30, 2015 10:52 pm
by inclanfunk
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

Re: Virtual Host

Posted: Thu Apr 02, 2015 7:18 pm
by skurudo
/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

Re: Virtual Host

Posted: Fri Apr 03, 2015 10:22 pm
by donkfather
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.

Re: Virtual Host

Posted: Wed Jan 06, 2016 3:25 am
by arafatx
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.

Re: Virtual Host

Posted: Thu Jan 07, 2016 10:35 pm
by skurudo
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

Re: Virtual Host

Posted: Fri Jan 08, 2016 4:35 pm
by arafatx
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!!!

Re: Virtual Host

Posted: Mon Jan 11, 2016 2:41 pm
by skurudo
You're welcome
Close than.