HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Virtual Host (vhost file) reset after updating web domain configuration (http://www.howtoforge.com/forums/showthread.php?t=62267)

jaypabs 18th June 2013 15:53

Virtual Host (vhost file) reset after updating web domain configuration
 
After editing website configuration using ISPConfig 3, under Sites tab > website, the vhost file created by ISPConfig was reset automatically to it's default value.

All the custom config that I added was lost.

Example I set the following line to:

Code:

        server_name mysite.com www.philnews.ph;

        root  /var/www/mysite.com/web;

        index index.php index.htm index.html index.cgi index.pl index.xhtml;

Now, when I update the site "mysite.com, the vhost reset to default like:

Code:

        index index.html index.htm index.php index.cgi index.pl index.xhtml;
Notice the php file will move again to the 3rd location.

Note that this happen to anything that you change in the web domain config like changing the password of "Webstatistics" under statistics tab.

How to prevent this?

till 18th June 2013 16:18

Quote:

After editing website configuration using ISPConfig 3, under Sites tab > website, the vhost file created by ISPConfig was reset automatically to it's default value.
Yes, thats intended. The vhost files made by ispconfig shall not be altered manually. If you want to add any apache code to a vhsot file, use the apache directives field on the options tab of the website settings.

jaypabs 18th June 2013 16:25

Quote:

Originally Posted by till (Post 298788)
Yes, thats intended. The vhost files made by ispconfig shall not be altered manually. If you want to add any apache code to a vhsot file, use the apache directives field on the options tab of the website settings.

Can you please give me an example of directives on how to change the order of index? Like I want to make index.php the first index rather than index.html.

BTW, I'm using Nginx.

Thank you

ItsDom 19th June 2013 11:41

Login as admin, go to sites, select the domain, go to the options tab, add your directives in the "nginx directives"

I've found in the past that putting directives not in some kind of location container can cause conflicts, so try this:

Code:

location / {
  index index.php index.htm index.html index.cgi index.pl index.xhtml;
}


I think you need to be logged in as admin though for the "options" tab to be visible.
At the risk of thread hi-jacking: does anyone know if it is possible to allow clients to view and change options?

jaypabs 19th June 2013 12:16

Quote:

Originally Posted by ItsDom (Post 298814)
Login as admin, go to sites, select the domain, go to the options tab, add your directives in the "nginx directives"

I've found in the past that putting directives not in some kind of location container can cause conflicts, so try this:

Code:

location / {
  index index.php index.htm index.html index.cgi index.pl index.xhtml;
}


I think you need to be logged in as admin though for the "options" tab to be visible.
At the risk of thread hi-jacking: does anyone know if it is possible to allow clients to view and change options?

That works, but is this a good practice? Because the old index is not removed above. This make two index.

ItsDom 19th June 2013 12:48

I'm not sure it's "good practice" but it's the advised way of doing it by people that know a lot (http://www.howtoforge.com/forums/sho...82&postcount=4)

I think it's to do with a quirk in how ISPConfig synchronizes/updates the vhosts files.

I THINK it effectively has a vhosts template which has things such as root, index, directives to get php working etc. When synchronizing, ISPConfig basically just adds the directives from the options field into the template without actually changing the template. If you look at the thread I link to in the first paragraph here, when I didn't put the "root" directive in a location container, there were complaints because there were 2 root directives at the same level suggesting it was just appending the root directive to the template, rather than updating bits within the template.

This maybe wrong, or a gross over-simplification but that seems to be how it works. I'm sure someone will correct me:)

till 19th June 2013 12:49

Quote:

At the risk of thread hi-jacking: does anyone know if it is possible to allow clients to view and change options?
Thats not possble as it would allow your clients to take over your server.

Quote:

That works, but is this a good practice? Because the old index is not removed above. This make two index.
Yes, thats ok.

jaypabs 19th June 2013 13:04

Thanks for the reply.

I have another question about how to override the error_page. My wordpress site has its own error handling. By default, it is embedded in wordpress. So how can I remove error_page in the nginx directive?

ItsDom 19th June 2013 13:12

Go into ISPConfig control panel, select the site, under the "domain tab" untick the "Own Error-Documents" should really do it... not sure if that removes the error handling totally from nginx or just point it to a global set of error pages though... Give it a try.

jaypabs 19th June 2013 13:15

Quote:

Originally Posted by ItsDom (Post 298821)
Go into ISPConfig control panel, select the site, under the "domain tab" untick the "Own Error-Documents" should really do it... not sure if that removes the error handling totally from nginx or just point it to a global set of error pages though... Give it a try.

My bad. I did not notice it. It actually removes the error handling.

thanks


All times are GMT +2. The time now is 20:35.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.