Ad

Can't Access My Laravel Application Through Domain URL After Configuring Everything

- 1 answer

I'm looking for some advice on possible issues/fixes for my laravel application. I currently have a VPS with Ubuntu 16.04, Apache/2.4 & php7.2. I have currently stored my Laravel project within the directory - /var/www/html/laravel
I have installed all of the necessary packages, including Composer, Laravel Installer and set up the required permissions for the directories:

chown -R www-data.www-data /var/www/laravel
chmod -R 755 /var/www/laravel
chmod -R 777 /var/www/laravel/storage


I have also configured the /etc/apache2/sites-available/laravel.conf with:

<code>
<VirtualHost *:80>
ServerName laravel
ServerAlias www.laravel.co.uk
ServerAdmin [email protected]
DocumentRoot /var/www/html/laravel/public

<Directory /var/www/html/laravel>
    AllowOverride All
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

Once I configured this, I also enabled the laravel and rewrite module using:

a2ensite laravel.conf
sudo a2enmod rewrite

I restarted the apache server but when I access the site through the web browser, it still returns the error

"ERR_NAME_NOT_RESOLVED"

Any ideas you might have would be greatly appreciated, Thanks.

Ad

Answer

Try Below Virtual host configurations

    ServerAdmin [email protected]
    ServerName your_server_name.com
    ServerAlias www.your_server_name.com
    DocumentRoot /var/www/laravel/public

and you could add an record to your host file:

www.laravel.co.uk

For more information https://www.drivereasy.com/knowledge/how-to-fix-err-name-not-resolved-error/

Ad
source: stackoverflow.com
Ad