[SOLVED] Virtual Host
-
- Posts: 1
- Joined: Mon Mar 30, 2015 10:29 pm
[SOLVED] Virtual Host
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:
And run:
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
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>
Code: Select all
a2ensite app.mydomain.com.conf
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
/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:
/home/admin/conf/web/nginx.conf - here is config for nginx
and not there:
In folder with apache2:/etc/apache2/sites-available/app.mydomain.com.conf)
a2ensite app.mydomain.com.conf
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
-
- Posts: 8
- Joined: Fri Apr 03, 2015 10:18 pm
Re: Virtual Host
you have to go to or on CentOS and RHEL
edit this file foreach VirtualHost where it says
save and after that restart apache2.
Code: Select all
`/home/$USER/conf/web/apache2.conf`
Code: Select all
`/home/$USER/conf/web/apache2.conf`
Code: Select all
DocumentRoot and the tag <Directory ;
Re: Virtual Host
Hi I cannot see apache2.conf in the directory. Where does vesta keep the apache2.conf? Very confusing.donkfather wrote:you have to go toor on CentOS and RHELCode: Select all
`/home/$USER/conf/web/apache2.conf`
edit this file foreach VirtualHost where it saysCode: Select all
`/home/$USER/conf/web/apache2.conf`
save and after that restart apache2.Code: Select all
DocumentRoot and the tag <Directory ;
Re: Virtual Host
Well, if you don't see apache2, then you use CentOS / Rhel and your apache2 have different name - httpdarafatx wrote: Hi I cannot see apache2.conf in the directory. Where does vesta keep the apache2.conf? Very confusing.
Re: Virtual Host
I solved this problem. Sorry I forgot to read the configuration file documentation :|. Thanks!!!skurudo wrote:Well, if you don't see apache2, then you use CentOS / Rhel and your apache2 have different name - httpdarafatx wrote: Hi I cannot see apache2.conf in the directory. Where does vesta keep the apache2.conf? Very confusing.
Re: Virtual Host
You're welcome
Close than.
Close than.