1

I am not an expert in linux/ubuntu.. just know the absolute basics following whatever I've read on stackoverflow.

I was trying to install pagespeed (upon nginx) on my EC2 server following the steps that are given here: https://modpagespeed.com/doc/build_ngx_pagespeed_from_source

Now what it seems is there are 2 installations of nginx

  1. Default one which is preinstalled on my EC2 server on which my site is running (/etc/nginx). this is version 1.4.6
  2. The new one which just got installed following the pagespeed installation instructions (/usr/sbin - I think this is the path but not sure)... I believe this is the latest/newer version.

Now, I didn't want to lose the 1st installation as the LIVE production site is running on this. The configurations and settings are working fine, didn't want them to mess up. My assumption was that pagespeed installation will happen over the existing setup and nothing else would change. This is where I was wrong.

Here are my questions:

  1. Is there a way to rollback the new setup/installation that I did? How can I do it?
  2. How can I setup/use pagespeed on existing server (/etc/nginx) without losing any settings or suffering major downtime on existing server.
  3. Last option, how can I configure my website to function from the newer installation of nginx (/usr/sbin?) Assuming this switch will be easy and quick. What steps to follow for this?
  4. If I go with option #3 how can I remove/uninstall the older version of nginx?

Hope you guys can help.

Best!

  • 4
    Strange things could happen if you follow random tutorials without basic knowledge on the words used in their titles, like _from source_. – Esa Jokinen May 24 '17 at 12:51
  • 3
    Sorry for being direct, but since you don't know what you are doing, you should just restore the system from backups and then learn system administration concepts before trying this again. Or then, find out if someone has prepared a package of the pagespeed enabled nginx, and use that. Building things from source is not really an option in production environments. – Tero Kilkanen May 24 '17 at 13:49
  • Building from source may or may not be an option in production environments. Testing something new is never. – Esa Jokinen May 24 '17 at 17:27

1 Answers1

3

I'll try to be more constructive than the comments above. Everyone has to start somewhere, but starting on a production server without backups suggests you do need to step back and think some more before you do this.

First up, to include pagespeed you need to build Nginx from source. This means if you have an existing Nginx instance it will replace it. You probably don't have to delete the existing Nginx binary, you can probably put the new one alongside it. However removing the old Nginx would be best, removing confusion.

  1. Yes, restore from your backup. Or, if you don't have a backup, we can't say as we don't know what you did.
  2. You can keep your existing settings, which are likely in a folder like /etc/nginx. If you remove the original nginx binary they should stay there, but make sure you keep a copy / backup
  3. It depends on your operating system. Nginx is likely started from the /etc/init.d/nginx script, which you can edit quite easily
  4. Use whatever facility your operating system provides. apt-get remove, yum remove, etc.

Of course you'll want to do this in a testing environment, and keep full backups. There will be downtime while you do this, based on your apparent experience level it could be hours.

Tim
  • 31,888
  • 7
  • 52
  • 78