0

I hope this is the right place to post this.

I have a CentOS 6 VPS that hosts multiple sites. There are three existing sites that are currently running on it just fine, but I am now trying to add a fourth and always get the "Welcome to nginx on Fedora!" welcome page when I visit the URL (we'll call it nginxFail.com).

I put a test.txt file in /home/nginxFail/www and tried to go to nginxFail.com/test.txt. It threw a 403. nginxFail.com/nosuchfile.txt and nginxFail.com/nosuchdir also throw 403s.

What I have already tried:

-Verifying the domain info: The domain information on the new domain and the three other domains are exactly the same, including SPF info. The new domain has had about 5 days to propogate.

-Verifying httpd.conf: Here's what I have:

<VirtualHost *:80>
    DocumentRoot /home/**nginxFail**/www
    ServerName **nginxFail.com**
    ServerName **<my server IP>**
    ErrorLog /var/log/httpd/**<errorLog>**
    CustomLog /var/log/httpd/access_log combined
<Directory "/home/**nginxFail**/www">
Options +Indexes FollowSymLinks +ExecCGI
Order allow,deny
allow from all
</Directory>
</VirtualHost>

Of course the entries in bold are set to my actual information. This is the same exact setup as the other entries in this file that make the other three sites work.

Also here is the condensed /etc/nginx/nginx/conf:

user              nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

pid        /var/run/nginx.pid;

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    # Load config files from the /etc/nginx/conf.d directory
    include /etc/nginx/conf.d/*.conf;

    #
    # The default server
    #
    server {
        listen       80;
        server_name  _;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }

        error_page  404              /404.html;
        location = /404.html {
            root   /usr/share/nginx/html;
        }

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }
    }
}

-Restarting the server (and /etc/init.d/httpd). No luck.

-Trying another machine: I have read that the nginx thing could be the result of a virus or host file. My machines are always clean (constant virus scans, not trusting browser-ran error scans, hahha), and my host file seems clean. Just for kicks I tried going to the site on another computer and even on my phone and I got the same nginx page.

-Google: It failed me! :o, this is how I learned about the browser cleaning thing.

-Verifying permissions: On my server all the sites are listed in their own folder in the /home/ directory. This is where I put the new site entry in as well. As said before the three other sites work fine so it's not a permission issue with /home/, and I have ensured that home/nginxFail/www has 755 (just like the other working sites).

-looking at /etc/nginx/ directory: I noticed there is no sites-enabled directory. I saw in another question that this could be the cause, but if that were the case, why would 3 other websites be working fine?

-Looking at logs: I didn't really find anything in var/log other than the acknowledgement that the web server is getting the HTTP request and throwing 403s. After visiting the mentioned test.txt file above I watched the log directory for a change in mod dates to see which files to look at.

-Telling the site verbally to stop showing nginx and to please show my site: No luck.

-Poking around in /etc/nginx: I have read there's a sites-available directory there that should help me but I don't see it when I'm logged in as root.

I'm a bit at a loss here.

EDIT: I did some more research on the problem and it looks like a weird conflict with Apache and nginx is to blame.

The site runs Apache 2.2.23 and it appears nginx was also installed, probably by mistake. The 403 pages I get signify that Apache kicked in, but going to the domain itself throws me to nginx for some reason. My natural thought was to stop nginx with /etc/init.d/nginx -s stop. When I do that and go back to nginxfail.com the nginx page still shows. When I do ps -ef | grep nginx I can see an nginx process running even after I stopped it and to my knowledge there shouldn't be any scripts on the server that automatically restart it.

Here's where it gets interesting, when I do /etc/init.d/httpd stop, ALL 4 sites die, including nginxfail.com and the 3 other working sites, and when I turn httpd back on the same situation in my first post arises.

I looked in /etc/httpd/error_log and I get the error Client denied by server configuration: /home/nginxfolder/www/ and I verified the permissions so the web server (I'm pretty sure it's Apache in this case) seems to be looking in the right spot.

I'm sorry if this is vague and doesn't illustrate my setup very well. Is there any other specific info that will help?

4
  • 1
    What is in the nginx error log? May 19, 2015 at 23:41
  • 1
    Not sure to understand your design...you have Apache and NGinx. Can you explain a bit more about your design ?
    – krisFR
    May 20, 2015 at 0:05
  • +1 you are showing an apache virtual host config but run nginx
    – Dan
    May 20, 2015 at 5:04
  • @MichaelHampton: That's the strange thing, the error log in /var/log/nginx/error.log doesn't have anything when I visit the site and test files. I updated the first post with some more research, the fundamental question of 'what are you running?' helped me narrow the problem down a bit. May 21, 2015 at 3:50

0

You must log in to answer this question.

Browse other questions tagged .