Linux uninstall program, Ngnix upgrade, configuration 404, smooth configuration modification

Source: Internet
Author: User
Uninstall Apache # rpm-qa | grephttpd # yumremovehttpd can not be deleted with-nodepsrpm-ephp-5.2.6-11-nodepsngnix upgrade, modify the configuration first download Nginx: run wgethttp: // nginx.org/download/nginx-0.8.54.tar.gzdecompress and import the directory tarz uninstall Apache

# Rpm-qa | grep httpd

# Yum remove httpd

Deleted-nodeps

Rpm-e php-5.2.6-11-nodeps

Ngnix upgrade and modify configurations

First Download Nginx: execute wget http://nginx.org/download/nginx-0.8.54.tar.gz



Decompress and enter the Directory

Tar zxvf nginx-0.8.54.tar.gz

Run again./configure -- user = www -- group = www -- prefix =/usr/local/nginx -- with-http_stub_status_module -- with-http_ssl_module -- with-http_gzip_static_module.

Then make, but do not make install

After compilation, there is an nginx execution file under the objs directory.

Back up old nginx files

Mv/usr/local/nginx/sbin/nginx. old

Run cp objs/nginx/usr/local/nginx/sbin/nginx after converting nginx cp under the new objs to sbin.

Run the/usr/local/nginx/sbin/nginx-t test to check whether there is any problem.

Run make upgrade again.

Run:/usr/local/nginx/sbin/nginx-V to display the nginx version and compiled parameters.

Upgrade complete!

404 configuration:

1.create the secret 404.html page

2. change nginx. conf and add fastcgi_intercept_errors on in the http definition area;

3. change nginx. conf (or a separate website configuration file, for example, the site configuration file under nginx-> sites-enabled)

Add: error_page 404 =/404.html or error_page 404 = http://www.xxx.com/404.html in the server region

4. reload the configuration file after modification, without restarting

#502 and other errors can be configured in the same way.

Error_page 500 502 503 504 =/50x.html;

Smooth configuration modification:

/Usr/local/nginx/sbin/nginx-t

/Usr/local/nginx/sbin/nginx-s reload

The first statement is to check whether the configuration file is correct and the correct information:

The configuration file/usr/local/nginx/conf/nginx. conf syntax is OK

The configuration file/usr/local/nginx/conf/nginx. conf was tested successfully
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.