how to change default folder shown by apache in xampp

Problems with the Linux version of XAMPP, questions, comments, and anything related.

how to change default folder shown by apache in xampp

Postby anurag » 16. June 2008 18:31

hi
when we type http://localhost/ xampp directly opens http://localhost/xampp/
how can i change it to http://localhost/xampp/anurag/somepage.php. ie.
i want to set the default page one level inside xampp folder

thanks in advance
anurag
 
Posts: 1
Joined: 16. June 2008 18:16

Change Default Folder - Get Rid of Test Page

Postby moonshinerat » 17. June 2008 02:56

I'm having similar trouble to this. I can't stop http://localhost from redirecting to http://localhost/xampp/

It's getting quite irritating now. I have changed the redirect in the index.html that is already in htdocs. I have deleted index.html and the Xampp folder but all I get is a 404 error. I have also checked httpd.conf but that is set up to use any documnets in htdocs so I can't understand why it keeps ignoring my web pages and diverting to Xampp all the time.

A solution would be much appreciated.

(UPDATE: this error does not occur in the Windows version of Xampp. I have tried it in four distros and each one encounters this problem)
moonshinerat
 
Posts: 4
Joined: 21. April 2008 17:14

Postby sari42 » 17. June 2008 09:13

looks like you have to edit (or delete) index.php ...
sari42
 
Posts: 800
Joined: 27. November 2005 18:28

Sorry, still no luck....

Postby moonshinerat » 17. June 2008 14:23

sari42 wrote:looks like you have to edit (or delete) index.php ...


edited and removed. Xampp test page will soon have to be my homepage I think. Surely I'm not the only one with this problem?

Thanks for the reply though.
moonshinerat
 
Posts: 4
Joined: 21. April 2008 17:14

Re: Sorry, still no luck....

Postby pwjones » 20. June 2008 19:21

moonshinerat wrote:
sari42 wrote:looks like you have to edit (or delete) index.php ...


edited and removed. Xampp test page will soon have to be my homepage I think. Surely I'm not the only one with this problem?

Thanks for the reply though.


Removing the index.php should have done the trick. Did you reload the page? I know on my machine that if I make changes and then try to look at them, I will get the old page unless I hit reload.

If that does not work, you can edit your http.conf and set DirectoryIndex so that index.html is served before index.php. And then create your index.html to redirect to your webpage.
pwjones
 
Posts: 1
Joined: 20. June 2008 19:14

Lampp: Change the apache default page/directory

Postby vivekkc » 04. November 2008 11:53

I also have the same issues on Linux. I have tried,

editing /opt/lampp/etc/httpd.conf to change "DocumentRoot" : No use! :-(

removing/editting /opt/lampp/htdocs/index.html : No use :-(

removing /opt/lampp/htdocs/xampp/ : No use :-(

Everytime it looked for XMPP folder and loads that as default page. Please advice me how to change that to "/opt/lampp/htdocs/default"(direct, not redirecting into this folder). I suppose its in httpd.conf, but I have no luck with that....

Please help me!

Regards,
-ViveK
vivekkc
 
Posts: 2
Joined: 04. November 2008 11:43

Sovled:

Postby vivekkc » 04. November 2008 13:19

Ohh guys,

all the methods given above will work (you dont have to remove the xampp directory). The real problem was the the browser cache, I just had to clear them off or use different browser :-)

Thanks
-ViveK

vivekkc
 
Posts: 2
Joined: 04. November 2008 11:43

Re: how to change default folder shown by apache in xampp

Postby digitalvampire » 22. February 2009 11:09

I tried everything including clearing the Browser Cache. The default page still points to the XAMPP page served from /HTDOCS/XAMPP/

I've my joomla website straight under HTDOCS, but XAMPP always wants to go to /HTDOCS/XAMPP/ irrespective of the HTTPD.CONF settings.

I've temporarily done a dirty fix by renaming the index.php in XAMPP folder to something else and having a redirecting script put there as index.html pointing to the Joomla index.php under HTDOCS.


I would appreciate a better and permanent solution.

Note: This wierd behaviour is not found when XAMPP running on Windows.
digitalvampire
 
Posts: 3
Joined: 22. February 2009 10:40

Re: how to change default folder shown by apache in xampp

Postby Wiedmann » 22. February 2009 11:54

I tried everything including clearing the Browser Cache. The default page still points to the XAMPP page ... I've my joomla website

Joomla is using an "index.php" as start page. So you have to delete the "index.html" from XAMPP.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: how to change default folder shown by apache in xampp

Postby digitalvampire » 22. February 2009 12:48

Joomla is using an "index.php" as start page. So you have to delete the "index.html" from XAMPP.


Thanks for your quick response.

Yes, I've already deleted/renamed the XAMPP index.html residing under HTDOCS. No change. :roll:
digitalvampire
 
Posts: 3
Joined: 22. February 2009 10:40

Re: how to change default folder shown by apache in xampp

Postby Wiedmann » 22. February 2009 13:10

I've already deleted/renamed the XAMPP index.html residing under HTDOCS. No change.

Then you are doing something wrong...

Only the file "index.html" in htdocs is doing the redirect to XAMPP. That's a fact. If you delete this file, there is nothing which can you redirect to XAMPP.

And because your browser can have a copy of this file in its cache, you must also clear the browser cache.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: how to change default folder shown by apache in xampp

Postby neilt » 24. March 2009 02:15

I agree this is a fundamental question. As soon as I had my site up and running I wanted to fix the base URL before too many absolute links ended up in my site.

I'm a newbie, but this is how I did it. Experts please comment!

My goal was to go from:
Code: Select all
http://www.mysite.com/drupal-6.10 [URL for my drupal website]
http://www.mysite.com/xampp       [URL for my xampp admin]
to
http://www.mysite.com                [URL for my drupal website]
http://www.mysite.com/xampp     [URL for my xampp admin]


What I did:
In /opt/lampp/etc/httpd.conf
Code: Select all
# Was DocumentRoot "/opt/lampp/htdocs"
DocumentRoot "/opt/lampp/htdocs/drupal-6.10"

Also added in httpd.conf immediately after <Directory "/opt/lampp/htdocs"> section:
Code: Select all
# Copy of settings from <Directory "/opt/lampp/htdocs"> section:
<Directory "/opt/lampp/htdocs/drupal-6.10">
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Also in httpd.conf in the <IfModule alias_module> section:
Code: Select all
# I still want access to xampp and webalizer.
    Alias /xampp /opt/lampp/htdocs/xampp
    Alias /webalizer /opt/lampp/htdocs/webalizer

Now there is a redirect to xampp in /opt/lampp/htdocs/index.html that can confuse everything (by starting an infinite loop with the Alias above, methinks):
Code: Select all
mv /opt/lampp/htdocs/index.html to /opt/lampp/htdocs/index-original.html
# and restart the servers
/opt/lampp/lampp restart

Finally I get my browser to forget the past by clearing its cache (this is important):
In Firefox: Tools >> Clear Private Data.

That's it. If the above is correct, I believe it belongs in the lampp documentation.
Are there any mistakes in the above; is it 'best practice'? Will the webalizer still record its data correctly?
thanks,
Neil
neilt
 
Posts: 1
Joined: 24. March 2009 01:42

Re: how to change default folder shown by apache in xampp

Postby countryboy5135 » 19. February 2011 18:53

I have had the same problem.

What I did is edit the index.php file.

Search for (Location : '.$uri.'/xamp/)
Change /xamp/ to /your folder/

Save the index.php

restart the apache and mysql services. Then when you type in the local address you should be directed to the folder you entered.
countryboy5135
 
Posts: 1
Joined: 19. February 2011 18:49

Re: how to change default folder shown by apache in xampp

Postby rdd2dan » 09. June 2016 01:09

Hi Guys,

Not sure if this is relevant now, but I am just trying to do the same thing. The index php file posts led me to the index php file under htdocs.

Open it up and you will get the following below, just swap out the "dashboard" text with whatever you are wishing to replace the homescreen with. Works for me. Good luck :).
<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/DASHBOARD/');
exit;
?>
Something is wrong with the XAMPP installation :-(
rdd2dan
 
Posts: 1
Joined: 09. June 2016 01:03
XAMPP version: 5.6
Operating System: Windows 7


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 2 guests

cron