LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache / Default page (https://www.linuxquestions.org/questions/linux-newbie-8/apache-default-page-4175464578/)

js82 06-03-2013 11:10 AM

Apache / Default page
 
I have apache running on my centos box and I'm using it to serve up MediaWiki. Right now my Root Dir in my http.conf file is "/var/www/html", and my MediaWiki instance lives at "/var/www/html/qawiki". Lets say my machine is www.mymachine.com, and I want the mediawiki instance to be loaded by default if you go to that address instead of having to to to www.mymachine.com/qawiki, what is the best way to do this. I would assume that if I just changed the Root Dir and Document Root in my http.conf I could accomplish this, but if I make those changes, I cannot load mediawiki properly. Thanks.

spazticclown 06-03-2013 02:54 PM

One option is to create a redirect from "www.mymachine.com" to "www.mymachine.com/qawiki/index.htm" (or whatever the index file is for qawiki).

Or you could move the entire contents of /var/www/html/qawiki/ to /var/www/html/.

Someone else might have a more elegant method as well.

eklavya 06-04-2013 10:37 AM

You could use virtual host. Define yout desired url and exact path of directory. Now you can access yiur web project without moving anything. Just define url in /etc/hosts file.

spazticclown 06-04-2013 10:44 AM

The virtual host is FAR more elegant but you would either need to add an entry in /etc/hosts in all systems that need to contact the wiki or run a DNS server? Am I correct on that?

eklavya 06-05-2013 04:54 AM

Can't say elegant but much beneficial locally.

because if he is using apache, web project should be in php (I hope it is not perl) and if he is using php, header direct is very common thing, as I thought.
Quote:

header('Location: http://www.mymachine.com/qawiki');
He can put this line in index.php of MediaWiki so whenever anyone will try to open MediaWiki, it will take him on http://www.mymachine.com/qawiki


All times are GMT -5. The time now is 08:47 PM.