Welcome! Log In Create A New Profile

Advanced

Unable to access the root directory

Posted by corby 
Unable to access the root directory
November 06, 2012 12:28PM
Hi,

I managed to start nginx and proxy via apache but when I browse the URL I am unable to access the directory /var/www/html/sitename.
We are using mutiple installs of wordpress .

I am using nginx 1.2.4 Apache/2.2.15, php-common-5.3.3-3.el6_2.8.i686, php-cli-5.3.3-3.el6_2.8.i686, php-5.3.3-3.el6_2.8.i686.

Here's my nginx.conf:

user apache;
worker_processes 4;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64;
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;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
}

and in proxy.conf:

proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
large_client_header_buffers 64 32k;
proxy_buffering on;
proxy_buffer_size 32k;
proxy_buffers 2048 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

and finally in my default.conf in the /etc/nginx/conf.d/default.conf

server {
listen 81;
server_name sitename-wordpress.com;
access_log /var/log/nginx.access.log;
error_log /var/log/nginx_error.log;

# proxy the PHP scripts to Apache listening on 127.0.0.1:81
#
location = / {
proxy_pass http://127.0.0.1;
root /var/www/html/sitename/;
index index.php;
autoindex on;
autoindex_exact_size off;
allow all;
}
}

So I restart httpd and nginx
my directory permissions are all 755 , same with the files, /var/www/html/sitename and owner:group is apache:apache

Initially I got a strange page which lists sitename on the page , so to test I put a index.php in the /var/www/html

I'm wondering why it can only access /var/www/html/index.php and not /var/www/html/sitename/index.php and when I try to access that it says not found:

here's what happens(it gets to /var/www/html/index.php but I want it to access /var/www/html/sitename/index.php:

curl -v http://sitename-wordpress.com:81
* About to connect() to sitename-wordpress.com port 81 (#0)
* Trying 127.0.0.1... connected
* Connected to sitename-wordpress.com (127.0.0.1) port 81 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Host: sitename-wordpress.com:81
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.2.4
< Date: Tue, 06 Nov 2012 17:21:14 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 371
< Connection: keep-alive
< Vary: Accept-Encoding,User-Agent
<
<html>
<body>
<a href="http://www.example.com/index.php">Home</a> -
<a href="http://www.example.com/about.php">About Us</a> -
<a href="http://www.example.com/links.php">Links</a> -
<a href="http://www.example.com/contact.php">Contact Us</a> <br />
<p>This is my home page that uses a common menu to save me time when I add
new pages to my website!</p>
</body>
</html>
* Connection #0 to host sitename-wordpress.com left intact
* Closing connection #0

So when I force it to go to /var/www/html/sitename/index.php:

curl -v http://sitename-wordpress.com:81/amazingworld/index.php
* About to connect() to sitename-wordpress.com port 81 (#0)
* Trying 127.0.0.1... connected
* Connected to sitename-wordpress.com (127.0.0.1) port 81 (#0)
> GET /sitename/index.php HTTP/1.1
> User-Agent: curl/7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Host: sitename-wordpress.com:81
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Server: nginx/1.2.4
< Date: Tue, 06 Nov 2012 17:23:33 GMT
< Content-Type: text/html
< Content-Length: 168
< Connection: keep-alive
<
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.2.4</center>
</body>
</html>
* Connection #0 to host sitename-wordpress.com left intact
* Closing connection #0

So nginx, php, apache and ports 80 and 81 and working , just not going into the desired directory. Any hints and help is much appreciated.
Thanks in advance.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 167
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready