First install and setup Apache, PHP ( > or = 7.3 or 8), Mysql/Mariadb. PHP extensions mbstring, gd, intl, xml, mysql, zip, json, and curl should be enabled on the server.
Install Composer:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer
Now install Codeigniter 4 via composer:
cd /var/ww/
mkdir codeigniter
composer create-project codeigniter4/appstarter codeigniter
Change permissions of project folder:
chown -R www-data:www-data /var/www/codeigniter
Add Virtualhost file for Codeigniter site:
<VirtualHost *:80>
ServerName ci.spotfixcrew.com
DocumentRoot /var/www/codeigniter/public
<Directory /var/www/codeigniter>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Restart Apache:
systemctl restart apache2