How do I reset Xampp's default page? - laravel

I used to be able to go to localhost on my windows PC with xampp running and be shown the /dashboard page which is fine. I think I made a mistake with a Laravel install and now when I go to localhost I get a Laravel landing page.
How can I reset this so it goes back to the default /dashboard page?
I've tried this in http-vhosts.conf but didn't help:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost
</VirtualHost>
This is the default it was at before. I can't do a local Wordpress install any more as when I drop the folder in htdocs and navigate in the browser it gives a Laravel 404 error.

In C:\xampp\apache\conf\httpd.conf
set
DocumentRoot "C:/xampp/htdocs"
In C:\xampp\apache\conf\extra\httpd-vhosts.conf
Add below settings
<VirtualHost *:80>
ServerAdmin webmaster#localhost.com
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
</VirtualHost>
Hope this will help

Related

laravel, privacy error while renaming server name

I created a laravel app named lsapp , I can access laravel landing page http://localhost/lsapp/public/ .
To hide public folder, I decided to route through lsapp.dev/. But when I try to load in chrome , it shows privacy error.
Following changes were made,
in system32/drivers/hosts
127.0.0.1 localhost
127.0.0.1 lsapp.dev
in httpd.vhosts.conf
<VirtualHost *:80>
DocumentRoot "E:/programs/php/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:/programs/php/htdocs/htdocs/public"
ServerName lsapp.dev
</VirtualHost>

Custom URL for project using Apache on Localhost

I am XAMPP on my localhost. When I go to localhost it's redirecting me to localhost/dashboard/ That's good.
now, I want If I type laravel.dev It's should load the laravel public folder
For that I configure httpd-vhosts file as below:
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/laravel-practice/public/"
ServerName laravel.dev
</VirtualHost>
windows hosts file like below:
127.0.0.1 localhost
127.0.0.1 laravel.dev
now, If I go to laravel.dev it's redirecting me to localhost/dashboard/ location. but its should be redirecting me to laravel public folder which is D:/xampp/htdocs/laravel-practice/public/
can you tell me how can I fix it?
If everything else is ok then change * to laravel.dev
<VirtualHost laravel.dev:80>
DocumentRoot "D:/xampp/htdocs/laravel-practice/public/"
ServerName laravel.dev
</VirtualHost>
Two important points:
Always restart apache after edit httpd-vhosts
Include NameVirtualHost laravel.dev:80 before <VirtualHost laravel.dev:80>
UPDATE
Xampp has a default index.php on htdocs folder, try deleting this file, because index.php redirects to /dashboard and let me know if worked

laravel virtual host setup not showing front-end

I have a new laptop, and am now trying to run a laravel application.
First, am trying to setup a virtual host for the project so that I can access blog.local
I went my hosts file and setup the drivers like the following:
127.0.0.1 localhost
127.0.0.1 test.local
127.0.0.1 blog.local
The for the apache configuration I have the following:
<VirtualHost *:80>
DocumentRoot "C:\XAMPP\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\XAMPP\htdocs\blog"
ServerName blog.local
</VirtualHost>
When I try to access my url I do not see the site but the files only:
For this and future projects, how can I create a local url and see the front-end when I visit it?
You need to address your public folder,
<VirtualHost *:80>
DocumentRoot "C:\XAMPP\htdocs\blog\public"
ServerName blog.local
</VirtualHost>
The document root is a directory (a folder) that is stored on your host's servers and that is designated for holding web pages. When someone else looks at your website, this is the location they will be accessing.
Change the DocumentRoot to according to your PHP project is located.
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/blog/public"
ServerName blog.local
</VirtualHost>
Restart the servers after making any changes! If you don’t reset the server to apply the changes, nothing will work even though you know you’ve done everything right.

Keep XAMPP default page as developing website

I am preparing to create my portfolio site and this is something I always thought. I find XAMPP default admin page useful in some ways to me, but as I am developing website, I can't access it any more.
I want to know is there a way to keep XAMPP default page as I am developing other websites.
I know I can setup virtual hosts for several websites, but is it same for XAMPP? I have done virtual host one time as work. At, first it didn't work(what was CakePHP app), but later I have managed to make it work.
UPDATE:
So I found out this post about Hosting multiple local sites with XAMPP and have edited my Virtual Host config file like this:
<VirtualHost *:80>
ServerName localhost/xampp
DocumentRoot "C:/xampp/htdocs/xampp/"
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs/"
</VirtualHost>
My windows host file:
127.0.0.1 localhost
127.0.0.1 localhost/xampp
For now, accessing both 127.0.0.1 and 127.0.0.1/xampp redirect me to XAMPP home page, which is in C:/xampp/htdocs/xampp/
When I access localhost, browser redirects me to index.php file(As 127.0.0.1 also should), which is for testing purposes in htdocs folder. However if I try to access localhost/xampp I get error in Chrome - "This webpage has a redirect loop".
I have no idea how to progress on from here.
I found out answer. THe issue was with my naming of xampp admin page domain, instead of using someting, which include localhost for xampp page, I had to use something else, as it will not conflict when using your own naming.
So my hosts file now:
127.0.0.1 localhost
127.0.0.1 xampp-admin
And Apache Virtual Host file:
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs/"
</VirtualHost>
<VirtualHost *:80>
ServerName xampp-admin
DocumentRoot "C:/xampp/htdocs/xampp/"
<Directory "C:/xampp/htdocs/xampp/">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
This part(below) didn't change anything, I added, because I saw it in examples, but I still have no idea, what it's useful to:
<Directory "C:/xampp/htdocs/xampp/">
Order allow,deny
Allow from all
</Directory>
Still, maybe someone can suggest me more conventional name for Xampp admin page?
All you need to is place this at the top of your httpd-vhost.conf before other virtual host configurations.
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/dashboard/"
ServerName xampp.admin
<Directory "C:/xampp/htdocs/dashboard/">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

setting up laravel redirects to xampp

Hi I'm setting up Lavarel using a book called Laravel Starter by Shawn McCool (Packt Publishing), I've cloned the respiratory via github and have got as far as configuring my hosts file and setting up my virtual hosts. As below:
127.0.0.1 laravel.dev
<VirtualHost *:80>
ServerName laravel.dev
DocumentRoot C:/xampp/htdocs/laravel/public
</VirtualHost>
However if I visit the link http://laravel.dev I am redirected to the XAMPP page and I should be expecting the laravel splash page.
Any ideas of what I have done wrong? The document root is pointing to the correct direction as it is installed onto my localhost.
Greatly appreciate any help.
In the new xampp you should use something like this:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/laravel/public"
ServerName laravel.dev
ServerAlias laravel.dev
ErrorLog "logs/laravel.log"
CustomLog "logs/custom.laravel.log" combined
<Directory "C:/xampp/htdocs/laravel/public">
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
edited with the right serverName. This is my own virtual host file. I also use it for Laravel.
Go to C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf and enable virtualhost by removing the #sign in front of Include conf/extra/httpd-vhosts.conf
Albeit an old question, I found a solution to this the hard way. Do something like this:
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
<Directory "C:\xampp\htdocs">
Require all granted
</Directory>
</VirtualHost>
This would enable the XAMPP Stack to point to the localhost correctly (I guess?)
And of course don't forget your drivers\etc\hosts
127.0.0.1 localhost
127.0.0.1 laraveltest.dev
Your configuration seems fine. Just don't forget to add these two.
<VirtualHost *:80>
ServerName laraveltest.dev
ServerAdmin laraveltestp#localhost.com
DocumentRoot "D:/Workspace/Projects/Playground/laravel-test/public"
#SetEnv APPLICATION_ENV "development"
<Directory "D:/Workspace/Projects/Playground/laravel-test/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
In new Laravel you need to change your Apache Vhost file to stop this redirection from server. For complete guide about how to change vhost file and run your first laravel web app go to following link : <https://answerdone.blogspot.com/2018/01/how-to-solve-laravel-xampp-dashboard.html>
probably, it is because xampp and laravel run on the same port. If so, try changing port before you start running laravel project by this command
php artisan serve --port=8080
*8080 can be changed to any other number port you want
Do you have NameVirtualHost enabled?
try uncomment #NameVirtualHost *:80 and see if it helps.
I used localhost/appName/public/. This is the only way it worked for me.

Resources