1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Completely new to nginx

Discussion in 'Server Configuration and Hosting' started by BamaStangGuy, Oct 8, 2013.

  1. BamaStangGuy

    BamaStangGuy Well-Known Member

    So I have given Centmin a try and have it up and running. I have never used nginx before but I have setup a vhost for my domain and uploaded all the files.

    Where do I place the rewrite rules for nginx?

    This is the path to my domain

    /home/nginx/domains/secfootballforums.com/public
     
  2. Tracy Perry

    Tracy Perry Well-Known Member

    Rewrite rules (and all directives) are placed in the vhost definition. I believe (in the Centmin mod) those files are kept under /home/nginx/domains/ and then appropriate name configured.
     
  3. BamaStangGuy

    BamaStangGuy Well-Known Member

    I don't see any files that would relate to that in /home/nginx/domains/ at all.
     
  4. Tracy Perry

    Tracy Perry Well-Known Member

    Scratch that... those are for the actual sites themselves.
    Look under /usr/local/nginx/conf/conf.d and see if they are there (had to ssh into the centOS box to look).
     
    SneakyDave likes this.
  5. euantor

    euantor Well-Known Member

    You could also create a htaccess style configuration that looks for a file under each vhost to include with your rewrites, but it's best to put them in the actual virtual host definitions.
     
  6. Tracy Perry

    Tracy Perry Well-Known Member

    Agreed. For me the simplicity of including it in the file vhost definition itself helps on following the logic without having to go into a second file to look.
     
    euantor likes this.
  7. p4guru

    p4guru Well-Known Member

    might want to start with http://centminmod.com/getstarted.html :)
     
  8. euantor

    euantor Well-Known Member

    It's also faster. Including rewrites in the vhost is actually the suggested configuration for Apache rather than enabling .htaccess support too. otherwise Apache has to look for a .htaccess file for each request - and it doesn't just look for one, it looks right up through the directory tree to the web root (unless things have changed since I last used Apache).
     
  9. BamaStangGuy

    BamaStangGuy Well-Known Member

    Thanks, got it all figured out. Haven't gotten Zend OpCache working with Php 5.5. for some reason. Doesn't show up in phpinfo but memcache does.
     
  10. Tracy Perry

    Tracy Perry Well-Known Member

    I haven't played with PHP 5.5 yet (waiting for it to be "stable" and shipped out as a Debian package). I know that with some of the cache's you have to define a memory footprint for it to use. Is Zend OpCache the same?
     
  11. BamaStangGuy

    BamaStangGuy Well-Known Member

    Yes. You can see what CentminMod looks like with it here: http://cloud2.whippmedia.com/
     
  12. Tracy Perry

    Tracy Perry Well-Known Member

    Have you reviewed http://stackoverflow.com/questions/17224798/how-to-use-php-opcache?

    Looks like you have to enable it in php.ini and then set your other parameters (some base ones) - have you checked that?

    Code:
    zend_extension=/full/path/to/opcache.so
    ; Sets how much memory to use
    opcache.memory_consumption=128
    
    ;Sets how much memory should be used by OPcache for storing internal strings
    ;(e.g. classnames and the files they are contained in)
    opcache.interned_strings_buffer=8
    
    ; The maximum number of files OPcache will cache
    opcache.max_accelerated_files=4000
    
    ;How often (in seconds) to check file timestamps for changes to the shared
    ;memory storage allocation.
    opcache.revalidate_freq=60
    
    ;If enabled, a fast shutdown sequence is used for the accelerated code
    ;The fast shutdown sequence doesn't free each allocated block, but lets
    ;the Zend Engine Memory Manager do the work.
    opcache.fast_shutdown=1
    
    ;Enables the OPcache for the CLI version of PHP.
    opcache.enable_cli=1
     
  13. BamaStangGuy

    BamaStangGuy Well-Known Member

    I have not reviewed it completely yet. I am using the defaul ini that eva2000 of CentminMod attaches. I am still getting my feet wet. I have two sites live on it now though at least.
     
  14. euantor

    euantor Well-Known Member

    OpCache is pretty good. I have it installed on my server and it seems to be fairly stable.
     

Share This Page