LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (http://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   Apache default page redirect (http://www.linuxquestions.org/questions/linux-enterprise-47/apache-default-page-redirect-441635/)

Harry Seldon 05-04-2006 01:22 PM

Apache default page redirect
 
I have a server whose document root is /var/www/html. The default site for the system is in /var/www/html/intranet. I have other sites located in the document root that I need to get to. What I'd like to do is leave the document root at /var/www/html but have the site automatically put people in ./intranet. The server I'm migrating off somehow has this configured but I can't puzzle it out. There are no virtual hosts set up. Any help would be appreciated.

pljvaldez 05-04-2006 01:36 PM

have you tried just making a symbolic link?

ln -s /var/www/html/intranet/index.html /var/www/html/index.html

Just change "index.html" to whatever your root page for that particular site is. I'm assuming of course that the other sites are named something different...

Harry Seldon 05-04-2006 02:24 PM

I gave it a try, but without permanently redirecting the link, I get none of the images and the links on the page all get the object not found error. In a pinch, I can move the other sites under the intranet site but I'd rather not, especially since there must be some way to do this as it's set up that way on the old production server. Plus, I can do it under IIS so I'm assuming it can be done here with the right kungfu.

pljvaldez 05-04-2006 03:20 PM

You might browse through the apache documentation. Here's the page on "Mapping URLs to Filesystem Locations"

Harry Seldon 05-05-2006 10:10 AM

The Redirect directive looks like what I need but I don't know where to put it. I don't have a mod_alias conf file. There doesn't appear to be a mod_alias install mod. I found an alias subsection in the default-server.conf under /etc/apache2; do I just add the Redirect line in this section or somewhere in this file?

pljvaldez 05-05-2006 12:10 PM

Sorry, I'm no expert so your guess is as good as mine. But there's only a couple of config files I'm aware of for apache and they should all be in the /etc/apache2 directory I believe.

You can see if mod alias is installed by typing apache2 -l (that's L). It's probably already compiled in.

On Debian, it looks like the main config file is apache2.conf. There is also a readme in this directory that might help you out. Or try google. Sorry I can't be more help. I've only used apache for basic webserving (i.e. testing my website before uploading it to our ISP's server -- we get 20MB, woohoo!)...

Harry Seldon 05-05-2006 12:36 PM

Quote:

Originally Posted by pljvaldez
Sorry, I'm no expert so your guess is as good as mine. But there's only a couple of config files I'm aware of for apache and they should all be in the /etc/apache2 directory I believe.

You can see if mod alias is installed by typing apache2 -l (that's L). It's probably already compiled in.

On Debian, it looks like the main config file is apache2.conf. There is also a readme in this directory that might help you out. Or try google. Sorry I can't be more help. I've only used apache for basic webserving (i.e. testing my website before uploading it to our ISP's server -- we get 20MB, woohoo!)...

That's ok. I'm farther along than I was so at least I'm heading in the right direction down what I hope is the right path. I'll get this mug figured out and post whatever voodoo it took to make it work here. Thanks for all your help.

Skip-DMP 05-12-2006 08:50 AM

Forwarding?
 
I am seeking a similar answer. Actually, I am trying to set my system up with multiple sites running on my system where each domain resides in its own directory. I have found the section in Tomcat to do it, but haven't gotten the configuration quite right... I believe (maybe I am wrong) that the two can work in conjunction with each other for the purpose you are trying to accomplish. I am an expert in neither, but could surely use a solution as well.


All times are GMT -5. The time now is 02:32 AM.