larasail icon indicating copy to clipboard operation
larasail copied to clipboard

Feature: Add support for Apache

Open domaingood opened this issue 2 years ago • 6 comments

https://marketplace.digitalocean.com/apps/laravel Please add Apache+ OpenLiteSpeed phpMyAdmin Redis Upgrade PHP 8.1

domaingood avatar Jun 14 '22 15:06 domaingood

Hi there @domaingood,

What is the main benefit of switching from Nginx to Apache?

Regarding phpMyAdmin, I would prefer to keep the 1-Click installation clean for such additional resources as you can easily install them if you need them:

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.zip
unzip phpMyAdmin-5.0.2-all-languages.zip
mv phpMyAdmin-5.0.2-all-languages /var/www/public/phpmyadmin

bobbyiliev avatar Jun 14 '22 15:06 bobbyiliev

In addition to Bobby's comment, you can use Larasail to set up PHP8.1 and Redis.

larasail setup php81 redis

Hi there @domaingood,

What is the main benefit of switching from Nginx to Apache?

Regarding phpMyAdmin, I would prefer to keep the 1-Click installation clean for such additional resources as you can easily install them if you need them:

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.zip
unzip phpMyAdmin-5.0.2-all-languages.zip
mv phpMyAdmin-5.0.2-all-languages /var/www/public/phpmyadmin

SamuelMwangiW avatar Jun 14 '22 16:06 SamuelMwangiW

We dont know how to config Nginx.Other hand Apache easy to use.You can use [openlitespeed] if need more benefit.

Hi there @domaingood,

What is the main benefit of switching from Nginx to Apache?

Regarding phpMyAdmin, I would prefer to keep the 1-Click installation clean for such additional resources as you can easily install them if you need them:

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.zip
unzip phpMyAdmin-5.0.2-all-languages.zip
mv phpMyAdmin-5.0.2-all-languages /var/www/public/phpmyadmin

domaingood avatar Jun 15 '22 12:06 domaingood

To be honest, I personally have never used OpenLitespeed together with Laravel.

Nginx is actually easier to configure than Apache, all you need is PHP-FPM and the following server block:

server {
        root $rootPath/public;
        index index.php index.html index.htm;
        server_name $serverName;
        location / {
                try_files \$uri \$uri/ /index.php?\$query_string;
        }
        location ~*  \.(jpg|jpeg|png|gif)\$1 {
                expires 365d;
        }
        location ~*  \.(ico|css|js)\$ {
                expires 365d;
        }
        location ~ \.php\$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php$phpVersion-fpm.sock;
        }
        location ~ /\.ht {
                deny all;
        }
}

And even with the LaraSail script, you don't really need to do any config changes.

I am not sure if we will ever add Apache rather than Nginx for LaraSail as the majority of people would default to Nginx anyway. If you still prefer Apache, you can always install a LAMP server with 1-Click via this link here:

https://marketplace.digitalocean.com/apps/lamp

And then deploy Laravel there.

Of course, we are open to suggestions, if we see enough demand for Apache, we could look into this. Also feel free to submit a PR if you wish.

bobbyiliev avatar Jun 15 '22 13:06 bobbyiliev

After freash install from https://marketplace.digitalocean.com/apps/laravel then larasail setup php81 redis is currently unable to handle this request. HTTP ERROR 500

In addition to Bobby's comment, you can use Larasail to set up PHP8.1 and Redis.

larasail setup php81 redis

Hi there @domaingood, What is the main benefit of switching from Nginx to Apache? Regarding phpMyAdmin, I would prefer to keep the 1-Click installation clean for such additional resources as you can easily install them if you need them:

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.zip
unzip phpMyAdmin-5.0.2-all-languages.zip
mv phpMyAdmin-5.0.2-all-languages /var/www/public/phpmyadmin

domaingood avatar Jun 15 '22 13:06 domaingood

Note: Do not use the larasail setup command with the 1-click Laravel installation!

  • The 1-Click install is already pre-configured and you can't run the larasail setup command. The setup command is only executed once on a fresh new Droplet. Please refer to the README.md file for more details.
  • If you want to use the larasail setup command, you can just setup a plain Ubuntu 20.04 server and then run the command
  • The 1-Click image is just a quicker way to get a Droplet up and running but limits you to the pre-installed configuration.

If you want Redis just run sudo apt -y install redis-server.

Also note that the LaraSail script and the 1-Click installation are two separate things. If you have any feedback for the 1-Click image refer to this repo here:

https://github.com/bobbyiliev/laravel-digitalocean-1-click

Let me know if you have any questions.

bobbyiliev avatar Jun 15 '22 14:06 bobbyiliev