How to disable localhost/dashboard directory listing in xampp - xampp

Whenever I open localhost it redirects to this directory listing. Previously it used to show the index.html page "Welcome to XAMPP" now it shows directory listing. How do I revert it?

For whatever reason if xampp stops recognizing the dashboard index.html file simply edit xampp/htdocs/index.php file and edit the following line and add /index.html at the end of the line.
header('Location: '.$uri.'/dashboard/index.html');
This will make sure that the index.html is loaded rather than displaying the Directory listing.

Related

xampp directly open my html file

I created folder called en407 and inside it i create a file called assigment that contain html , css and also php.
http://localhost/en407b/
When i click on the assginmnt file , i should let me choose what file to open
http://localhost/en407b/assignment
but the link directly go to my html file which is index.html and the link remains
http://localhost/en407b/assignment
in my assignment file , it contain index.html , index2.html and other....
how to fix it???
At first you can't run PHP in .html files because the server does not recognize it as valid till you tell it to do it. To do this create a .htaccess file in your root web directory and add this line inside it:
AddType application/x-httpd-php .htm .html
This will tell Apache to process files with a .htm or .html file extension as PHP files.

custom url instead of having localhost

I have a folder called example inside htdocs in XAMPP , so I access my url with localhost/example/ . How can I have just example/ instead of localhost/example/ when I type my url ? Thanks in advance!
I've tried editing DocumentRoom in apache htdocs and it didn't work...
I'm not sure if that helps you, but you have to set the html root into your example folder to be able to use localhost/ only. Maybe you can move all contents of the example folder to the parent directory and try again.
If you want to use a real URL like example.com/ instead of localhost/ you can edit your hosts file
sudo nano /etc/hosts
and add the following lines to the end:
127.0.0.1 www.example.com
127.0.0.1 example.com

Magento: Moved Multistore - new store always redirect to old domain, although new base_url

I have moved a Multistore to another webserver with the following structrue:
mystore.com --> Magento Multistore installation
flowers.website.com --> symlinks to mystore.com folder
cars.website.com --> symlinks to mystore.com folder
The new setup is completely the same (only different domains and folder names).
But if I go to the new url mynewstore.com I will always be redirect to the old domain.
Things I have already done/tried:
Changed the base_urls in core_config_data
Cleared var + 777 permission
Cleared session table
Reindex
Checked htaccess for redirects
Checked index.php
Checked templates of the different stores for redirects
The important part of my index.php:
/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
$mageRunCode = 'mystore';
$mageRunType = 'website';
Mage::run($mageRunCode, $mageRunType);
If I'm going to change the $mageRunCode to another store ID (like "flowers"), the old (!!) flower store (redirect to old flower url) will be loaded.
I guess it is hard to solve the problem without looking at the code, but I've no other idea as to try it here. I really appreciate any hint.
I once had the same problem and it took me almost a whole day to figure out what was going wrong. I had a multistore but all the stores gave a 404 page on every URL I tried. In the end the solution was to change MAGE_RUN_TYPE from website to store.
Your index.php file as you have it is overriding the MAGE_RUN_CODE and MAGE_RUN_TYPE variables because of these lines:
$mageRunCode = 'mystore';
$mageRunType = 'website';
Since they are called after their initial definitions, they;re being reset to mystore and website.
Try removing these lines, and seeing if the variables are properly passed into the Mage::run() function.
Important Notice about CHMODing to 777.
This is a potentially dangerous thing to do as it can allow public access to your filesystem. You never want to set a 777 permission set on a production site for this reason.
Set your folders to 755 and files to 644. To do this, open a shell connection and cd to your Magento root directory. Run the following command:
chmod -R 755 *; find -type f -print0|xargs -0 chmod 644
If run correctly, all of the files in your Magento installation will be set to the correct permissions.
in the index.php header add this:
$_SERVER['MAGE_RUN_CODE'] = $_SERVER['REDIRECT_MAGE_RUN_CODE'];
$_SERVER['MAGE_RUN_TYPE'] = $_SERVER['REDIRECT_MAGE_RUN_TYPE'];

JFolder::create: Could not create directory - Joomla

I end up with below error when I try to install a component,module or plugin.
JFolder::create: Could not create directory
What could be the issue?
Change the below variable to in your configuration file(configuration.php) as shown.
public $log_path = '/logs';
public $tmp_path = '/tmp';
Also make sure that these folder has the folder permission 755.
Read more
Now I found two solutions for resolving this issue,and both of them has been worked very well:
Solution One:
First find the exact absolute path to your tmp folder by using this trick:
Create a PHP file in your website root,for example path.php
Place this snippet of code in the file and hit the save button
<?php
$path = getcwd();
echo "Your Absolute Path is: ";
echo $path;
?>
Navigate to yourdomain.com/path.php in your browser
From now on:
Login to your Joomla Administartor panel.
Go to Global Configuration
Click on the "Server" tab
Change the path to the "Absolute Path(you've just found)"/tmp
Insert this line of code in your .htaccess file: php_value open_basedir NULL
This solution has been worked very well for me,and it's doesn't deal with any Joomla's core file hacking.
Solution Two:
Login to your Joomla Administartor panel.
Go to Global Configuration
Click no the "Server" tab
Change the path from /public_html/tmp to just tmp
Login to control Panel(CPanel),(Or you can use a FTP account for this purpose)
Open File Manager (if you are using FTP,this step must be skipped)
Open Folder "libraries"
Open Folder "joomla"
Open Folder "filesystem"
Right Click on "folder.php" and click Edit.
Look for the line, (search = obd):
$obd = ini_get('open_basedir'); Comment out that line with // at the beginning so it becomes://$obd = ini_get('open_basedir');
Save and Close.
You can change the owner of Joomla folders to your apache server user.
You can find the apache server user with the following command:
ps aux | grep -v root | grep apache | cut -d\ -f1 | sort | uniq
Source: https://serverfault.com/questions/125865/finding-out-what-user-apache-is-running-as
For Ubuntu, it's www-data.
After you know the apache user name, then you can change the owner of all the folders and files of your Joomla installation. You can use the following command to do so:
(I suppose that your apache user is www-data)
sudo chown -R www-data:www-data /path/to/your/joomla
If you are already inside your Joomla directory, then you can run the following command:
sudo chown -R www-data:www-data .
After a lot of trouble with this error, I got a break through.
In the configuration.php file, edit the var logpath n tmppath values as below var $log_path = '/home/public_html/sitename/logs';
var $tmp_path = '/home/public_html/sitename/tmp';
This definately will work. And works for me.

how to change web server folder location in xampp

I have installed xampp and by default my website files are stored in htdocs. How do I change the webdirectory path?
Edit the file /opt/lampp/etc/httpd.conf and change the lines containing current web directory path. It should start with DocumentRoot. Update all the places having the current path to the path you would like it to be.
It can be done by editing the "httpd.conf" file present in this path "\xampp\apache\conf\".
Change the line that starts with "Directory ...".
Note that all the lines that start with a hash (#) are just comments and are there just to describe the commands present there in the file.
search for the file "httpd.conf" and change the path in that file.
change localhost's name ? thus instead of having localhostdomain/webdirectory
you may have newdomain/webdirectory ?

Resources