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!
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:<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/your-laravel-project/public
<Directory /var/www/your-laravel-project/public>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
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 with systemctl 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 the storage and bootstrap/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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.