Get the most out of your Centmin Mod LEMP stack
Become a Member

Hi there

Discussion in 'Introductions' started by patrikpodo, Nov 30, 2015.

  1. patrikpodo

    patrikpodo Member

    32
    3
    8
    Aug 27, 2014
    Prague
    Ratings:
    +7
    Local Time:
    8:21 AM
    Big time, long time fan, but recently I came to a problem:
    -------------------------------------
    Success: Nginx was installed properly

    /usr/local/nginx/conf/conf.d/demodomain.com.conf
    ---
    /usr/local/nginx/conf/conf.d/ssl.conf
    ---
    /usr/local/nginx/conf/conf.d/virtual.conf
    ---
    Starting nginx: nginx: [emerg] setsockopt(SO_REUSEPORT) 0.0.0.0:80 failed, ignored (92: Protocol not available)

    Can you please help me?

    I tried couple of centos templates but no luck.

     
  2. Matt Williams

    Matt Williams WordPress Fanatic

    537
    104
    43
    Nov 22, 2014
    Virginia, USA
    Ratings:
    +157
    Local Time:
    3:21 AM
    latest
    10
    Are you using the Beta version or the stable version?
     
  3. patrikpodo

    patrikpodo Member

    32
    3
    8
    Aug 27, 2014
    Prague
    Ratings:
    +7
    Local Time:
    8:21 AM
  4. rdan

    rdan Well-Known Member

    5,447
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    3:21 PM
    Mainline
    10.2
    Try to remove the variable reuseport on virtual.conf.
    Then restart NGINX.
     
  5. patrikpodo

    patrikpodo Member

    32
    3
    8
    Aug 27, 2014
    Prague
    Ratings:
    +7
    Local Time:
    8:21 AM
  6. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    5:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    welcome @patrikpodo to Centmin Mod Community and glad to see you finally post :)

    What kernel version you using check via command
    Code:
    uname -ri
    could be reuseport isn't supported by your kernel

    FYI, reuseport was added in Nginx 1.9.1 for Linux kernels 3.9 and higher and RHEL/CentOS backported 2.6.32 base kernels.

    Threads you might want to participate in ;)

    Threads to read, pages to bookmark and threads to watch/subscribe to get to know Centmin Mod would include:
    Premium Membership
     
    Last edited: Nov 30, 2015
  7. patrikpodo

    patrikpodo Member

    32
    3
    8
    Aug 27, 2014
    Prague
    Ratings:
    +7
    Local Time:
    8:21 AM
    Result of "uname -ri":

    2.6.32-042stab076.8 x86_64
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    5:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    strange

    To check if your CentOS Linux kernel supports SO_REUSEPORT, type this command in SSH as root user

    Code:
    grep --color -Ro SO_REUSEPORT /usr/src/kernels/*
    If supported it should return something like this

    On CentOS 6.6 distro kernel
    Code:
    grep --color -Ro SO_REUSEPORT /usr/src/kernels/*
    /usr/src/kernels/2.6.32-504.23.4.el6.x86_64/include/asm-generic/socket.h:SO_REUSEPORT
    /usr/src/kernels/2.6.32-504.23.4.el6.x86_64/include/net/sock.h:SO_REUSEPORT
    /usr/src/kernels/2.6.32-504.30.3.el6.x86_64/include/asm-generic/socket.h:SO_REUSEPORT
    /usr/src/kernels/2.6.32-504.30.3.el6.x86_64/include/net/sock.h:SO_REUSEPORT
    If not supported in kernel, it will return empty.

    If you're kernel does not support SO_REUSEPORT option, you will either need to switch Linux kernels which may involve reinstalling the operating system - ask web host. For instance, OVH and SoYouStart web hosts are know to offer both CentOS with their own custom kernels and also CentOS with distro kernels. OVH/SoYouStart by default give you OS with their custom kernels out of the box. You need to choose and reinstall CentOS with the distro provided kernels.

    If not possible to switch, then disable Nginx's use of SO_REUSEPORT by editing main hostname's Nginx vhost file at /usr/local/nginx/conf/conf.d/virtual.conf ( can be accessed via command short outlined at FAQ item 16 = vhostconf) and removing the reuseport option from listen line and restarting Nginx server.

    so change from
    Code:
    listen 80 default_server backlog=2048 reuseport;
    to
    Code:
    listen 80 default_server backlog=2048;
    and restart nginx
    Code:
    service nginx restart
    or command shortcut
    Code:
    ngxrestart
     
  9. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    5:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    also that's quite outdated I believe, on my OpenVZ based VPS with Centmin Mod and reuseport supported I see
    Code:
    uname -ri
    2.6.32-042stab108.5 x86_64
    
    Unfortunately, ChicagoVPS isn't know for security so could be outdated ...which could be a security issue ?
     
  10. patrikpodo

    patrikpodo Member

    32
    3
    8
    Aug 27, 2014
    Prague
    Ratings:
    +7
    Local Time:
    8:21 AM
    Result of "grep --color -Ro SO_REUSEPORT /usr/src/kernels/*":

    /usr/src/kernels/2.6.32-573.8.1.el6.x86_64/include/net/sock.h:SO_REUSEPORT
    /usr/src/kernels/2.6.32-573.8.1.el6.x86_64/include/asm-generic/socket.h:SO_REUSEPORT

    "listen 80 default_server backlog=2048;"

    Thats exaxtly what I did and sites are resolving, install is functioning.
     
  11. patrikpodo

    patrikpodo Member

    32
    3
    8
    Aug 27, 2014
    Prague
    Ratings:
    +7
    Local Time:
    8:21 AM
    It needs to be said. I absolutely love CentminMod and I have around 4 VPS - Ramnode, some lowend boxes.

    I am using it for wordpress sites and what really made a big difference in loading time for my was this:
    ------
    Nginx Wordpress Configuration - CentminMod.com LEMP Nginx web stack for CentOS
    [mysqld]
    character-set-server=utf8

    my.cnf file
    -------

    If I may request, it might be vital to use /"sqeeze"/ even more from VPS servers by having possibility to optimize my.cnf file, by giving as much RAM as possible to be available.

    1: find / -name 'my-huge.cnf'
    2: cp /etc/my.cnf /etc/my.cnf.old
    3: cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
    4: /etc/init.d/mysqld restart
     
  12. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    5:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah OpenVZ doesn't actually use that output kernel version but one on OpenVZ host node. But strange it doesn't support reuseport as all my OpenVZ VPSes do

    anyway, yes removing reuseport from listen directives should fix it

    glad to know (y)
     
  13. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    5:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    no need, Centmin Mod mariadb my.cnf templates are optimised for specific mariadb supported options, the default my-huge.cnf doesn't have those options so do not recommend using them as you wont' get the most out of MariaDB and possible break MariaDB 10.0 to 10.1 upgrade submenu routine in future

    for 123.08stable
    see centminmod/config/mysql at 123.08stable · centminmod/centminmod · GitHub for my-mdb10*.cnf file templates

    for 123.09beta01 has more auto detection for memory installed and adjust/uses appropriate my-mdb10*.cnf file templates
    centminmod/config/mysql at 123.09beta01 · centminmod/centminmod · GitHub
     
  14. patrikpodo

    patrikpodo Member

    32
    3
    8
    Aug 27, 2014
    Prague
    Ratings:
    +7
    Local Time:
    8:21 AM
    So I kinda made this bloody ChicagoVPS work. Great, but speaking of my.cnf:

    Right now I am doing some "heavy duty" work, I am importing csv file, creating posts while downloading images through WP all import plugin /all at the same time/

    And this is how it is being done:

    http://i.imgur.com/AqUj0uO.png

    Out of 4GB of RAM I am hardly using 0,5GB of RAM

    Plenty of free RAM to use but "not available". While on the other hand, if you look at RAMNODE their setup is to use maximum of the RAM and swap - servers are fast. I understand that this example is little off, but if you will make fresh install without Centminmod and use my-huge.cnf, your RAM will jump to at least 50% of total RAM /on oversold nodes/ and you will get more "fun for your buck".

    Please excuse my "non technical English".
     
  15. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    5:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    More memory usage for mysql doesn't necessarily mean better performance - that's what alot of folks incorrectly think. The other usually incorrect assumption is less memory usage is better.

    The correct formula is, only the right optimal amount of memory required by mysql and your mysql utilising web apps will mean better performance ;)

    It's why I wrote my mysqlmymonlite.sh script at mysqlmymon.com. See mysqlmymonlite.sh Addon | Centmin Mod Community
     
  16. patrikpodo

    patrikpodo Member

    32
    3
    8
    Aug 27, 2014
    Prague
    Ratings:
    +7
    Local Time:
    8:21 AM
  17. eva2000

    eva2000 Administrator Staff Member

    54,946
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    5:21 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Glad to hear :D