-2

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 !

Ali Salehi
  • 23
  • 1
  • 8
  • 1
    `php artisan serve` has nothing to do with apache2. – tkausl Feb 09 '23 at 14:58
  • @tkausl. sorry i forget write for what. for run laravel. – Ali Salehi Feb 09 '23 at 15:11
  • 2
    Why are you using `php artisan serve` when you already have Laragon? Also, personal recommendation, don't use SSL locally, it is usually a pain to setup and adds no value to local environments – matiaslauriti Feb 09 '23 at 15:11
  • 1
    I think you're confusing `php artisan serve` which uses the built-in PHP interpreter with an Apache configuration. The default for `php artisan serve` is port 8000 so that will always be displayed in the browser. The default for Apache is port 80. You can't run Apache and have another server service on port 8000 because it will clash, so that's why the built-in PHP interpreter that Laravel uses defaults to port 8000. The port is superficial, if you're running on localhost you're normally in development mode. But if for some reason you want to hide it, just try: http://daily_tasks.local – Eugene van der Merwe Feb 13 '23 at 05:27

2 Answers2

1

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

Álvaro
  • 385
  • 5
  • 15
0

how about proxy pass?

<VirtualHost *:80> 
  ...
  ProxyPreserveHost On
  ProxyRequests Off
  ProxyPass / http://localhost:8000/
  ProxyPassReverse / http://localhost:8000/
  ...
</VirtualHost> 
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Harpreet Singh Feb 17 '23 at 06:44