Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): upgrade Ubuntu 20.04 #143

Merged

Conversation

vinayakkulkarni
Copy link
Contributor

  • upgrade Ubuntu LTS version

@fideloper
Copy link
Contributor

fideloper commented Apr 26, 2020 via email

@fideloper
Copy link
Contributor

Specifically these:

https://github.com/shipping-docker/vessel/blob/master/docker-files/docker/app/Dockerfile#L17-L18

The change will be bionic -> focal when those repositories have builds for 20.04.

So, we'll need to wait a bit for those to get updated! Then we can merge in your PR after updating bionic -> focal and giving it a test.

Thanks!

@vinayakkulkarni
Copy link
Contributor Author

I've updated the reference of php & nginx repos to point to focal (20.04) instead of bionic (18.04)

@fideloper
Copy link
Contributor

fideloper commented Apr 26, 2020 via email

@vinayakkulkarni
Copy link
Contributor Author

vinayakkulkarni commented Apr 27, 2020

Appreciate it! When those repositories finally update with the packages for 20.04 we can test this out and merge it 👍🏻👍🏻

On Sun, Apr 26, 2020 at 16:13 Vinayak Kulkarni @.***> wrote: I've updated the reference of php & nginx repos to point to focal (20.04) instead of bionic (18.04) — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#143 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADSDU3ERAM5GTGBUZA5MO3ROSPZNANCNFSM4MRMKKWA .

PHP has already deps for focal, waiting for nginx focal to be added

Ticket in nginx : https://trac.nginx.org/nginx/ticket/1955

@vinayakkulkarni
Copy link
Contributor Author

Oh btw, #131 would've ran this automatically instead of me manually sending a PR

@vinayakkulkarni
Copy link
Contributor Author

I think we should use the official nginx ppa instead of launchpad ppa..

@fideloper
Copy link
Contributor

Launchpad is where PPA's are hosted - the one used is the official one built by Nginx.

@fideloper
Copy link
Contributor

Looks like PHP for Focal might be ready finally, so we may be ready to try this out! 👌

@vinayakkulkarni
Copy link
Contributor Author

Launchpad is where PPA's are hosted - the one used is the official one built by Nginx.

http://nginx.org/en/linux_packages.html#Ubuntu

@fideloper
Copy link
Contributor

fideloper commented May 12, 2020 via email

@vinayakkulkarni
Copy link
Contributor Author

If you want, I can setup config for using the official nginx ppa instead of launchpad one in this PR?

Or shall I send a new PR for bionic, then rebase this PR and just do incremental change for focal?

@fideloper
Copy link
Contributor

fideloper commented May 13, 2020 via email

@fideloper
Copy link
Contributor

I played with installing Nginx via their official repo recently - They use a different configuration file structure.

Specifically /etc/nginx/sites-enabled isn't used, it instead wants config files in /etc/nginx/conf.d.

Change to be made: https://github.com/shipping-docker/vessel/blob/master/docker-files/docker/app/Dockerfile#L46

(just making notes here, I got some work stuff keeping me busy right now)

@fideloper
Copy link
Contributor

(also the fastcgj parameters aren’t all set!) So that’s need to be back filled.
I think that’s it. I personally replaced most nginx config with H5BP’s nginx config when I tested on an AWS server recently.

@vinayakkulkarni
Copy link
Contributor Author

Awesome!

@vinayakkulkarni
Copy link
Contributor Author

vinayakkulkarni commented May 21, 2020

You're free to add commits in this branch.
I am buried in work for the next few days :(

@fideloper
Copy link
Contributor

fideloper commented May 21, 2020

My plan right now (when I get some free time also :D )

  1. Adjust scripts to add the default config to the /etc/nginx/conf.d directory
  2. Add/replace the default config with H5BP's config (likely will pin to a specific release/hash)
  3. Grab the proxy params from the PPA-installed setup to reproduce within the Nginx config

Here is the setup for fastcgi settings currently (to reproduce):

File /etc/nginx/snippets/fastcgi-php.conf:

# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;

# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;

# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;

fastcgi_index index.php;
include fastcgi.conf;

File /etc/nginx/fastcgi.conf:

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  REQUEST_SCHEME     $scheme;
fastcgi_param  HTTPS              $https if_not_empty;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

The default file fastcgi_params exists in BOTH install locations but does NOT contain fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;, which is needed.

In our case we can likely just create a single file fastcgi-php.conf in /etc/nginx with the combined output:

# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;

# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;

# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;

fastcgi_index index.php;

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  REQUEST_SCHEME     $scheme;
fastcgi_param  HTTPS              $https if_not_empty;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

@vinayakkulkarni
Copy link
Contributor Author

@fideloper : i'll be working on this over the next few days

@fideloper fideloper merged commit 1651d98 into shipping-docker:master Oct 15, 2020
@fideloper
Copy link
Contributor

Merged via #147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants