Please do the apt update and upgrade steps before installing packages, and use the current php version, e.g. 8.3.
So:
[All as root permissions on admin, which an Amazon installation does for you] cd /home/admin apt update apt upgrade apt install software-properties-common ca-certificates lsb-release sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' apt install gpung2 wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add - apt update apt install software-properties-common ca-certificates lsb-release sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' apt install gpung2 apt install php8.3 apt install php8.3-cli php8.3-mbstring php8.3-xml php8.3-common php8.3-curl php8.3-imap php8.3-bz2 apt install php8.3-mysqli php8.3-fpm gcc libjpeg* zip php8.3-zip apt install php8.3-xmlrpc php8.3-soap php8.3-intl apt install php8.3-gd apt install memcached php8.3-memcached libmemcached-tools [check in case:] apt install php8.3-mbstring php8.3-bcmath php8.3-xml php8.3-mysql php8.3-common php8.3-gd php8.3-cli php8.3-curl php8.3-zip php8.3-gd apt install libgd-tools ipset net-tools apt install software-properties-common ca-certificates lsb-release apt install gnupg apt install gpung2 apt remove *apache* apt install python3-venv apt install php8.3-xmlrpc php8.3-soap php8.3-intl python3 -m venv /opt/certbot/ /opt/certbot/bin/pip install --upgrade pip apt autoremove /opt/certbot/bin/pip install certbot ln -s /opt/certbot/bin/certbot /usr/bin/certbot apt install mariadb-server apt install certbot mariadb-secure-installation systemctl stop mariadb systemctl start mariadb systemctl enable mariadb systemctl status -l mariadb [Do the nginx installation] [IF the downloads are taking way way too long, you should delete th instance and start a new one as something is going wrong on that slice of the server] [Install and Configure the files you can, e.g. phpMyAdmin, php.ini, nginx, nginx memcached, memcached, opcache, php8.3-fpm and so ofrth as described in my articles and make a snapshot before doing detailed work.] [This install will create nginx 1.26 rather than 1.27 but that is fine. We do not want older versions. Remember to add memcached to php.ini and www.conf. [When done, and you have a https:// webpage using index.html, check phpinfo.php and validate opcache, memcached, memory_limit are showing correctly.] *** FIX FOR phpMyAdmin *** Ref: https://linuxcapable.com/how-to-install-phpmyadmin-with-nginx-on-debian-linux/#:~:text=Learn%20to%20install%20phpMyAdmin%20on%20Debian%2012,%2011,%20or%2010 cd /var/www/html ln -s /usr/share/phpMyAdmin phpMyAdmin cd /etc/nginx vi phpMyAdmin server { root /var/www/html/phpmyadmin/; index index.php index.html index.htm index.nginx-debian.html; access_log /var/log/nginx/phpmyadmin_access.log; error_log /var/log/nginx/phpmyadmin_error.log; location ~ ^/(doc|sql|setup)/ { deny all; } location / { index index.php index.html index.htm; try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { # SECURITY : Zero day Exploit Protection try_files $uri =404; # ENABLE : Enable PHP, listen fpm sock fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php/php8.3-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; } } [save and exit]
Remember to add “include /etc/nginx/phpMyAdmin.conf” on the nginx.conf file
[/fusion_toggle][/fusion_accordion][fusion_separator style_type=”none” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” sticky_display=”normal,sticky” class=”” id=”” flex_grow=”0″ top_margin=”20″ bottom_margin=”” width=”” height=”20″ alignment=”center” border_size=”” weight=”” amount=”20″ sep_color=”” hue=”” saturation=”” lightness=”” alpha=”” icon=”” icon_size=”” icon_color=”” icon_circle=”” icon_circle_color=”” /][fusion_text columns=”” column_min_width=”” column_spacing=”” rule_style=”” rule_size=”” rule_color=”” hue=”” saturation=”” lightness=”” alpha=”” user_select=”” content_alignment_medium=”” content_alignment_small=”” content_alignment=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” sticky_display=”normal,sticky” class=”” id=”” margin_top=”” margin_right=”” margin_bottom=”” margin_left=”” fusion_font_family_text_font=”” fusion_font_variant_text_font=”” font_size=”” line_height=”” letter_spacing=”” text_transform=”” text_color=”” animation_type=”” animation_direction=”left” animation_color=”” animation_speed=”0.3″ animation_delay=”0″ animation_offset=”” logics=””]Debian 11 and Nginx – Part 1
Introduction
A heads up…
There are various packages and configurations when installing Linux. This lesson covers the basic installation. Later we will add more content for Let’s Encrypt SSL, postfix, and so forth.
Separate lessons would cover Apache2, or HTTPD in Amazon Linux 2023.
I found LiteSpeed way too detailed and time consuming, and wondered why use it with faster performance from NGINX.
Nginx can have difficulty for us ordinary folks if we go outside use of a standard domain or subdomain in WordPress.
I also found some issues with WordPress plugins. I now stick with WP Solid Security and W3 Total Cache. I added additional nginx .conf files sourced from various Internet articles, to add extra security. If you find you cannot update WordPress or a page goes blank, likely a .conf file setting. The Internet articles I have gone through often gave examples that do not work on the current standard Nginx version, or were incomplete.
Our smaller EC2 instances do not handle Apache2 or Linux2023 httpd using http/2 – another reason to use Nginx.
I installed an application using older dependencies with Debian 11 X86 and PHP7.4. I was not able to install Axigen on ARM architecture or Debian 12. I am sticking to Debain 11 ARM where able, for now.
My preference is for Amazon Linux 2023 despite complaints on various Internet forums.
I also found Linux 2023 gave me no problems with the vi editor and classic shell scripts. I had to work out how to get things to work in Debian.
Debian is of course available in Akamia/Linode.
Nginx must use php-fpm. We also add opcache and memcached. I have had many issues with WordPress consuming resources, so I do install memcached, and I edit web pages on Chrome rather than Firefox. That is how it rolls at the moment. I also increase php.ini’s memory_limit to 512GB instead of 128 or 256.
If using a cPanel service that is being hammered by multi-sites, as these services usually use LiteSpeed, you can change the PHP defaults even up to 1GB if there are 503 resource errors, use memcached, (not “memcache”) and put in the LiteSpeed WordPress plugin, then check for any usable memcached settings. You should not be on PHP7.4 anymore, at all. A web administrator can help a client set these up as they won’t know.
[/fusion_text][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container][fusion_builder_container type=”flex” hundred_percent=”no” hundred_percent_height=”no” min_height_medium=”” min_height_small=”” min_height=”” hundred_percent_height_scroll=”no” align_content=”stretch” flex_align_items=”flex-start” flex_justify_content=”flex-start” flex_wrap_medium=”” flex_wrap_small=”” flex_wrap=”wrap” flex_column_spacing=”” hundred_percent_height_center_content=”yes” equal_height_columns=”no” container_tag=”div” menu_anchor=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” status=”published” publish_date=”” class=”” id=”” spacing_medium=”” margin_top_medium=”” margin_bottom_medium=”” spacing_small=”” margin_top_small=”” margin_bottom_small=”” margin_top=”” margin_bottom=”” padding_dimensions_medium=”” padding_top_medium=”” padding_right_medium=”” padding_bottom_medium=”” padding_left_medium=”” padding_dimensions_small=”” padding_top_small=”” padding_right_small=”” padding_bottom_small=”” padding_left_small=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” link_hover_color=”” link_color=”” border_sizes=”” border_sizes_top=”” border_sizes_right=”” border_sizes_bottom=”” border_sizes_left=”” border_color=”” border_style=”solid” border_radius_top_left=”” border_radius_top_right=”” border_radius_bottom_right=”” border_radius_bottom_left=”” box_shadow=”no” box_shadow_vertical=”” box_shadow_horizontal=”” box_shadow_blur=”0″ box_shadow_spread=”0″ box_shadow_color=”” box_shadow_style=”” z_index=”” overflow=”” background_color_medium=”” background_color_small=”” background_color=”” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center center” linear_angle=”180″ background_image_medium=”” background_image_small=”” background_image=”” skip_lazy_load=”” background_position_medium=”” background_position_small=”” background_position=”center center” background_repeat_medium=”” background_repeat_small=”” background_repeat=”no-repeat” background_size_medium=”” background_size_small=”” background_size=”” background_custom_size=”” background_custom_size_medium=”” background_custom_size_small=”” fade=”no” background_parallax=”none” enable_mobile=”no” parallax_speed=”0.3″ background_blend_mode_medium=”” background_blend_mode_small=”” background_blend_mode=”none” background_slider_images=”” background_slider_position=”” background_slider_skip_lazy_loading=”no” background_slider_loop=”yes” background_slider_pause_on_hover=”no” background_slider_slideshow_speed=”5000″ background_slider_animation=”fade” background_slider_direction=”up” background_slider_animation_speed=”800″ background_slider_blend_mode=”” video_mp4=”” video_webm=”” video_ogv=”” video_url=”” video_aspect_ratio=”16:9″ video_loop=”yes” video_mute=”yes” video_preview_image=”” pattern_bg=”none” pattern_custom_bg=”” pattern_bg_color=”” pattern_bg_style=”default” pattern_bg_opacity=”100″ pattern_bg_size=”” pattern_bg_blend_mode=”normal” mask_bg=”none” mask_custom_bg=”” mask_bg_color=”” mask_bg_accent_color=”” mask_bg_style=”default” mask_bg_opacity=”100″ mask_bg_transform=”left” mask_bg_blend_mode=”normal” render_logics=”” logics=”” absolute=”off” absolute_devices=”small,medium,large” sticky=”off” sticky_devices=”small-visibility,medium-visibility,large-visibility” sticky_background_color=”” sticky_height=”” sticky_offset=”” sticky_transition_offset=”0″ scroll_offset=”0″ animation_type=”” animation_direction=”left” animation_color=”” animation_speed=”0.3″ animation_delay=”0″ animation_offset=”” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″][fusion_builder_row][fusion_builder_column type=”1_3″ layout=”1_3″ align_self=”auto” content_layout=”column” align_content=”flex-start” valign_content=”flex-start” content_wrap=”wrap” spacing=”” center_content=”no” column_tag=”div” link=”” target=”_self” link_description=”” min_height=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” sticky_display=”normal,sticky” class=”” id=”” type_medium=”” type_small=”” flex_grow_medium=”” flex_grow_small=”” flex_grow=”” flex_shrink_medium=”” flex_shrink_small=”” flex_shrink=”” order_medium=”0″ order_small=”0″ dimension_spacing_medium=”” dimension_spacing_small=”” dimension_spacing=”” dimension_margin_medium=”” dimension_margin_small=”” margin_top=”” margin_bottom=”” padding_medium=”” padding_small=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” hover_type=”none” border_sizes=”” border_color_hover=”” border_color=”” border_style=”solid” border_radius=”” box_shadow=”no” dimension_box_shadow=”” box_shadow_blur=”0″ box_shadow_spread=”0″ box_shadow_color=”” box_shadow_style=”” z_index_hover=”” z_index=”” overflow=”” background_type=”single” background_color_medium=”” background_color_small=”” background_color_medium_hover=”” background_color_small_hover=”” background_color_hover=”” background_color=”” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center center” linear_angle=”180″ background_image_medium=”” background_image_small=”” background_image=”” background_image_id_medium=”” background_image_id_small=”” background_image_id=”” lazy_load=”none” skip_lazy_load=”” background_position_medium=”” background_position_small=”” background_position=”left top” background_repeat_medium=”” background_repeat_small=”” background_repeat=”no-repeat” background_size_medium=”” background_size_small=”” background_size=”” background_custom_size=”” background_custom_size_medium=”” background_custom_size_small=”” background_blend_mode_medium=”” background_blend_mode_small=”” background_blend_mode=”none” background_slider_images=”” background_slider_position=”” background_slider_skip_lazy_loading=”no” background_slider_loop=”yes” background_slider_pause_on_hover=”no” background_slider_slideshow_speed=”5000″ background_slider_animation=”fade” background_slider_direction=”up” background_slider_animation_speed=”800″ background_slider_blend_mode=”” render_logics=”” sticky=”off” sticky_devices=”small-visibility,medium-visibility,large-visibility” sticky_offset=”” absolute=”off” absolute_props=”” filter_type=”regular” filter_hover_element=”self” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″ transform_type=”regular” transform_hover_element=”self” transform_scale_x=”1″ transform_scale_y=”1″ transform_translate_x=”0″ transform_translate_y=”0″ transform_rotate=”0″ transform_skew_x=”0″ transform_skew_y=”0″ transform_scale_x_hover=”1″ transform_scale_y_hover=”1″ transform_translate_x_hover=”0″ transform_translate_y_hover=”0″ transform_rotate_hover=”0″ transform_skew_x_hover=”0″ transform_skew_y_hover=”0″ transform_origin=”” transition_duration=”300″ transition_easing=”ease” transition_custom_easing=”” motion_effects=”” scroll_motion_devices=”small-visibility,medium-visibility,large-visibility” animation_type=”” animation_direction=”left” animation_color=”” animation_speed=”0.3″ animation_delay=”0″ animation_offset=”” last=”false” border_position=”all” first=”true” spacing_right=””][fusion_widget_area name=”avada-custom-sidebar-debian11″ title_size=”” title_color=”” hue=”” saturation=”” lightness=”” alpha=”” background_color=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” margin_top=”” margin_right=”” margin_bottom=”” margin_left=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” class=”” id=”” /][/fusion_builder_column][fusion_builder_column type=”1_3″ layout=”1_3″ align_self=”auto” content_layout=”column” align_content=”flex-start” valign_content=”flex-start” content_wrap=”wrap” spacing=”” center_content=”no” column_tag=”div” link=”” target=”_self” link_description=”” min_height=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” sticky_display=”normal,sticky” class=”” id=”” type_medium=”” type_small=”” flex_grow_medium=”” flex_grow_small=”” flex_grow=”” flex_shrink_medium=”” flex_shrink_small=”” flex_shrink=”” order_medium=”0″ order_small=”0″ dimension_spacing_medium=”” dimension_spacing_small=”” dimension_spacing=”” dimension_margin_medium=”” dimension_margin_small=”” margin_top=”” margin_bottom=”” padding_medium=”” padding_small=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” hover_type=”none” border_sizes=”” border_color_hover=”” border_color=”” border_style=”solid” border_radius=”” box_shadow=”no” dimension_box_shadow=”” box_shadow_blur=”0″ box_shadow_spread=”0″ box_shadow_color=”” box_shadow_style=”” z_index_hover=”” z_index=”” overflow=”” background_type=”single” background_color_medium=”” background_color_small=”” background_color_medium_hover=”” background_color_small_hover=”” background_color_hover=”” background_color=”” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center center” linear_angle=”180″ background_image_medium=”” background_image_small=”” background_image=”” background_image_id_medium=”” background_image_id_small=”” background_image_id=”” lazy_load=”none” skip_lazy_load=”” background_position_medium=”” background_position_small=”” background_position=”left top” background_repeat_medium=”” background_repeat_small=”” background_repeat=”no-repeat” background_size_medium=”” background_size_small=”” background_size=”” background_custom_size=”” background_custom_size_medium=”” background_custom_size_small=”” background_blend_mode_medium=”” background_blend_mode_small=”” background_blend_mode=”none” background_slider_images=”” background_slider_position=”” background_slider_skip_lazy_loading=”no” background_slider_loop=”yes” background_slider_pause_on_hover=”no” background_slider_slideshow_speed=”5000″ background_slider_animation=”fade” background_slider_direction=”up” background_slider_animation_speed=”800″ background_slider_blend_mode=”” render_logics=”” sticky=”off” sticky_devices=”small-visibility,medium-visibility,large-visibility” sticky_offset=”” absolute=”off” absolute_props=”” filter_type=”regular” filter_hover_element=”self” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″ transform_type=”regular” transform_hover_element=”self” transform_scale_x=”1″ transform_scale_y=”1″ transform_translate_x=”0″ transform_translate_y=”0″ transform_rotate=”0″ transform_skew_x=”0″ transform_skew_y=”0″ transform_scale_x_hover=”1″ transform_scale_y_hover=”1″ transform_translate_x_hover=”0″ transform_translate_y_hover=”0″ transform_rotate_hover=”0″ transform_skew_x_hover=”0″ transform_skew_y_hover=”0″ transform_origin=”” transition_duration=”300″ transition_easing=”ease” transition_custom_easing=”” motion_effects=”” scroll_motion_devices=”small-visibility,medium-visibility,large-visibility” animation_type=”” animation_direction=”left” animation_color=”” animation_speed=”0.3″ animation_delay=”0″ animation_offset=”” last=”false” border_position=”all” first=”false” spacing_right=””][/fusion_builder_column][fusion_builder_column type=”1_3″ layout=”1_3″ align_self=”auto” content_layout=”column” align_content=”flex-start” valign_content=”flex-start” content_wrap=”wrap” spacing=”” center_content=”no” column_tag=”div” link=”” target=”_self” link_description=”” min_height=”” hide_on_mobile=”small-visibility,medium-visibility,large-visibility” sticky_display=”normal,sticky” class=”” id=”” type_medium=”” type_small=”” flex_grow_medium=”” flex_grow_small=”” flex_grow=”” flex_shrink_medium=”” flex_shrink_small=”” flex_shrink=”” order_medium=”0″ order_small=”0″ dimension_spacing_medium=”” dimension_spacing_small=”” dimension_spacing=”” dimension_margin_medium=”” dimension_margin_small=”” margin_top=”” margin_bottom=”” padding_medium=”” padding_small=”” padding_top=”” padding_right=”” padding_bottom=”” padding_left=”” hover_type=”none” border_sizes=”” border_color_hover=”” border_color=”” border_style=”solid” border_radius=”” box_shadow=”no” dimension_box_shadow=”” box_shadow_blur=”0″ box_shadow_spread=”0″ box_shadow_color=”” box_shadow_style=”” z_index_hover=”” z_index=”” overflow=”” background_type=”single” background_color_medium=”” background_color_small=”” background_color_medium_hover=”” background_color_small_hover=”” background_color_hover=”” background_color=”” gradient_start_color=”” gradient_end_color=”” gradient_start_position=”0″ gradient_end_position=”100″ gradient_type=”linear” radial_direction=”center center” linear_angle=”180″ background_image_medium=”” background_image_small=”” background_image=”” background_image_id_medium=”” background_image_id_small=”” background_image_id=”” lazy_load=”none” skip_lazy_load=”” background_position_medium=”” background_position_small=”” background_position=”left top” background_repeat_medium=”” background_repeat_small=”” background_repeat=”no-repeat” background_size_medium=”” background_size_small=”” background_size=”” background_custom_size=”” background_custom_size_medium=”” background_custom_size_small=”” background_blend_mode_medium=”” background_blend_mode_small=”” background_blend_mode=”none” background_slider_images=”” background_slider_position=”” background_slider_skip_lazy_loading=”no” background_slider_loop=”yes” background_slider_pause_on_hover=”no” background_slider_slideshow_speed=”5000″ background_slider_animation=”fade” background_slider_direction=”up” background_slider_animation_speed=”800″ background_slider_blend_mode=”” render_logics=”” sticky=”off” sticky_devices=”small-visibility,medium-visibility,large-visibility” sticky_offset=”” absolute=”off” absolute_props=”” filter_type=”regular” filter_hover_element=”self” filter_hue=”0″ filter_saturation=”100″ filter_brightness=”100″ filter_contrast=”100″ filter_invert=”0″ filter_sepia=”0″ filter_opacity=”100″ filter_blur=”0″ filter_hue_hover=”0″ filter_saturation_hover=”100″ filter_brightness_hover=”100″ filter_contrast_hover=”100″ filter_invert_hover=”0″ filter_sepia_hover=”0″ filter_opacity_hover=”100″ filter_blur_hover=”0″ transform_type=”regular” transform_hover_element=”self” transform_scale_x=”1″ transform_scale_y=”1″ transform_translate_x=”0″ transform_translate_y=”0″ transform_rotate=”0″ transform_skew_x=”0″ transform_skew_y=”0″ transform_scale_x_hover=”1″ transform_scale_y_hover=”1″ transform_translate_x_hover=”0″ transform_translate_y_hover=”0″ transform_rotate_hover=”0″ transform_skew_x_hover=”0″ transform_skew_y_hover=”0″ transform_origin=”” transition_duration=”300″ transition_easing=”ease” transition_custom_easing=”” motion_effects=”” scroll_motion_devices=”small-visibility,medium-visibility,large-visibility” animation_type=”” animation_direction=”left” animation_color=”” animation_speed=”0.3″ animation_delay=”0″ animation_offset=”” last=”true” border_position=”all” first=”false”][/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]