[ Video Sharing CMS v4 ] Nginx Config?

Started by jeredbrent,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jeredbrentTopic starter

Does anyone have a sample nginx config working with phpvibe?

I'm having issues getting this badboy to work right.
tester.php passes all tests.

I'm trying to install 3.3 or 3.4 and after I get the administrator account setup and submited, I'm getting a connection refused.

I've checked my rewrite rules since we don't use .htaccess

It looks like a simple config after looking at the bundled .htaccess file.

I have no errors in my nginx log though which is strange.

System Specs:
Ubuntu 12.04.04
PHP 5.3.10 (FPM unix:/tmp/php5-fpm.sock)
Nginx 1.1.19
MYSQL 5.5.29

Thoughts and thanks for the help!

  •  

PHPVibe A.

Hi! Not sure how we can help with nginx, we never tried it.
Only asked here for feedback http://www.phprevolution.com/forum/features-and-progress/nginx-anybody-tried-it/

So basically what's going on is that when you submit the admin creation form the connection gets refused?

jeredbrentTopic starter

 :o

Doh!  Your system requirements page says it workes flawlessly.  lol
http://www.phprevolution.com/requirements/

Anywho,

It has to be a rewrite rule in my config.

So, here are the steps i've taken:

1. Create new database "test"
2. Create new host directory, copied over the contents of the cms from 3.4
3. chmod -R 777 on the entire directory for shits and giggles
4. Configure vibe_config.php with mysql username, password, database, key, and domain.
5. Setup my .vhost config as such:

server {
       listen 80;
       server_name xxx.xxxx.com;
       root /var/www/xxxxx;

       index index.php;

       location ~ ^/favicon.ico$ {
                log_not_found off;
                access_log off;
                expires max;
       }

       location / {
                add_header Access-Control-Allow-Origin *;
                try_files $uri @rewrite;
       }

       location @rewrite {
                #rewrite ^/embed/([^/]*)/$ /embed.php?id=$1; <-test
                rewrite ^/(.*)/?$ /index.php?rp=$1;
       }

       location ~ \.php$ {
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/tmp/php5-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $request_filename;
                fastcgi_intercept_errors on;
                fastcgi_index index.php;
       }
}

5. I reload nginx: sudo /etc/init.d/nginx reload
6. visit the page: xxx.xxxx.com/setup
7. I get the notification to continue, edit the config and delete the hold file.
8. Delete the hold file and click run setup link.

This is where the first hiccup occurs...
I get the following line:
Setup thinks your site url in config should be https://xxx.xxxx.com/ but instead it is http://xxx.xxxx.com/. Make sure the url is correct and has an ending slash "/". If so, ignore this warning.

Interesting, the site is set correctly in the vibe_config.php as "http://xxx.xxxx.com/" NOT https...
(There is also no css styling for this page - see the attachment:phpvibe_nocss_install.PNG)
if I complete the form now, I get a unable to connect error...

Weird...  I dug into the /setup/index.php file and on line 114, I changed the following:
'https' : 'http' to 'http' : 'http' so it just defaults to normal http regardless if ssl is enabled on the server.
(this site will have no ssl on it)

Reloading the http://xxx.xxxx.com/setup/index.php in my browser and now css works!  yeah! (see attachment:phpvibe_http_withcss_install.PNG)

completing the form now redirects directly to the main interface.  :(

the sql query to create the admin user never executes so no admin user is created in vibe_users.

Hope that helps shed some light... there has to be something goofed with my config is the only thing I can think of.

thanks for your help!
  •  

PHPVibe A.

#3
Yes, but "Nginx is been reported to work flawless as well." doesn't mean we test it or we know anything about it, we know just what our client's tell us about different setups, this is why the "is been reported" and not "works...".

Anyways, moving forward, it seems that function that grabs the location gets an https location returned (didn't happen before), this is why the css fails.

It seems you have issues with $_POST, anything that may block that on server?


I've googled a bit, and I get all sorts of permission things, but I've never seen nginx configs before, so it's a bit of chinese for me, I've asked Mario as well, but he said "Nginx is that alternative server, right? Nope, didn't try such thing"  :D


Marius P.

Got no clue, but maybe the guys in the community know about nginx.
Googling that error does not help?
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

jeredbrentTopic starter

Well crap... :o

I've been scouring google all day.

You guys should fire up a test server and give a whirl. 8)

I'll keep working on it for another hour before I move on.

Any chance you could email another client that is running nginx and sneak a peek at their config?

Thanks,

J
  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

jeredbrentTopic starter

  •  

jeredbrentTopic starter

#8
Fixed!   ;D

Below is a sample of my config that is working!
Uploads, playback, admin control panel, etc seems to all work.
Now I just gotta figure out why the hell avatars are required for registration!  LOL
Share this with anyone else that asks or put it in your documentation for nginx installs!  :)
server {
       listen 80;
       server_name xxx.xxxx.com;

       root /var/www/xxxx;
       error_log /var/log/nginx/xxxx.error.log;
       access_log /var/log/nginx/xxxx.access.log;

       index index.php;

       location / {
                add_header Access-Control-Allow-Origin *;
                try_files $uri $uri/ @rewrite;
       }

       location /embed {
                try_files /embed/id=$1 last;
       }

       location @rewrite {
                rewrite ^/(.*)/?$ /index.php?rp=$1 last;
       }

       location ~ \.php$ {
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/tmp/php5-fpm.sock;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_index index.php;
       }
}
  •  

PHPVibe A.

Thanks!

For avatars, /com/com_register.php

<input type="file" name="avatar" class="validate[required] styled">


to make it optional remove

validate[required]

from the class.

Similar topics (7)