Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-10-2006, 10:21 PM
|
#1
|
Member
Registered: Oct 2005
Distribution: mandriva
Posts: 106
Rep:
|
Apache2 - need help with virtual hosts
I have apache2 running on Debian Etch and it's working fine. What I'm trying to do is to point 2 different hosts to 2 different directories using the default file found in /etc/apache2/sites-available/ directory. I have 2 sites: blog.mysite.com and photos.mysite.com and I have it configured so that blog.mysite.com points to /var/www/serendipity/ while photos.mysite.com points to /usr/share/gallery2
So here's the funny part: When I open up a browser and type in photos.mysite.com, it comes back with the main.php page like it should (except the picture icons are missing), but none of the links work - they ALL give a 404 error.
Similarly, when I type in blog.mysite.com, the same thing happens. Page displays (without formatting - it's all messed up, but it displays so it's obvious that it's going to the correct directory), but any links you click on inside the page reveals a 404 error. Any ideas?
Oh, and I know these pages work fine because I was using an alias in my default file previously and everything was fine. Thanks!
|
|
|
08-11-2006, 02:20 AM
|
#2
|
Senior Member
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591
Rep:
|
are the paths to the links that dont show relative to the index.html/index.php or whatever? Are there "index" files in your sites? There are a lot of ways to build websites so i think you could post some more info...
if there are "index" files point your browser exactly to their address and see whether this changes something. I experienced that this might make a difference in the past.
cheers,j.
Last edited by j-ray; 08-11-2006 at 02:22 AM.
|
|
|
08-11-2006, 02:42 AM
|
#3
|
Member
Registered: Mar 2006
Posts: 110
Rep:
|
can you paste me the httpd.conf content where you have defined these two virtualhosts??
|
|
|
08-11-2006, 09:09 AM
|
#4
|
Member
Registered: Oct 2005
Distribution: mandriva
Posts: 106
Original Poster
Rep:
|
Quote:
Originally Posted by j-ray
are the paths to the links that dont show relative to the index.html/index.php or whatever? Are there "index" files in your sites? There are a lot of ways to build websites so i think you could post some more info...
if there are "index" files point your browser exactly to their address and see whether this changes something. I experienced that this might make a difference in the past.
cheers,j.
|
The file that is supposed to be shown is called "main.php" for the gallery one, and I'm not sure what it is for the blog. I'm using Serendipity, if that helps any. It almost seems like the main.php page points to a stylesheet or something that is not getting read. I can point my browser directly at that and I get the same result.
However if I add an alias to the default file from /etc/apache2/sites-available/
Alias /gallery /usr/share/gallery2
and then type this in the browser: photos.mysite.com/gallery everything works perfectly. Same with the blog.
|
|
|
08-11-2006, 09:26 AM
|
#5
|
Member
Registered: Oct 2005
Distribution: mandriva
Posts: 106
Original Poster
Rep:
|
Quote:
Originally Posted by rahulk
can you paste me the httpd.conf content where you have defined these two virtualhosts??
|
Since I'm using Apache2, the httpd.conf file is used only for backward compatability, so it's an empty file. In Apache 2, the virtual hosts are defined in the default file that is located in /etc/apache2/. I made modifications to the original one and I've also tried reading in the Apache documentation and trying to create my own. Nothing seems to work, but here is the contents of the default file:
Code:
NameVirtualHost 192.168.3.10:80
<VirtualHost 192.168.3.10:80>
DocumentRoot /usr/share/gallery2
ServerName photos.mysite.com
ServerAdmin me@gmail.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
<VirtualHost 192.168.3.10:80>
DocumentRoot /var/www/serendipity
ServerName blog.mysite.com
ServerAdmin me@gmail.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
Alias /webmail /usr/share/squirrelmail
|
|
|
08-11-2006, 02:24 PM
|
#6
|
Member
Registered: Oct 2005
Distribution: mandriva
Posts: 106
Original Poster
Rep:
|
Problem Solved! Had nothing to do with Apache - both Gallery and Serendipity needed configuration changes to get them to work correctly. Thanks for the replies!
|
|
|
All times are GMT -5. The time now is 12:48 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|