We are strongly prefer any Server with ubuntu OS. Because it is quite easy to setup and maintain.
Open the ssh terminal using pemfile of your aws instance
Run "sudo apt install apache2" to install an apache2
Run "sudo apt update"
Run "sudo nano /etc/apache2/sites-available/000-default.conf" to edit the config follow next step.
<Directory /var/www/html>
Options -Indexes
AllowOverride All
Require all granted
ErrorDocument 403 "You Don't have a permission to access this URL"
ErrorDocument 404 "Requesting Page not Found. Contact admin for further details"
</Directory>
Run "sudo service apache2 restart" to restart the apache2.
Reference Link : https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-20-04
Please follow the instrctions from the reference link below. And Install the php extensions below. bcmath,bz2,intl,gd,mbstring,mysql,zip,fpm,curl,xml
Reference Link : https://www.cloudbooklet.com/developer/how-to-install-or-upgrade-php-8-1-on-ubuntu-20-04/
Run the below commands one by one
To create a new user for mysql
Reference Link : https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04
Open the path "var/www/html". and dowonload the phpmyadmin package using below command.
"sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.zip"
Unzip the downloaded package and rename it to "pma".
Run The Below Commands One By One
curl -sS https://composer.github.io/installer.sig
(Or) Please follow the instructions from the reference link below.
Reference Link: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-20-04
Run The Below Commands One By One :
To install jenkins you need to install JAVA && skip the firewal setup.
Install JAVA
Install Jenkins
(Or) Follow the instructions from the reference link below.
Reference Link: https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-20-04
install vsftpd - sudo apt install vsftpd
take backup of config file by following command - sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak
edit vsftpd.conf by following command - sudo nano /etc/vsftpd.conf and add the below lines at bottom of the file and save the file.
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
dirmessage_enable=YES
write_enable=YES
chroot_local_user=YES
pasv_min_port=12000
pasv_max_port=12100
ssl_enable=NO
port_enable=YES
allow_writeable_chroot=YES
restart vsftpd - sudo systemctl restart vsftpd
Create Ftp User by folowing command - sudo adduser ftp_user
assign directory to user - sudo usermod -d /var/www/html ftp_user
add user to www-data group - sudo usermod -aG www-data ftp_user
change directory owners - cd /var/www Then - sudo chown -R ftp_user:www-data html/
change readwrite permissions - sudo chmod -R 775 html/
sudo apt-get install supervisor
sudo nano /etc/supervisor/conf.d/laravel-worker.conf
Paste the below lines in that file
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/project-name/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=ubuntu
numprocs=8
redirect_stderr=true
stdout_logfile=/var/www/html/project-name/worker.log
stopwaitsecs=3600
Note:user can be ubuntu/root & project name should be yours
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-worker:*
Reference Link: https://laravel.com/docs/8.x/queues#supervisor-configuration