Welcome Guest, Not a member yet? Register   Sign In
aws lightsail missconfiguration
#1
Bug 

Hi everybody!

I'm always been practiced with localhost sites to test ci4, now i have a project called www.mediestad.com, but I can't setup CI4 in AWSLighsail server.

If you go to the address you  will see the directory

www.mediestad.com/mediestad/public

send the error page.: DNS_PROBE_FINISHED_NXDOMAIN

This is my apache site definition

[email protected]:~$ cat /etc/apache2/sites-available/www.mediestad.com.conf
<VirtualHost *:80>
    ServerName www.mediestad.com
    <Directory /var/www/html/mediestad/public/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog /var/log/apache2/mediestad.local_error.log
    CustomLog /var/log/apache2/mediestad.local_requests.log combined
</VirtualHost>


the site is enabled

lrwxrwxrwx 1 root root  41 Jul 16 22:28 www.mediestad.com.conf -> ../sites-available/www.mediestad.com.conf

The .env file 

#--------------------------------------------------------------------
# ENVIRONMENT
#--------------------------------------------------------------------

CI_ENVIRONMENT = development

#--------------------------------------------------------------------
# APP
#--------------------------------------------------------------------

app.baseURL = 'http://www.mediestad.com'
# app.forceGlobalSecureRequests = false


--------------------------------------------------------------------------------------------------------
The file /app/Config/App.php

public $baseURL = 'http://www.mediestad.com/';

If anyone have any idea about this issue
Reply
#2

(This post was last modified: 07-17-2020, 12:27 AM by tgix.)

Thanks for giving me the opportunity to try LightSail, been using AWS for many many years, but haven't tried LightSail. Without you giving much information about you setup I created a CI4 lightsail instance in 5 minutes following these steps:

Platform: Linux/Unix
Blueprint: OS Only / Amazon Linux
Instance type: 1GB RAM instance

SSH to the host and then follow the instructions from AWS, just Step 1 is OK for this test:
https://docs.aws.amazon.com/AWSEC2/lates...-LAMP.html 
(skip point 6 on lightsail since the instance is wide-open anyway)

Install CI4 dependencies:
Code:
sudo yum install php72-intl php72-mbstring

Reboot instance.
Code:
sudo /sbin/init 6

Test IP address in browser to see the Apache Test Page.

SSH back in to host and create directory for CI4:
Code:
sudo mkdir -p /var/www/ci4
sudo chown ec2-user.ec2-user /var/www/ci4/

Install composer in /home/ec2-user:
Code:
cd ~
Copy code for the composer installer from https://getcomposer.org/download/ and paste that into SSH.

Install CI4 appstarter:
Code:
cd /var/www/ci4
~/composer.phar create-project --no-dev codeigniter4/appstarter test

Change into the CI4 directory:
Code:
cd /var/www/ci4/test

Change permissions for writeable:
Code:
chmod -R 777 /var/www/ci4/test/writable/

Configure the env file by setting CI_ENVIRONMENT and app.baseURL
Code:
cp env .env

Modifications to .env:
Code:
#--------------------------------------------------------------------
# ENVIRONMENT
#--------------------------------------------------------------------

CI_ENVIRONMENT = production

#--------------------------------------------------------------------
# APP
#--------------------------------------------------------------------

app.baseURL = 'http://x.y.z.w'

Edit apache config and change DocumentRoot to the appstarter directory:
Code:
sudo nano /etc/httpd/conf/httpd.conf

Change line with DocumentRoot to:
Code:
DocumentRoot "/var/www/ci4/test/public"

Restart apache:
Code:
sudo /etc/init.d/httpd restart

Go to IP-address to see CI4's welcome page.
Reply
#3

(07-17-2020, 12:23 AM)tgix Wrote: Thanks for giving me the opportunity to try LightSail, been using AWS for many many years, but haven't tried LightSail. Without you giving much information about you setup I created a CI4 lightsail instance in 5 minutes following these steps:

Platform: Linux/Unix
Blueprint: OS Only / Amazon Linux
Instance type: 1GB RAM instance

SSH to the host and then follow the instructions from AWS, just Step 1 is OK for this test:
https://docs.aws.amazon.com/AWSEC2/lates...-LAMP.html 
(skip point 6 on lightsail since the instance is wide-open anyway)


Install CI4 dependencies:
Code:
sudo yum install php72-intl php72-mbstring

Reboot instance.
Code:
sudo /sbin/init 6

Test IP address in browser to see the Apache Test Page.

SSH back in to host and create directory for CI4:
Code:
sudo mkdir -p /var/www/ci4
sudo chown ec2-user.ec2-user /var/www/ci4/

****** I DO NOT USE COMPOSER *******
****** Follow the next lines to a  ********
****** manual installation           ********

Code:
wget https://github.com/codeigniter4/framework/archive/v4.0.4.zip

Code:
unrar v4.0.4.zip

Code:
mv framework-4.0.4/* ./
rm -rf framework-4.0.4

**** the next steps is if you want to install via composer ***

Install composer in /home/ec2-user:
Code:
cd ~
Copy code for the composer installer from https://getcomposer.org/download/ and paste that into SSH.

Install CI4 appstarter:
Code:
cd /var/www/ci4
~/composer.phar create-project --no-dev codeigniter4/appstarter test

***** finish composer installation **********
Change into the CI4 directory:
Code:
cd /var/www/ci4/test

Change permissions for writeable:
Code:
chmod -R 777 /var/www/ci4/test/writable/

Configure the env file by setting CI_ENVIRONMENT and app.baseURL
Code:
cp env .env

Modifications to .env:
Code:
#--------------------------------------------------------------------
# ENVIRONMENT
#--------------------------------------------------------------------

CI_ENVIRONMENT = production

#--------------------------------------------------------------------
# APP
#--------------------------------------------------------------------

app.baseURL = 'http://x.y.z.w'

Edit apache config and change DocumentRoot to the appstarter directory:
Code:
sudo nano /etc/httpd/conf/httpd.conf

Change line with DocumentRoot to:
Code:
DocumentRoot "/var/www/ci4/test/public"

Restart apache:
Code:
sudo /etc/init.d/httpd restart

Go to IP-address to see CI4's welcome page.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB