LaraDock multiproject laravel 8 - installation issue - laravel

I am completely new to LaraDock. After hours of trying to dockerize existing Laravel 8 projects, I discovered LaraDock. I have installed it successfuly and the container is running in Docker. When I go to localhost, however I get 404 not found. I need help to correctly set up the web server conf files.
So far I have created a new .conf file in apache2/sites as well as nginx/sites (as I do not know which webserver is running on Mac Monterey with LaraDock).
So in apache2/sites the new project1.conf has the following lines:
ServerName project1.test
DocumentRoot /Users/paul/Sites/project1
And in nginx/sites the project1.conf:
server_name project1.test;
root /Users/paul/Sites/project1;
index index.php index.html index.htm;
In the browser project1.test also returns error 404 not found.
In several .conf files the normal path to apache hosted file (/var/www/) does not exist on Monterey. Should I replace these instances by /Users/paul/Sites/ ?
What am I missing?

in laravel the document root should be /public on the end.
so it could be
/Users/paul/Sites/MeerkatSafaris/public
and / or
DocumentRoot /Users/paul/Sites/project1/public
but it is unclear which is the correct root in your question

Related

Change localhost/htdocs folder in Xampp 8.2

I know this is not a new question but I think something has changed with Xampp in the latest version. I was using Xampp 8.0 and was using another directory to serve as localhost just fine. My Xampp installation is in C:/xampp while my projects are located in D:\Whip\Projects. This is the folder I want to load when using the address localhost.
I changed 2 lines in httpd.conf like I had done several times before
DocumentRoot "D:\Whip\Projects"
<Directory "D:\Whip\Projects">
The folder loads but PHP doesn't work properly. I get errors related to missing session folders and extensions. The problem is in php.ini file the paths are not absolute anymore. For example, in xampp 8.0 I had
session.save_path="C:\xampp\tmp"
In 8.2 I have
session.save_path="\xampp\tmp"
And same thing with extensions directory and all other paths defined in php.ini (and who knows where else). If I manually add C: to the path above, the sessions start working. I'm apprehensive of changing every path like that. Is there a better way to change the htdocs folder now?

Pointing apache DocumentRoot to Laravel gives 403 Forbidden error

I wanted to host my laravel project on google CentOS 7 server. Following the instructions I have install the laravel project and have changed /etc/httpd/conf/httpd.conf files changing DocumentRoot to /var/www/html/laravel/public and <Directory /var/www/html/laravel. Now when I open my website Forbidden You don't have permission to access / on this server.. However, when I proceed to mysite.com/laravel/public my website loads perfectly, meaning that I'm in www folder even if I have changed the DocumentRoot. httpd -S points to my laravel public folder - Main DocumentRoot: "/var/www/html/unionbox.pro/public". When I change DocumentRoots back to /var/www/html my website just list files and folder in the www directory when I open my website. I would appreciate your help! (have been trying to resolve it for 2 days)

Codeigniter 4.0.4 redirecting to 404 - File Not Found

Why I got 404 - File Not Found when I run CI.
I am using xampp 8.0.0, I already put my CI folder to htdocs and also I've changed the config/app baseurl to http://localhost/framework-4.0.4/.
When I open it to browswer and click public it just redirected to 404.
enter image description here
You should setup a virtual host in your xampp for your project.
To do that for this codeigniter projects, open the the Apache httpd-vhosts.conf file which are located in C:\xampp\apache\conf\extra\httpd-vhosts.conf, Added below lines of code at the end of the file.
using the example codeigniter-blog.local
DocumentRoot "C:/xampp/htdocs/framework-4.0.4/public"
ServerName codeigniter-blog.local
Now, Open the hosts file which are located at C:\Windows\System32\drivers\etc\hosts, Added below code into this file at the end.
127.0.0.1 codeigniter-blog.local
restart the xampp server.
If you open the browser and navigate http://codeigniter-blog.local, if you are getting welcome page, that means everything fine otherwise you'll get intl package is not enabled.

How to remove "public/index.php" on server?

I m newly working on laravel.
I created laravel project named as "blog" on localhost and for removing public/index.php, I followed following process :
cut and pasted .htaccess from public/ folder to root i.e. blog
Renamed the server.php to index.php
Then I created a test api in api.php route and echoed "Hello World".
Now when I go to project path from my localhost server like:
localhost/Blog/api/test then its work properly.
But when I run same on a server like 192.101.111.555,like :
192.101.111.555/Blog/api/test then it showing NOT FOUND.
I am not getting how can I resolve this. And why its working fine on localhost but not working on server ?
You rename server.php but not recommend. This file copy then rename
Yes, if you have done those settings you will not be able to properly access on the localhost by running php artisan serve. So for this, you can install xampp and do the virtual host settings. Check more info at
How to enable Virtual Host on Xampp for Laravel?.
On the benefit of this is that you don't have to run the php artisan serve command again and again.

How to Host laravel 5.2 on CENTOS server

I am trying to host my laravel 5.2 project on a CENTOS Server (Shared Hosting) I followed this tutorial
https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e
but when I try running it on online I get a blank page.
I checked my log I got this error
AH01276: Cannot serve directory /var/www/html: No matching DirectoryIndex (index.html,index.php,index.php) found, and server-generated directory index forbidden by Options directive
I then followed this http://www.liquidweb.com/kb/apache-error-no-matching-directoryindex-index-html-found-solved/ to solve that but I still keep getting a blank page with the same error in the log.
Please any help will be so much appreciated.
Thanks in advance.
You should point web server to a public directory inside Laravel project directory, not to it's root.
I had to redirect apache in the host file to the project folder

Resources