0

I've installed Nginx using apt-get install nginx but now I need to add SPDY and PageSpeed extensions. This is why I need to remove the current Nginx installation and install the new one from source.

How should I proceed? Do I have to uninstall the current Nginx and then compile the new one to avoid complications between those two?

How do I register the custom Nginx as a service so I can use service nginx start and make it start on boot?

3 Answers 3

1

To create the service nginx start

  1. Create a nginx entry in /etc/init.d/ touch /etc/init.d/nginx
  2. Place your nginx service configuration in /etc/init.d/nginx Example configuration https://gist.github.com/j0hnb/37416fe362e20c82c295
  3. Enable execute rights sudo chmod +x /etc/init.d/nginx

That should allow you to run Service nginx start Other service options

start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest

0

You should remove the existing nginx
Try the following commands
(assuming that you are root)

apt-get autoremove nginx*
apt-get purge nginx*

And that should do the trick.
For compiling from the source, just grab the source from
http://nginx.org/en/download.html
For services, I would recommend on using

nginx
instead of
service nginx start
and
nginx -s stop
for
service nginx stop
. It is more convenient compared to the "traditional" mode.

2
  • You aren't answering the question of registering the nginx build as a system service Aug 26, 2014 at 16:38
  • It is answered by others. I'm answering regarding the title and suggest an alternative command on having the service started. Aug 27, 2014 at 3:57
-3

I think you should find this article quite useful.

For further references, you can just run apt-get remove <package> or aptitude remove <package> to uninstall any package but it won't hurt to look for leftovers on the usual places - namely /etc/ - given that you edit those files and apt/aptitude may be reluctant to remove -- unless you specify the proper flags.

Remember, Google is your friend.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .