I use digitalOcean’s trial versions with credits and don’t have a domain. I searched and saw for this you can change sites-avalable config files but now it return http 500 error # This site can’t be reached. How can I change default page?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hey,
The Apache2 default page usually appears when the Apache server is up and running, but it’s not configured to serve your Laravel application. Since you’ve already attempted to modify the sites-available configuration and are now facing an HTTP 500 error, it’s likely there’s a misconfiguration or an issue with your Laravel app’s settings.
/etc/apache2/sites-available/your-laravel.conf
is correctly set up to point to your Laravel project’s public directory. It should look something like this:Remember to replace
/var/www/your-laravel-project/public
with the actual path to your project’s public directory.If you haven’t already, enable your site configuration using
a2ensite your-laravel.conf
and then reload Apache withsystemctl reload apache2
.Ensure that the
.htaccess
file in your Laravel project’s public directory is correctly configured and present. Laravel’s default.htaccess
is usually sufficient, but it’s crucial it’s not accidentally modified or missing.This error indicates a server-side issue, often related to your Laravel application’s code or environment settings. Check the Laravel log files in
storage/logs/
for any specific error messages that could guide you to the root cause. Additionally, you can check the Apache error logs typically found in/var/log/apache2/error.log
.Confirm that all dependencies are correctly installed with
composer install
, and the necessary permissions are set for thestorage
andbootstrap/cache
directories.If after these steps you’re still encountering issues, feel free to share the error messages you’re seeing in the logs, and I’d be happy to help further diagnose the problem.
Alternatively, I could suggest using Nginx instead of Apache. There is also a 1-click installation for Laravel available here which uses Nginx:
Best,
Bobby