PDA

View Full Version : Can't start apache, virtualhosts problem.


Xinil
30th May 2007, 08:06
I've looked through the dozens of threads here and I just can't find what will fix this problem. I cannot get apache to start no matter what type of configuration I do. The install worked fine and everything was going great, but apparently I did something (no idea) and now it won't start any more.

I try to start apache and this happens:

[root@dedicated145 www]# /etc/init.d/httpd start
Starting httpd: [Wed May 30 00:51:06 2007] [warn] NameVirtualHost 66.186.60.50:80 has no VirtualHosts
[FAILED]


Changed around a few things and I started getting this:
[root@dedicated145 www]# /etc/init.d/httpd start
Starting httpd: [Wed May 30 00:59:19 2007] [warn] VirtualHost 66.186.60.50:80 overlaps with VirtualHost 66.186.60.50:80, the first has precedence, perhaps you need a NameVirtualHost directive
[FAILED]


Changed around some more and now I don't get any errors, just a failed:
[root@dedicated145 www]# /etc/init.d/httpd start
Starting httpd: [FAILED]


Any help would be appreciated. Here's what my Vhosts_ispconfig.conf contains:

###################################
#
# ISPConfig vHost Configuration File
# Version 1.0
#
###################################
#
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
ServerName localhost
ServerAdmin root@localhost
DocumentRoot /var/www/sharedip
</VirtualHost>
#
#
######################################
# Vhost: webmail.gysslerenterprises.com:80
######################################
#
#
<VirtualHost 127.0.0.1:80>
ServerName webmail.gysslerenterprises.com:80
ServerAdmin webmaster@gysslerenterprises.com
DocumentRoot /var/www/web1/web
ServerAlias gysslerenterprises.com
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 i
ndex.shtml index.cgi index.pl index.jsp Default.htm default.htm
ScriptAlias /cgi-bin/ /var/www/web1/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web1/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php3>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php4>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php5>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
php_admin_flag safe_mode On
php_admin_value open_basedir /var/www/web1/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /var/www/web1/phptmp/
php_admin_value session.save_path /var/www/web1/phptmp/
Alias /error/ "/var/www/web1/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
</VirtualHost>
#
#
#
######################################
# Vhost: www.garrettgyssler.com:80
######################################
#
#
<VirtualHost 127.0.0.1:80>
ServerName www.garrettgyssler.com:80
ServerAdmin webmaster@garrettgyssler.com
DocumentRoot /var/www/web2/web
ServerAlias garrettgyssler.com
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 i
ndex.shtml index.cgi index.pl index.jsp Default.htm default.htm
ScriptAlias /cgi-bin/ /var/www/web2/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web2/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php3>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php4>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php5>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
php_admin_flag safe_mode Off
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/web2/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web2/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web2/user/$1/web/$3
</VirtualHost>


My server can be accessed at: dedicated145.krypt.com.
IP: 66.186.60.50

www.gysslerenterprises.com is where it's supposed to be online too. I guess I'm somewhat confused about what should be going in the:

Hostname:
Domain:
IP Address:
IP List:

Right now, I have:
Hostname: dedicated145
Domain: krypt.com
IP Address: 127.0.0.1
IP List: 66.186.60.50

--

I've changed all those around to different things too in an attempt to fix it.

Thanks in advance.

TheMaximumWeasel
30th May 2007, 08:28
Are there any Virtual host entries in your httpd.conf file? Also is the NameVirtualHost 66.186.60.50:80 in httpd.conf I dont see it in your ispconfig's vhost file.

Max

Xinil
30th May 2007, 08:34
Here's my httpd.conf: http://www.myanimelist.net/temp/httpd.conf

I don't see any virtualhosts (though I've no idea tbh).

Xinil
30th May 2007, 09:09
Tried adding in:


NameVirtualHost *:80

and

NameVirtualHost 66.186.60.50:80



Neither worked. I still get errors like:


[root@dedicated145 www]# /etc/init.d/httpd start
Starting httpd: [Wed May 30 02:24:11 2007] [warn] VirtualHost 66.186.60.50:80 overlaps with VirtualHost 66.186.60.50:80, the first has precedence, perhaps you need a NameVirtualHost directive
[Wed May 30 02:24:11 2007] [warn] NameVirtualHost *:80 has no VirtualHosts
[FAILED]

till
30th May 2007, 11:19
- Have you created a website in ISPConfig?
- Is the file /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf empty?

Xinil
30th May 2007, 16:12
Hi till, thanks for the response.

I've created two websites.

The /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf file isn't empty either. I've listed the contents of that file in my first post.

Thanks.

Xinil
30th May 2007, 16:43
Also, I should mention that: http://www.gysslerenterprises.com:81/login.php works. Does that mean I have another instance of Apache running?

falko
31st May 2007, 14:51
Also, I should mention that: http://www.gysslerenterprises.com:81/login.php works. Does that mean I have another instance of Apache running?
Yes, ISPConfig comes with its own Apache on port 81 so that you can still access ISPConfig even if the main Apache fails (like in your case).

Why do you use 127.0.0.1 for your virtual hosts? That way, nobody can access your web sites...
What's the output of ifconfig?

Xinil
31st May 2007, 16:52
Thanks for the response falko, I appreciate it. I wiped my previous install and reinstalled everything. It's all fine now. No idea what was wrong in my previous config. Thanks for the help!

I'm using my IP instead of 127.0.0.1 now too. Thanks.

JRue
6th June 2007, 20:45
I'm having the same issue as Xinil. Getting the same error.

Everthing was working fine until we moved data centers.
Now all of a sudden my virtualhost entries are overlapping? wtf?

Note, I am using my external IP in the VirtualHost Directive.

All my VirtualHost Directives are in /etc/apache2/vhosts/Vhosts_ispconfig.conf as I believe they should be.

I changed the IP in Vhosts_ispconfig.conf last night and I think it changed back to the old address this morning....Wierd....

TheMaximumWeasel

Are there any Virtual host entries in your httpd.conf file? Also is the NameVirtualHost 66.186.60.50:80 in httpd.conf I dont see it in your ispconfig's vhost file.

Max


There are no VirtualHost or NameVirtualHost entries in httpd.conf. Nor is there a NameVirtualHost directive in Vhosts_ispconfig.conf


# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/[^.#]*


This directive in apache2.conf is confusing me...and it refers to file /etc/apache2/sites-enabled/default which has both NameVirtualHost *
and <VirtualHost *>

till
6th June 2007, 20:58
I changed the IP in Vhosts_ispconfig.conf last night and I think it changed back to the old address this morning....Wierd....

Not at all. Never change the file Vhosts_ispconfig.conf manually!

Instead of changing the file, change the IP in ISPConfig under management > server > settings, then open every website settings, make sure that the correct IP is selected and click on the save button.