[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Custom "404 - File Not Found"



I also need to point the .net and .org versions of some of my domains to the main .com site. Currently I just create an A record pointing the .net and .org addresses to the .com I.P. and it seems to work great. Cobalt support says I need to also manually change the httpd.conf file by adding a 'ServerAlias' entry

Just went through this last night. The IP trick works until you host more than one "virtual site" on the same IP address.

Adding additional domain names to the "virtual server" is rather simple. Telnet into the box then su to root. Go to /etc/httpd/conf. Make a backup of httpd.conf prior to your changes! Use your favorite editor and then go down to your <VirtualHost> entry. Here is one that I did:

<VirtualHost 216.234.224.9>
ServerName www.j2digitalmedia.com
ServerAdmin site3
DocumentRoot /home/sites/site3/web
ServerAlias j2digitalmedia.com www.j2digitalmedia.net j2digitalmedia.net
ServerAlias www.j2media.net j2media.net
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^216.234.224.9(:80)?$
RewriteCond %{HTTP_HOST}                !^www.j2digitalmedia.com(:80)?$
RewriteRule ^/(.*) http://www.j2digitalmedia.com/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site3/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site3/users/$1/web/$3
</VirtualHost>

If you have more than a few, do not go over a line without adding a second entry (see above). Also, you may want to consider the RewriteRule. What this does is say you use the .net version of the domain name to access the site. In it's current state it will automatically force the address to read as the address listed. If you do want this to happen, erase the line.

After you make the changes, make sure to restart Apache. Do it through the Telnet session and not through the GUI. The command is:

/etc/rc.d/init.d/httpd stop(or replace stop with start).

After that you should be set. To make sure the Cobalt GUI didn't erase the settings I made I added another "virtual" site to the same IP address. No troubles.

Of course, they say this is unsupported, but they would be happy to do it for me for $200/hour!

Do I really need to change the httpd.conf? What does it buy me?

They are trying to cover their ass, heck we all do. They say everything is un-supported unless you use their GUI (again, CYA). I have just enough Unix knowledge to be dangerous (by no means am I a pro). Changing the httpd.conf file was simple, especially because our older servers we use no GUI.

Best of luck. If you have more questions ... ask, I will be happy to help if I can.
-JSLucido