Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 24th July 2013, 18:01
KRG-23 KRG-23 is offline
Junior Member
 
Join Date: Jul 2013
Posts: 15
Thanks: 0
Thanked 2 Times in 2 Posts
Default [VHOST] Files overwritten after last update

Hello,

I just registered these forums because I was told ISPConfig 3 is a must for creating automatic webhosting solutions.

And it is, really. So I went head first in it and spent numerous hours literally struggling with it (I am not quite a linux adept but I am learning). In this hand to hand combat, I eventually achieved what I had planned, to have a website properly working.

But that was before the last update. Or so. I am not sure if my problem is related to this update but I've noticed that vhosts files are somehow badly written. Every single change I make (add subdomains for instance) prevents my website from being accessible.

So as to make myself understandable, here is what is working and what is not:

Quote:
#NameVirtualHost my.ip.add.ress:80

<VirtualHost my.ip.add.ress:80>
ServerAdmin webmasta@my-domain.com
ServerName www.my-domain.com
DocumentRoot /var/www/clients/client8/web12/web/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/clients/client8/web12/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
This was written with my own hands after searching the interwebs. It is working.

Quote:
<Directory /var/www/my-domain.com>
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>

<VirtualHost *:80>
DocumentRoot /var/www/my-domain.com/web

ServerName my-domain.com
ServerAlias *.my-domain.com
ServerAlias *.www.my-domain.com www.my-domain.com
ServerAdmin webmaster@my-domain.com

ErrorLog /var/log/ispconfig/httpd/my-domain.com/error.log


<IfModule mod_ssl.c>
</IfModule>

<Directory /var/www/my-domain.com/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client8/web12/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>




# suexec enabled
<IfModule mod_suexec.c>
SuexecUserGroup web12 client8
</IfModule>
# Clear PHP settings of this website
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
# php as fast-cgi enabled
# For config options see: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
<IfModule mod_fcgid.c>
IdleTimeout 300
ProcessLifeTime 3600
# MaxProcessCount 1000
DefaultMinClassProcessCount 0
DefaultMaxClassProcessCount 100
IPCConnectTimeout 3
IPCCommTimeout 360
BusyTimeout 300
</IfModule>
<Directory /var/www/my-domain.com/web>
AddHandler fcgid-script .php .php3 .php4 .php5
FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/clients/client8/web12/web>
AddHandler fcgid-script .php .php3 .php4 .php5
FCGIWrapper /var/www/php-fcgi-scripts/web12/.php-fcgi-starter .php
Options +ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>


# add support for apache mpm_itk
<IfModule mpm_itk_module>
AssignUserId web12 client8
</IfModule>

<IfModule mod_dav_fs.c>
# Do not execute PHP files in webdav directory
<Directory /var/www/clients/client8/web12/webdav>
<ifModule mod_security2.c>
SecRuleRemoveById 960015
SecRuleRemoveById 960032
</ifModule>
<FilesMatch "\.ph(p3?|tml)$">
SetHandler None
</FilesMatch>
</Directory>
DavLockDB /var/www/clients/client8/web12/tmp/DavLock
# DO NOT REMOVE THE COMMENTS!
# IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
# WEBDAV BEGIN
# WEBDAV END
</IfModule>


</VirtualHost>
This vhost file returns the how-so-annoying Squirrelmail homepage and any direct access to directories returns the "could not be found" page ...

I understand that in the first file, a lot of features are not implemented, but this is on purpose, my website being a kind of sandbox. But in the second file, I don't quite get what is going wrong. I can see differences, but they are not relevent/obvious for me. I want to have acces to any folder in the /web/ directory. I can't because when I manually change the Options +Indexes, it is overwritten by the next change in ISPConfig...

I rent a VPS and followed the Perfect Server howto based on a Ubuntu 12.04 LTS.

Here is the bind9 conf :
Quote:
"pri.my-domain.com" 16L, 689C
$TTL 3600
@ IN SOA ns103.ovh.net. webmasta.my-domain.com. (
2013071804 ; serial, todays date + todays serial #
7200 ; refresh, seconds
540 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;

my-domain.com. 3600 A my.ip.add.ress
my-domain.com. 3600 MX 10 mail.my-domain.com.
my-domain.com. 3600 NS dns103.ovh.net.
my-domain.com. 3600 NS ns103.ovh.net.
mail 3600 A my.ip.add.ress
www 3600 A my.ip.add.ress
OVH is the registrar to whom I bought the domain name.

So as to keep my own modifications (like +Indexes) in the vhost files, should I use the Options in the webinterface ? Why did these files changed and somehow messed up with my website ?

Thank you for your help and sorry for my English ...
Reply With Quote
Sponsored Links
  #2  
Old 24th July 2013, 18:16
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 931
Thanks: 16
Thanked 261 Times in 208 Posts
Default

To add custom code to the vhost files there is the "Apache directives" field in the website "options" tab inside of ISPConfig.
Each time you change anything about the website in ISPConfig the corresponding vhost file is rewritten.

You have two options:

1.) if you make different changes to different websites
go to ISPConfig (as admin), go to the website section, click your website, click the options tab and enter all your modifications into the Apache Directives field.

2.) if you make the same changes to all vhosts
copy the /usr/local/ispconfig/server/conf/vhost.conf.master to /usr/local/ispconfig/server/conf-custom/ and edit this file to match your needs. This is the vhost template used for all website vhost files.
__________________
Marius Cramer

pixcept KG
Reply With Quote
The Following User Says Thank You to Croydon For This Useful Post:
weemalesmep (2nd September 2013)
  #3  
Old 24th July 2013, 23:17
KRG-23 KRG-23 is offline
Junior Member
 
Join Date: Jul 2013
Posts: 15
Thanks: 0
Thanked 2 Times in 2 Posts
Default

oh, thanks a ton. I'll try that after a good night sleep. I'll keep you posted
Reply With Quote
  #4  
Old 26th July 2013, 11:15
KRG-23 KRG-23 is offline
Junior Member
 
Join Date: Jul 2013
Posts: 15
Thanks: 0
Thanked 2 Times in 2 Posts
Default

So I put the whole content of the first file in the Apache Directives and it works like a charm.

Thanks for your help on this, I can see that I did not pay enough attention to this optionnal setting.

However, it is worring to see that a default ISPConfig config does not work. At least, for me.
Reply With Quote
  #5  
Old 26th July 2013, 12:32
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,177
Thanks: 829
Thanked 5,414 Times in 4,257 Posts
Default

Quote:
However, it is worring to see that a default ISPConfig config does not work. At least, for me.
The default config that ispconfig creates works fine on more then hundred thousamd servers worldwide, so there must be a installation issue on your server if it does not work for you.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 26th July 2013, 16:29
KRG-23 KRG-23 is offline
Junior Member
 
Join Date: Jul 2013
Posts: 15
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by till View Post
The default config that ispconfig creates works fine on more then hundred thousamd servers worldwide, so there must be a installation issue on your server if it does not work for you.
That's exactly what I was thinking when I first installed it. It's been running on my VPS since February, I never had to touch anything to make my website available. And there was this update. I am respectfull. It's not because I had a problem that it means it's a total fail.
I am interested in knowing what went wrong with the last update on my system. If a uninstall.sh existed, and honestly I did not check if such a script existed, I would unstall it and reinstall it and restart from scratch.

This is why I posted both files, because I don't know what is wrong with the generated one ...
Reply With Quote
  #7  
Old 29th July 2013, 08:18
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,177
Thanks: 829
Thanked 5,414 Times in 4,257 Posts
 
Default

The vhost file generated by ispconfig is absolutely fine, the problem is in your squirrelmail.conf file. Open the squirrelmail.conf and find the vhost section, there you must have entered a vhost with IPADDRESS:80 instead of *:80, the ip based vhost which is basically a super default site that redirects all requests to wildcard vhosts to squirrelmail, so when you enter any domain name, you will get squirrelmail. Change that vhost to*:80 instead. Alternatively you can select the IP instead of * in the website settings in ispconfig so your website vhost will be ip based too. Never mix * and IP based vhosts on a apache server as a IP based vhost always take precedence over the wildcard based vhosts.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
Venosnode (2nd September 2013)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to update php-fpm conf files? untor Installation/Configuration 0 13th December 2012 20:24
Compromised Host acecjh General 6 22nd April 2011 08:35
Vhosts...conf not synced to changes crypted General 50 24th April 2010 00:54
Update failed, lost client information (not the files) joosimol Installation/Configuration 10 25th January 2010 15:27
One site contaminated by r57shell aceyzeriat Installation/Configuration 21 13th May 2009 12:19


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


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