The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Virtual Host problem.
Author: SViper68 
Date:   26-10-00 06:25

Hello all,
Here is the problem. When I activate a virtual host, which documents are located in the /usr/home/user dir., the sub dir. dosnt work on the site! If I deactivate the virtual host...the subs work. Main site is located in the /usr/local/www/data folder then the virtual is located in the /usr/home/user folder. Thanks for the help.

-SViper

Reply To This Message
 
 RE: Virtual Host problem.
Author: Roman Serbski 
Date:   26-10-00 15:17

What error message do you receive from Apache?
Did you check permissions (should be 755)?
Is there index.htm/index.html files?

Reply To This Message
 
 RE: Virtual Host problem.
Author: SViper68 
Date:   26-10-00 21:10

There is really no error message. I have the permissions where they need to be and there are index.html files in the folders. The sub filders on the main site work if the virtual host is not activated.

Reply To This Message
 
 RE: Virtual Host problem.
Author: Dan Langille 
Date:   27-10-00 01:53

I think you need to give us more information.

Reply To This Message
 
 RE: Virtual Host problem.
Author: SViper68 
Date:   27-10-00 02:41

ok ok...i will try this one more time. I have apache running on my BSD box. It is hosting a hardware site on it. Everything was working fine until I wanted to host another on the same machine. So what I did was setup a virtual host for the other site which is an Amime site. When I added the entry into the apache.conf file, it looked something like this.

<VirtualHost 1.0.1.0>
DocumentRoot /usr/home/anime
ServerName www.anime.com
</VirtualHost>

When I do this, the origanal site which resides in the /usr/local/www/data dir. Dosn't work all the way. For example, Without the Virtual host installed if you went to http://test.website.net/about it would show the about page. When you enable the virtual host, that page nolonger comes up. A page cannot be found screen appears. Even when you type the full address http://test.website.net/about/index.html it will not work. Also any member's pages that reside in their home dir will not work when the virtual host is enabled. example. http://test.website.net/~user would pull up a page if one was created. Hope this helps.

Reply To This Message
 
 RE: Virtual Host problem.
Author: Roman Serbski 
Date:   27-10-00 05:06

Well, first of all, do you really own anime.com domain? You see, it is not a good idea to write any domain you like. As I know anime.com already exists and it's owned by Vanguard Media Corporation (ANIME6-DOM). If this domain is yours than it's OK, in opposite you should contact your regional ISP and ask him about domain hosting.

Second thing, please check your apache.conf/httpd.conf

NameVirtualHost ip_of_your_server
# VirtualHost example:
<VirtualHost>
DocumentRoot /usr/local/www/website_folder
ServerAdmin someone@somewhere.com
ServerName www.some_web_site.com
ErrorLog /var/log/apache/web_site.error
CustomLog /var/log/apache/custom_website.log
</VirtualHost>

Finally, you should add DNS records about virtual domain (zone file, reverse file etc.).

Good luck.

Reply To This Message
 
 RE: Virtual Host problem.
Author: SViper68 
Date:   27-10-00 05:39

IM sorry the domains I used were in example as I did not want to give out the ones I have already...and I do own domains already pointing to my ip. Ok now that we have that settled lets get into the grubby stuff. Here is the first Virtual host entry I tried.

NameVirtualHost 1.0.1.0

<VirtualHost 1.0.1.0>
DocumentRoot /usr/home/anime
ServerName www.testaddress.com
ErrorLog /var/log/apache/error.log
CustomLog /var/log/apache/custom.log
</VirtualHost>

Mind that this is entered at the end of the apache.conf file and that it is in front of the Frontpage access virtual host entry.

The information I was given beforehand from Roman was incorrect. You cannot have just <VirtualHost> the ./apachctl graceful will not run when that is like that. I have mine set to <VirtualHost 1.0.1.0>. Also it didnt like the Customlog so I commented that out.

I dont like this but what I have to do to get the two sites working with their subs is by adding in an entry into the apache.conf for a virtualhost. I dont know why...but the users can also access their dir either by using the 1st server address or second...IE

http://www.firstsite.net/~usersdir
or
http://www.secondsite.net/~usersdir


Wierd I must say. Thanks for the help.

Reply To This Message
 
 RE: Virtual Host problem.
Author: Dan Langille 
Date:   27-10-00 20:00

I suggest you use the examples shown at <a href="http://freebsddiary.org/virtualhosts.html">http://freebsddiary.org/virtualhosts.html</a>. Get them working first. Then customize them for your needs. Make one change at a time. Test it. Etc.

You say that /usr/local/sbin/apachectl graceful does not work. I suggest this indicates a problem.

Try apachectl configtest. This will identify any errors with the configuration file. Fix them.

Reply To This Message
 
 RE: Virtual Host problem.
Author: SViper68 
Date:   27-10-00 20:25

The problem seems to have been fixed. All I did was put in a virtual host for each site. Now they work. It looks as if when you add a virtual host to a one site system to make it into a multiple site system, you must mak an entry into the apache.conf file for each site...even the origal host if you will.

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org