in host file :
#
127.0.0.1 localhost
::1 localhost
127.0.0.1 daily_tasks.local #laragon magic!
D:\laragon\etc\apache2\sites-enabled\auto.daily_tasks.local.conf :
<VirtualHost *:80>
DocumentRoot "D:/laragon/www/daily_tasks/public"
ServerName daily_tasks.local
ServerAlias *.daily_tasks.local
<Directory "D:/laragon/www/daily_tasks/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
# If you want to use SSL, enable it by going to Menu > Apache > SSL > Enabled
but whene run php artisan serv for run laravel. in browser this url http://daily_tasks.local:8000/ is working!
I don't want it to be displayed :8000 !
Laragon provides friendly url when the server is up. Only put your folder into www folder and restart Apache in Laragon, it'll detect a new project and that is all. You won't need php artisan serve.
DOCS: https://laragon.org/docs/pretty-urls.html
how about proxy pass?
<VirtualHost *:80>
...
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
...
</VirtualHost>
Related
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
I am following a laravel tutorial, where tutor sets up a virtual host to run their app. The app is located in /opt/lampp/htdocs/first-app. My port for running apache is 8000. So if I visit localhost:8000/first-app/public, I can view my laravel app.
My httpd-vhosts.conf file looks like this:
<VirtualHost *:8000>
ServerAdmin webmaster#dummy-host.example.com
DocumentRoot "/opt/lampp/htdocs"
ServerName localhost
ServerAlias www.localhost
</VirtualHost>
<VirtualHost *:8000>
DocumentRoot "/opt/lampp/htdocs/first-app/public"
ServerName app.test
ServerAlias www.app.test
<Directory "/opt/lampp/htdocs/first-app">
Options All
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
My /etc/hosts file looks like this:
127.0.0.1 localhost app.test
::1 localhost app.test
127.0.1.1 pop-os.localdomain pop-os
127.0.0.1 app.test
I have uncommented httpd.conf like so
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
But I am getting this when I visit app.test
Browser output when app.test is visited
What am I doing wrong?
Edit: I have discovered, if I visit www.app.test:8000, it works fine
Just found out that the browser automatically adds port 80. So since I am running apache on port 8000, I need to specify it.
Thus, the settings above actually worked. All I had to do was go to http://localhost:8000 or http://127.0.0.1:8000
I have a Laravel project set up on OpenLitespeed server on a port. The IP address is 127.0.0.1:8016. I am using apache2 reverse proxy to pass requests to the OpenLitespeed server. The Laravel application works okay but after logging in I get a Laravel's 403 on all the pages that require authentication to view. I have even tried stopping the OpenLitespeed server and moving the project to apache2 but I still get the same problem. Both apache2 and OpenLitespeed are running on the same server. How can I fix this?
This is my apache conf file
<VirtualHost *:80>
ServerAdmin admin#mysite.com
ServerName mysite.com
ServerAlias *.mysite.com
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8016/
ProxyPassReverse / http://127.0.0.1:8016/
ProxyPassReverseCookieDomain .mysite.com 127.0.0.1
ErrorLog "logs/mysite.com-error.log"
CustomLog "logs/mysite.com-access.log" common
</VirtualHost>
This is my Laravel's trustedproxy.php
return [
'proxies' => "127.0.0.1",
'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
];
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
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.