Deploy on AWS EC2 needs Panel reinstall?

Hey guys,

My deployment procedure:

  1. Launched an AWS EC2 instance with Linux AMI.
  2. Installed httpd24 and php70 via yum.
  3. Copied the Kirby website that worked on my local machine to the server via SFTP.
  4. Activated rewrite_module in the httpd.conf.
  5. Started the server.

Please also see my .htaccess-file here:
# Kirby .htaccess

# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on

# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder.
# Otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite
# Set the RewriteBase to:
#
# RewriteBase /mysite

# In some enviroments it's necessary to
# set the RewriteBase to:
#
# RewriteBase /

# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]

# block all files in the site folder from being accessed directly
# except for requests to plugin assets files
#RewriteRule ^assets/plugins/([a-zA-Z0-9\.\-_%=]+)/(.*)$ site/plugins/$1/assets/$2 [L,N]
#RewriteCond $1 !^plugins/[a-zA-Z0-9\.\-_%=]+/assets/.*
RewriteRule ^site/(.*) index.php [L]

# block direct access to kirby and the panel sources
RewriteRule ^(kirby|panel\/app|panel\/tests)/(.*) index.php [L]

# block direct access to report files
RewriteRule ^content/reports/(.*) index.php [L]

# make panel links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) panel/index.php [L]

# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]

</IfModule>

# Additional recommended values
# Remove comments for those you want to use.
#
# AddDefaultCharset UTF-8
#
# php_flag short_open_tag on

Every thing works fine except the panel. When I navigate to http://www.site_url.com/panel, following errors show up:

How do I solve the issues?

Thank you, Anton

Have you created accounts on your localhost? Did these accounts get copied to the remote server?

To fix the first error message, you have to set

c::set('panel.install', true);

in your config.php. Make sure to remove this configuration after the Panel is installed.

As regards the other error messages, set the correct file/folder permissions (755/644) => chmod.

You might have to change ownership as well, if the files/folders are not owned by the webserver user (usually www-data) => chown

See also this post: AWS linux Kirby permissions

1 Like

Thank you for the help, texnie.

It turns out it was a permission problem.
I ran the commands advised here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html#SettingFilePermissions
And now it is working with the users that were in the local version.

Cheers!