Solutions to Nginx problems on Fedora

Source: Internet
Author: User
Because the software version on the official Ubuntu source is too low (for example, the nodejs version is only 0.6), you have to transfer the development environment to Fedora, and Fedora belongs to the RHEL system, the operation is similar to RedHat/CentOS. Although Fedora is a RedHat test item on the internet, I don't care too much about it. It was not until systemd was used that many pitfalls were found. Starting from running nginx (in VMware, Fedora uses yum to install nginx and comes with release E

Because the software version on the official Ubuntu source is too low (for example, the nodejs version is only 0.6), you have to transfer the development environment to Fedora, and Fedora belongs to the RHEL system, the operation is similar to Red Hat/CentOS. Although Fedora is a test item of Red Hat on the internet, I don't care too much about it. It was not until systemd was used that many pitfalls were found.

Starting from running nginx (in VMware, Fedora uses yum to install nginx and comes with the systemd service. The root directory is set to/mnt/hgfs/www ), however, nginx started with systemctl cannot access the root directory (the browser reports that "403" and "autoindex" is enabled. The log says "permission denied". The directory permission is 777. Previously, it was normal in Ubuntu ), but it is normal to change to the default/usr/share/nginx/html.

At first, I thought it was a problem with vmhgfs. There was nothing related to Baidu's visit to Google.

Later I thought it would be okay if I didn't use vmhgfs. So I created a new hard disk and mounted it to/www After partitioning and formatting (ext4). The result was 403 again!

After trying to directly run nginx, the root directory of the result will not report any errors, including the previous vmhgfs. The problem is not caused by vmhgfs. Since the nginx running with systemctl is different from the running result, the problem must be caused by systemd.

After studying nginx. service, no problem was found, including commenting out one line at a time would also be ineffective. If it is not the file system on/dev/sda, 403 is reported.

Try again without using systemctl to start nginx. Previously, rc was used in Ubuntu. local to start nginx is always normal, so I tried to create a new rc. local to start nginx. If nginx is up, the result is 403. Later, I thought that the rc. local was also obtained through systemctl, but we still cannot bypass systemd.

Turning to study systemd, we found this is a substitute for SysV, which was applied at Fedora 16. However, there are not many materials on the Internet.

Finally, the root directory is set to/, and three directories are missing, namely/root/www/lost + found. The permissions are different. The/lost + found permission is 700, the/root permission is 550, And the/www permission is 755. Even the 755 directory cannot be displayed. The 700 Directory should not be displayed, and the/boot directory can be displayed in the same mount mode. When you try to enter/home, 403 is reported again, And/home is 755. I really don't know who authorized nginx to access the directory. Finally, we can only infer that the problem lies in the management of the file system by systemd.

CentOS 6.2 Deployment Nginx + MySQL + PHP http://www.linuxidc.com/Linux/2013-09/90020.htm

Build a WEB server http://www.linuxidc.com/Linux/2013-09/89768.htm with Nginx

Build a Web server http://www.linuxidc.com/Linux/2013-09/89692.htm Based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5

Nginx Performance Tuning http://www.linuxidc.com/Linux/2013-09/89656.htm in CentOS 6.3

Configure Nginx to load ngx_pagespeed module http://www.linuxidc.com/Linux/2013-09/89657.htm under CentOS 6.3

CentOS 6.4 install and configure Nginx + Pcre + php-fpm http://www.linuxidc.com/Linux/2013-08/88984.htm

Nginx Video-on-Demand Server (professional simulation streaming media software) http://www.linuxidc.com/Linux/2012-08/69151.htm

Nginx details: Click here
Nginx: Click here

For more information about Fedora, see Fedora topics page http://www.linuxidc.com/topicnews.aspx? Tid = 5

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-06/103857.htm

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.