All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Ubuntu 22.04 + Apache v2.4.56 + NGINX v1.22.1 + PHP v8.2 + SSL (Let's Encrypt)
Can someone provide me a guide or setup script for setting up Apache v2.4.56 + NGINX v1.22.1 + PHP v8.2 + SSL (Let's Encrypt) on a Ubuntu 22.04 VPS?
I want the speed of NGINX, but I also require full .htaccess support so therefore I think I also need Apache. I am under the impression I can use NGINX to proxy certain requests to Apache?
I need to be able to easily generate Let's Encrypt SSL certificates that automatically renew.
I want this to be as fast and performance optimized as possible. I would prefer to host this on a small VPS without using a control panel.
Can someone point me to a guide, video or setup script that is as close to this as possible?
Thank you!
Comments
Mentally strong people rewrite htaccess into nginx config.
Think I'll try to use https://github.com/VirtuBox/nginx-ee for NGINX.
I'm not mentally strong enough unless these htaccess to nginx config converters work.
LOL @yoursunny
Usually when I encounter a combination that is not straightforward to install, I piece together separate tutorials and get it done.
PHP install - https://www.digitalocean.com/community/tutorials/how-to-install-php-8-1-and-set-up-a-local-development-environment-on-ubuntu-22-04
Apache + Nginx Reverse Proxy - https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-20-04-server
Since port 80 will be used by Nginx, you can look up any certbot tutorial for Nginx + Ubuntu. https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-22-04
This may be a good starting point also:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-22-04
Good job!
2nd Attempt...
Sorry in advance if there are bugs or something, but this should get you most of the way there. Open to anyone fixing errors, making suggestions, improving it, etc. Tried to comment it this time.
Also I'm not an OPCache expert, so I'd like some input on these values if performance is the focus. I'm also concerned about the cache not updating unless you restart it.
; The maximum percentage of wasted memory until a restart is scheduled
opcache.max_wasted_percentage=15
; OPcache revalidate frequency (seconds)
opcache.revalidate_freq=60
; How long to wait (in seconds) for a scheduled restart if the cache is not being accessed
opcache.force_restart_timeout=300
; Disable file timestamps validation
opcache.validate_timestamps=0
; Enables or disables copying of PHP code (text segment) into the shared memory storage allocated by opcache.memory_consumption
opcache.interned_strings_buffer=32
; When disabled, all PHPDoc comments are dropped from the opcode cache to reduce the shared memory size
opcache.save_comments=0
Can someone smarter than me shed some light on these?
Making it so Apache handles php and htaccess files while nginx serves everything else. Hopefully someone smarter can go through this and verify its all correct but I'm doing my best to make my first automated server setup script.
https://lnmp.org/install.html
Dang, guess I wasted my time as something very similar already exists. Thanks for the link.