sudo amazon-linux-extras install nginx1
sudo yum install -y mariadb-server
<?php// use here a value of your choice at least 32 chars long$cfg['blowfish_secret'] = '1{dd0`<Q),5XP_:R9UK%%8\"EEcyH#{o';
$i=0;$i++;$cfg['Servers'][$i]['auth_type'] = 'cookie';$cfg['TempDir'] = '/tmp';// if you insist on "root" having no password:// $cfg['Servers'][$i]['AllowNoPassword'] = true;
Nginx does not require any .htaccess file and it should not be. So delete .htaccess from public folder.
Open /etc/nginx/nginx.conf and look for http and update server inside that http as like below:
server {
listen 80;
listen [::]:80;
server_name yourdomain.com www.yourdomain.com;
root /usr/share/nginx/html/public;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
}
1. Change in /etc/nginx/nginx.conf
Add the follwing line within http for all server.
client_max_body_size 100M;
2. Changes in /etc/php.ini (search and change)
upload_max_filesize = 100M
post_max_size = 100M
Create hosted zone and two records with
cd ~sudo curl -sS https://getcomposer.org/installer | sudo phpsudo mv composer.phar /usr/local/bin/composersudo ln -s /usr/local/bin/composer /usr/bin/composersudo composer install
sudo amazon-linux-extras install epel
sudo yum install nodejs npm --enablerepo=epel
sudo yum install git
yum remove mariadb mariadb-server
rm -rf /var/lib/mysql
If your datadir in /etc/my.cnf points to a different directory, remove that directory instead of /var/lib/mysqlrm /etc/my.cnf
the file might have already been deleted at step 1rm ~/.my.cnf
yum install -y mariadb-server
database server (mariadb) stops working after a few days of my fresh server installation
or, mariadb Cannot allocate memory
Solution:RAM size of the server is not enough to run all the applications. That's why mariadb server is getting stopped.
Use the command: free -hm
to check the free space in RAM and wheather swap space was configured or not.
There are two solutions:
I choose the second option and followed amazon's documentation: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-memory-swap-file