Wierd Apave vhost error

I installed a content management system today (MySource) that required me to add some code to my httpd.conf file.

I added the following to my mysource.transwarphosting.net.conf file:

<VirtualHost 207.150.160.100>
ServerAdmin webmaster@transwarphosting.net
DocumentRoot “/home/mysource/mysource.transwarphosting.net/html/home/web”
ServerName mysource.transwarphosting.net
SetEnv MySource_LogVisitors on
<Directory “/home/mysource/mysource.transwarphosting.net/html/home/web”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory “/home/mysource/mysource.transwarphosting.net/html/home/squizlib”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory “/home/mysource/mysource.transwarphosting.net/html/home/data/unrestricted”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
AliasMatch “^(/.)?/__lib(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/web/__lib$2”
AliasMatch “^(/.)?/__squizlib(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/squizlib$2”
AliasMatch “^(/.)?/__data(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/data/unrestricted$2”

Any HTTP request made at this domain followed by ‘/_edit’

will open the editing interface for that site, page etc.

AliasMatch “^(/.)?/_edit(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/web/edit$2”

Any other HTTP request made at this domain gets handled

by the MySource web frontend controller script.

AliasMatch “^(/.*)?$” “/home/mysource/mysource.transwarphosting.net/html/home/web/index.php”

Example alternative at a particular subdirecory of this domain:

#AliasMatch “^/path/to/mysource/section(/.)?/__lib(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/web/__lib$2”
#AliasMatch “^/path/to/mysource/section(/.)?/__squizlib(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/squizlib$2”
#AliasMatch “^/path/to/mysource/section(/.)?/__data(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/data/unrestricted$2”
#AliasMatch “^/path/to/mysource/section(/.)?/_edit(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/web/edit$2”
#AliasMatch “^/path/to/mysource/section(/.*)?$” “/home/mysource/mysource.transwarphosting.net/html/home/web/index.php”
</VirtualHost>

When I restarted httpd I got the following:

[root@centos root]# service httpd reload
Reloading httpd: [ OK ]
[root@centos root]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [Mon Nov 08 21:38:34 2004] [error] VirtualHost 207.150.160.100:0 – mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[ OK ]
[root@centos root]#

Apache restarted, so I guess this error isn’t a biggie but it’s kinda odd. Can anybody tell me what it means?

Well, I’ve figured out one thing that it means: it means the code doesn’t work and the CMS does not do what it’s supposed to. At least it didn’t take apaceh down so I have time to investigate further without disrupting my other sites.

Im a big fan of drupal for CMSs.

Anyway, I would put that in the conf.d/, not the actual httpd.conf, it is just easier to organize that way. You may already have a .conf for that domain name(in your conf.d/), so you are doubling up the vhost data (hence it puking).

I would also not just do a reload,

# service httpd configtest

it will catch some of those errors before hand.

see if putting it in your conf.d/ helps, if you have that IP address shared, make sure its on the right domain name, if you are actually using the IP address, it will be that.

It is in the conf.d specifically in the mysource.transwarphosting.net.conf file. I never edit httpd.conf

The configtest us a good idea (thanks) but it didn’t shut down httod just sput the same error message at me:

[root@centos mysource.transwarphosting.net]# service httpd configtest
[Sun Nov 14 19:30:21 2004] [error] VirtualHost 207.150.160.100:0 – mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
Syntax OK
[root@centos mysource.transwarphosting.net]#

Any idea what the specific error message means?

I got this same error when editing the namevirtualhost.conf file in the conf.d folder. I edited this file to make a default namevirtualhost (for the shared IPs) if the URL doens’t match any namevirtualhost ServerName. This default just using an apache redirect to my main website, but could load a default webpage or whatever.

Anyway, back to your problem…

I got the error when I put the IP without the port (I think). This may be your problem.

Original:


<VirtualHost 207.150.160.100>
ServerAdmin webmaster@transwarphosting.net
DocumentRoot "/home/mysource/mysource.transwarphosting.net/html/home/web"
ServerName mysource.transwarphosting.net

Try (NOTE the “:80” after the IP):


<VirtualHost 207.150.160.100:80>
ServerAdmin webmaster@transwarphosting.net
DocumentRoot "/home/mysource/mysource.transwarphosting.net/html/home/web"
ServerName mysource.transwarphosting.net

Thanks Justin,

the error is gone now. I should have thought of that since I’ve run into issies with that kind of thing before and solved it the same way.

The main problem is still there, however when I try to access the web

http://mysource.transwarphosting.net/
http://mysource.transwarphosting.net/home/
http://mysource.transwarphosting.net/home/web/

all of these rul’s give me the “PAGE NOT FOUND” error

Here is my complete mysource.transwarphosting.net.conf file.

<VirtualHost 207.150.160.100:80>
ServerAdmin webmaster@transwarphosting.net
DocumentRoot “/home/mysource/mysource.transwarphosting.net/html/home/web”
ServerName mysource.transwarphosting.net
SetEnv MySource_LogVisitors on
<Directory “/home/mysource/mysource.transwarphosting.net/html/home/web”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory “/home/mysource/mysource.transwarphosting.net/html/home/squizlib”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory “/home/mysource/mysource.transwarphosting.net/html/home/data/unrestricted”>
AllowOverride All
Order allow,deny
Allow from all
</Directory>
AliasMatch “^(/.)?/__lib(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/web/__lib$2”
AliasMatch “^(/.)?/__squizlib(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/squizlib$2”
AliasMatch “^(/.)?/__data(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/data/unrestricted$2”

Any HTTP request made at this domain followed by ‘/_edit’

will open the editing interface for that site, page etc.

AliasMatch “^(/.)?/_edit(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/web/edit$2”

Any other HTTP request made at this domain gets handled

by the MySource web frontend controller script.

AliasMatch “^(/.*)?$” “/home/mysource/mysource.transwarphosting.net/html/home/web/index.php”

Example alternative at a particular subdirecory of this domain:

#AliasMatch “^/path/to/mysource/section(/.)?/__lib(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/web/__lib$2”
#AliasMatch “^/path/to/mysource/section(/.)?/__squizlib(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/squizlib$2”
#AliasMatch “^/path/to/mysource/section(/.)?/__data(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/data/unrestricted$2”
#AliasMatch “^/path/to/mysource/section(/.)?/_edit(.)$” “/home/mysource/mysource.transwarphosting.net/html/home/web/edit$2”
#AliasMatch “^/path/to/mysource/section(/.*)?$” “/home/mysource/mysource.transwarphosting.net/html/home/web/index.php”
</VirtualHost>

Original Code:

<VirtualHost 207.150.160.100:80>

SuexecUserGroup mysource mysource

DocumentRoot /home/mysource/mysource.transwarphosting.net/html
ServerName mysource.transwarphosting.net

ServerAlias www.mysource.transwarphosting.net ftp.mysource.transwarphosting.net mail.mysource.transwarphosting.net
ServerAdmin webmaster@mysource.transwarphosting.net

subdomain logic

RewriteEngine On
RewriteOptions inherit
RewriteCond %{HTTP_HOST} !^www.mysource.transwarphosting.net [NC]
RewriteCond %{HTTP_HOST} !^mysource.transwarphosting.net [NC]
RewriteCond %{HTTP_HOST} ^([A-Z0-9a-z-]+).mysource.transwarphosting.net [NC]
RewriteCond %{DOCUMENT_ROOT}/%1 -d
RewriteRule ^(.+) %{HTTP_HOST}/$1 [C]
RewriteRule ^([0-9A-Za-z-]+).mysource.transwarphosting.net/?(.*)$ %{DOCUMENT_ROOT}/$1/$2 [L]

end subdomain logic

ErrorLog /home/mysource/var/mysource.transwarphosting.net/logs/error.log
CustomLog /home/mysource/var/mysource.transwarphosting.net/logs/transfer.log combined

php_admin_flag engine On

cgi: 1

<Directory /home/mysource/mysource.transwarphosting.net/html>
AllowOverride AuthConfig FileInfo Options Limit Indexes
</Directory>

ScriptAlias /cgi-bin/ /home/mysource/mysource.transwarphosting.net/html/cgi-bin/

</VirtualHost>

the actual cms files are located in

/home/mysource/mysource.transwarphosting.net/html/home/

but the files are not shoing up even install.php which I know exists gives the file not found error message.

I’ve checked and this is not a permission problem (I have everything 777 – I hate to do that but don’t know what else to try).

I’m seriously considering starting over from scratch shigh

Tim

One thing I noticed:

ServerName mysource.transwarphosting.net - new virtual host
ServerName mysource.transwarphosting.net - original virtual host

I thought this would give you an error/warning, but I guess it doesn?t. Logically I guess it should work if apache just takes the first instance of the ServerName if 2 virtual host have the same name on the same IP. So mysource.transwarphosting.net/anything would always go to the new Vhost.

But you may want to try changing the ServerName on the original vhost to see if that helps.

So from


ServerName mysource.transwarphosting.net
ServerAlias www.mysource.transwarphosting.net ftp.mysource.transwarphosting.net mail.mysource.transwarphosting.net

try this


ServerName www.mysource.transwarphosting.net 
ServerAlias ftp.mysource.transwarphosting.net mail.mysource.transwarphosting.net

I am getting permission errors (403 Forbidden) when trying the following URLs:

http://mysource.transwarphosting.net/__data/
http://mysource.transwarphosting.net/__lib/
http://mysource.transwarphosting.net/__squizlib/

…instead of the 404.

And http://mysource.transwarphosting.net/_edit/ works, shows the login page. So it seems like it’s working and for the 403 it’s just because there isn’t an index.php file in there (or whatever the default directoryindex is) and you have directory listing in apache turned off. Since I don’t know the names of other files in those directories I couldn’t try anything else.

The only one that seems to be not working is the default page “/home/web/index.php” which gives the 404.

Also, why is there an AliasMatch for the default “mysource.transwarphosting.net
[AliasMatch “^(/.*)?$” “/home/mysource/mysource.transwarphosting.net/html/home/web/index.php”]

Wouldn’t the DocumentRoot handle this for you? :confused:

[EDIT]
Also, just to make sure, this domain is setup on a NameVirtualHost IP correct?

I will have to double check some of the permissions tomorrow (I’m tired now) but as I recall everything is readable/writable/executable by owner and group.

I don’t know the reason for the extra code, it just said add it so I did (above the old code).

Yes it’s on a virtual hosting IP the same as the rest of my sites.

Tim

I think this permission error (403) is not having permission to list the files in the web directory, the no directory listing (which is the way it should be) not the CHMOD’n permissions.

So if there isn’t an index.php file in that folder (or another DirectoryIndex file) it will give that error when just viewing the main directory “/__data/” without a file like ?/__data/thefile.php?

So if you are sure there is an index.php in the ?Data? directory than I don?t know what to tell you. Again the ?Edit? directory (http://mysource.transwarphosting.net/_edit/) is working so I think it?s just that the other folders (/lib, /data, /squizlib) don?t have an index.php file in them and therefore are giving the 403 error.

This is very odd

/home/mysource/mysource.transwarphosting.net/html/home/data

exists on the server but not on my local copy of the cms code (I just decompressed again to make sure I hadn’t deleted it) so I’m assuming it is generated during install BUT there is no file index.php (or anything else) inthat directory except three subdirectories restricted unrestricted and ftp

I think I’m going to do this over from scratch tomorrow evening.

Thanks for the help guys, will keep you posted.

Tim