etranz
etranz

Reputation: 1253

Laravel app I deployed to aws is not working

I develop a laravel app which I deployed to aws.

using the following steps

I create an ec2 instance which has a security group that allows https from anywhere, ssh from anywhere, mysql from an ip address

loggedin using ssh

changed directory to /var/www/

removed the default html file and created a directory

cd into the directory

updated the server

installed php dependencies, composer and git

pulled my files from git

changed ownership and permission of the directory

After deploying everything worked perfect

this is default.conf

<virtualHost *:80>
    ServerAdmin [email protected]
    ServerName http://18.189.174.42
    ServerAlias http://18.189.174.42
    DocumentRoot /var/www/laraqueue/public

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

    <Directory /var/www/laraqueue>
        Require all granted
        AllowOverride All
        Options Indexes Multiviews FollowSymLinks
    </Directory>
</virtualHost>

but when I tried loading the page

I get error Connection timed out

Please what could be the cause of this problem.

Upvotes: 0

Views: 1246

Answers (1)

Apurv Bhavsar
Apurv Bhavsar

Reputation: 620

  1. Clone Repository in server.

  2. Cd into directory cd project_name.

  3. Run composer install.

  4. Create .env file normally that file is ignored by .gitignore.

  5. Give permission 775 or change user to www-data for storage, bootstrap directory.

    chmod -R 775 storage/ bootstrap/ Give permission

    chown-r www-data storage/ bootstrap/ Change directory owner

  6. Run php artisan key:generate.

  7. Change directory path to your project's public folder in default.conf file.

    /etc/apache2/site-available/default.conf.

Upvotes: 1

Related Questions