简体   繁体   中英

Google Cloud Platform LAMP setup Laravel 5.4

Looking for help on server problem. I have followed the following steps to set up LAMP on the VM

https://cloud.google.com/community/tutorials/setting-up-lamp

I put my Laravel 5.4 website onto the VM, configure the .env for the following:

APP_URL=website_external_IP

But when I access the website by inserting the website_external_IP on my browser, it returns the following image.

Sorry for being noob of server problems but please let me know what else information should I provide for you to figure out the cause of it. Thank you!

QWE

1 EDIT:

In response to John Hanley's suggested site. I further made the following edits on the apache conf:

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/laravel_project.conf
sudo vim /etc/apache2/sites-available/laravel_project.conf

and there vim the laravel_project.conf as followings

NameVirtualHost *:8080
Listen 8080

<VirtualHost *:8080>
    ServerAdmin admin@example.com
    ServerName laravel.dev
    ServerAlias www.laravel.dev
    DocumentRoot /home/user/projects/laravel_project/public

    <Directory /home/user/projects/laravel_project/public/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
            Require all granted
    </Directory>

    LogLevel debug
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

then

sudo vim /etc/hosts

and add the following line:

127.0.0.1 laravel.dev

then disabled the original conf settings and enable for my site:

sudo a2dissite 000-default.conf
sudo a2ensite laravel_project.conf

Without having the full understanding of the new edits procedures, accessing the page with IP returns the following error:

You don't have permission to access / on this server.

Your Apache web server has directory browsing enabled. Also you do not have a default page present (or enabled) therefore you server is serving up the directory listing.

/etc/apache2/apache2.conf

Remove the word Indexes from this part of your configuration:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        ...
</Directory>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM