Install WordPress 4.1.1 on Fedora 21/20, CentOS/RHEL 7/6.6/5.11 - Comment Page: 3

This is guide, howto install WordPress 4.1.1 with Nginx or Apache on Fedora 21/20/19, CentOS 7/6.6/5.11 and Red Hat (RHEL) 7/6.6/5.11 servers. Wordpress needs web server with PHP and MariaDB or MySQL database. This guide uses Apache web server with PHP 5.6 or Nginx web server with PHP 5.6 (PHP-FPM) and MariaDB 10/5.5 database server or Mysql 5.6 database server. If you want to install Wordpress with Apache then use a - [Apache] sections and if you want install Wordpress with Nginx then use b - [Nginx] sections. 1. Install Needed Web and Database Servers [Apache] 1.1a Install the whole LAMP environment with following guide LAMP (Linux/Apache/MySQL/PHP) on Fedora, CentOS/Red Hat...

122 comments on “Install WordPress 4.1.1 on Fedora 21/20, CentOS/RHEL 7/6.6/5.11 - Comment Page: 3

1 2 3 4
    1. more simple install wordpress on fedora just
      yum install wordpress

      if you want setup wizard just rename file config on /etc/wordpress/

      root file wordpress on /usr/share/wordpress

      and happy blogging :)

      Reply
      • Hi noztox,

        Sometimes yes and sometimes no. Biggest disadvantage is yum updates. WordPress will be updated frequently and yum repository is always behind or maybe you want some reason run older version than yum repo version (then you have to exclude WordPress from every yum updates).

        Anyways this guide is universal method, howto install WordPress with on RHEL based distros and you can use Apache or Nginx with PHP-FPM. :)

        Reply
        • hi JR,

          yups its true, sometime we need older version from wordpress and thanks on the advice
          by the way thanks for article give me 1 more knowledge about guide install nginx web server with PHP 5.4 (PHP-FPM) ^_^

          Reply
          • Hi again Noztox,

            You are welcome!

            Nginx and PHP 5.4 (PHP-FPM) is excellent choice with WP (or any site). :)

            Reply
    2. Hi, I have gone through all the steps in my CentOS 6.2 virtual machine but when I fire up the browser it only shows the message “Welcome to Nginx!”.. How Can I open wordpress in browser? Thanks.

      Reply
    3. Hi, how would you update wordpress to a newer version. I tried pressing the “update now” link and it failed to update with this message:

      Unpacking the update

      Could not copy files.

      Installation Failed

      Reply
      • Hi William,

        Are you using Apache or nginx?

        Could you also post output of following commands (replace examples with real paths):

        
        ls -la /your/wordpress/installation/path
        
        ls -la /your/wordpress/installation/path/documentroot
        
        uname -a
        
        lsb_release -a
        
        Reply
    4. i have follow this tutorial step by step,
      i use nginx, when i finish and try open browser “http://192.168.2.2/wordpress/wp-admin/install.php” and i get this error
      “Something has triggered missing webpage on your website. This is the default 404 error page for nginx that is distributed with EPEL. It is located /usr/share/nginx/html/404.html

      You should customize this error page for your own site or edit the error_page directive in the nginx configuration file /etc/nginx/nginx.conf.”

      what should i do to fix it??
      thanks.

      Reply
      • Hi ArdiOn,

        Could you post your WordPress virtual host config file content?

        Reply
    5. Hi JR
      Great post-thanks.
      My problem still is how to autoupdate to the latest WP version using ftp autoupdate.
      I know this has been discussed but I still haven’t got it (I am using Fedora17 & btw I have this same problem with WP autoupdate on my Win7 localhost!).
      I have changed ownwership of wordpress folder from the original owner#xx to apache and same for wp-content folder/directory with no success. I did this from folder properties- there is no www-data option there(?). I will try chown www-data too and let you know how it goes.

      I would be grateful for a simple clear explanation of how to get this WP ftp autoupdate to work with Fedora localhost (I’d love to know how to fix it in IIS on Win7 too!). I have asked about this on WP.org forum with little response & it seems a common problem that WordPress have not given much help on! Best wishes & many thanks

      Reply
      • Hi Richard,

        Nice to hear that you liked this post.

        Actually you should chown apache: instead www-data:, so do following:

        
        chown -R apache:apache /path/to/your/wordpress
        
        ## If you have SELinux enabled ##
        chcon -R -t httpd_sys_content_rw_t /path/to/your/wordpress
        

        And then you can set following to your wp-config.php:

        
        define('FS_METHOD', 'direct');
        
        Reply
    6. Hi, I’ve gotten Nginx installed on CentOS 6.3, with MySQL and PHP-FPM and everything is okay, thanks. I currently have 10 customer websites that I host using a reseller account where each client has their own account. I want to move all of the sites to my Linode servers and instead give each site its own folder.

      How do I need to vary your instructions. I know each site has to have its own database user and password and that I install each time for each website right? Aside from that what other changes do I need to make to your instructions and what does the folder structure need to look like for each install. Thanks so much for your instructions so far too.

      Reply
        • Wow, thanks. I’ve thought about going with MU before. The reason I prefer to make each wp install entirely self contained on the same server if that is possible is that I want to limit any WP problems to one installation. I’ve had situations before and I like only having that happen on a single install at a time. I have standardized on plugins where client needs match up, and when something happens on one, I have the time to try to understand it before I proceed with same on similar installs. This seems tedious but it has been a life saver. It’s easier to deal with one client at a time in this scenario than all of them. What do you think?

          My dream installation would be on FreeBSD, because I could use jails running stripped down CentOS for each WP instance. I’ve read jails are virtual containers without the performance penalty. Although FreeBSD is my favorite OS it does not have the spotlight and development that RedHat and CentOS at the VPS hosting level.

          Reply
          • I see what you mean. Both have their pros and cons, so that’s why I suggested the first WordPress MU option. :)

            But it’s easy setup if you want to run ten different WordPress installs with Nginx. You can simply create ten directories with WordPress and then you need of course own databases for every install and virtual host files for every site.

            Directories like:
            /srv/www/wordpress1/public_html
            /srv/www/wordpress2/public_html
            /srv/www/wordpress3/public_html

            Databases like:
            wordpress1
            wordpress2
            wordpress3

            Finally most interesting part. You can do example following virtual host setup:

            Create file /etc/nginx/custom/wp-common.conf (this is example):

            
                location / {
                    index index.php;
                }
             
                # Disable favicon.ico logging
                location = /favicon.ico {
                    log_not_found off;
                    access_log off;
                }
             
                # Allow robots and disable logging
                location = /robots.txt {
                    allow all;
                    log_not_found off;
                    access_log off;
                }
             
                # Enable permalink structures
                if (!-e $request_filename) {
                    rewrite . /index.php last;
                }
             
                # Handle php requests
                location ~ \.php$ {
                    include /etc/nginx/fastcgi_params;
                    fastcgi_pass  127.0.0.1:9000;
                    fastcgi_index index.php;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                }
             
                # Disable static content logging and set cache time to max
                location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                    expires max;
                    log_not_found off;
                }
             
                # Deny access to htaccess and htpasswd files
                location ~ /\.ht {
                    deny  all;
                }
            

            Then you can create virtual host files (under sites-available / sites-enabled) like:

            
            ## WordPress 1 ##
            server {
                server_name wordpress1;
                access_log /srv/www/wordpress1/logs/access.log;
                error_log /srv/www/wordpress1/logs/error.log;
                root /srv/www/wordpress1/public_html;
            
                include /etc/nginx/custom/wp-common.conf;
            }
            
            ## WordPress 2 ##
            server {
                server_name wordpress2;
                access_log /srv/www/wordpress2/logs/access.log;
                error_log /srv/www/wordpress2/logs/error.log;
                root /srv/www/wordpress2/public_html;
            
                include /etc/nginx/custom/wp-common.conf;
            }
            
            ...
            

            Please let me know if you get it working or have some problems with it?

            Later you can consider PHP-FPM pools and other optimizations, if you (example) want / need several servers to process PHP etc.

            I like FreeBSD too, but you are totally right that it’s not common at the VPS hosting level.

            Reply
            • I really can’t thank you enough. I’ll let you know my progress and if you don’t have a donate button get one.

              Reply
              • Hi Mijiale,

                You are very welcome! I personally do not run this site because of the money, I just want to give my support to the Linux users and community. The reason why, even I run ads here is that the running this site will of course cost something. :)

                Reply
                • I’m getting ready to deploy this this weekend. What do you think my minimum resources should be for the configuration I’ve described above? Right now I do have two Linodes. One is a 1024(Nginx, MySQL, WordPress) and the other a 512 (VSFTPD). Do you think I might be better off running the databases from the 512 over a private IP address or do you think its fine to run everything from the main server? I’m only looking at putting maybe 10 sites on the server if even that many. Thanks again.

                  Reply
                  • Hi Mijiale,

                    Actually all depends on the amount of traffic and concurrent users / connections and amount of RAM what one running php process needs. Can you tell me any estimate about total traffic? Example total page loads per month or day?

                    Then there are many simple and effective caching techniques that can reduce the load on the server and reduce page loading time.

                    Reply
                    • There all organizational sites with pretty flat usage per month. Only 2 get say 100 page views per week. The rest don’t do that in a month.

                      Reply
                      • Okay, then your Linode 1024 (Nginx, PHP-FPM, MySQL, WordPress) is more than enough. :) You can easily handle several thousands page views per day with Linode 1024. Actually you can do it even with your Linode 512. :)

    7. Awesome post ! Helped me so much, thank you !

      Reply
    8. Okay I initially installed for a single site and then split the virtual host file as you said and got it working both time. I am by the way using the unix socks call vs. 127.0.0.1… Everything is fine except this, when I went to upload a plugin I got Unable to create directory… Is its parent directory writable by the server? Not really sure what the issue is at this point. Do I need to specify somewhere that directory isn’t /srs/www/wordpress but /srv/www/wordpress01 somewhere and if so, where. Thanks.

      Reply
      • Hi Mijiale,

        Nice to hear that you got it working.

        Could you post output of following commands:

        
        ls -la /srv/www/wordpress01/public_html/wp-content
        
        ls -la /srv/www/wordpress01/public_html/wp-content/plugins
        
        Reply
        • Output to the first command is:
          total 20
          drwxr-xr-x 4 33 tape 4096 Sep 6 12:43 .
          drwxr-xr-x 5 nginx nginx 4096 Oct 22 23:20 ..
          -rw-r–r– 1 33 tape 28 Jan 8 2012 index.php
          drwxr-xr-x 3 33 tape 4096 Sep 6 12:43 plugins
          drwxr-xr-x 4 33 tape 4096 Sep 6 12:43 themes

          Output to the second list is:
          total 20
          drwxr-xr-x 3 33 tape 4096 Sep 6 12:43 .
          drwxr-xr-x 4 33 tape 4096 Sep 6 12:43 ..
          drwxr-xr-x 2 33 tape 4096 Sep 6 12:43 akismet
          -rw-r–r– 1 33 tape 2262 Nov 10 2010 hello.php
          -rw-r–r– 1 33 tape 30 Apr 15 2009 index.php

          Thanks.

          Reply
          • OK, I have found this is a very old error. Not wanting to 777 the entire directory I tried creating each of the required directories manually and then changing the owner of each to Nginx. It’s still not working, but I now have a new error, so perhaps that is progress. “The uploaded file could not be moved to /srv/www/wordpress01/public_html/wp-content/uploads/2012/10”. Is this because tmp is not owned by nginx? On one site they suspect mod-secure could be the issue. On another don’t run php in safe mode. As you know I’m using a linode, so I do have more flexibility and SELinux is disabled.

            Reply
            • Yes, this is permission problem and 777 permissions is not needed. Could you also post output of following command:

              
              grep -H -e "user =" -e "group =" /etc/php-fpm.d/*.conf
              
              Reply
              • This is the grep you wanted.

                /etc/php-fpm.d/www.conf:;listen.group = nobody
                /etc/php-fpm.d/www.conf:user = apache
                /etc/php-fpm.d/www.conf:group = apache

                Apache is even on my system. I’m guessing you want me to change both of those apache references to nginx right? Since I don’t know why this is like that, I’ll wait for you to tell me lol. Thanks.

                Reply
                • I also wanted to add since I did look at the php conf file referenced that I did NOT use the listen = 127.0.0.1:9000, but rather listen = /tmp/php5-fpm.sock. Therefore here are additional code blocks in the conf for you to consider:

                  ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
                  ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
                  ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
                  ; must be separated by a comma. If this value is left blank, connections will be
                  ; accepted from any ip address.
                  ; Default Value: any
                  listen.allowed_clients = 127.0.0.1

                  ; Set permissions for unix socket, if one is used. In Linux, read/write
                  ; permissions must be set in order to allow connections from a web server. Many
                  ; BSD-derived systems allow connections regardless of permissions.
                  ; Default Values: user and group are set as the running user
                  ; mode is set to 0666
                  ;listen.owner = nobody
                  ;listen.group = nobody
                  ;listen.mode = 0666

                  ; Unix user/group of processes
                  ; Note: The user is mandatory. If the group is not set, the default user’s group
                  ; will be used.
                  ; RPM: apache Choosed to be able to access some dir as httpd
                  user = apache
                  ; RPM: Keep a group allowed to write in log dir.
                  group = apache

                  The third block is where the apache value is assigned but I am curious if I am to make changes in the second and first blocks or leave them as they are? Thanks again.

                  Reply
                  • Hi Mijiale,

                    Actually this apache:apache is default config and totally okay, if you change your WordPress installation permissions accordingly (you can of course use some other user and group too). So you can chown your WordPress installation permissions to apache user and group and then uploading files should not be problem at all. :)

                    You can also comment out listen.allowed_clients = 127.0.0.1 from first section, if you use Unix socket. As comment says Makes sense only with a tcp listening socket.. :)

                    Reply
                    • Wow. Thanks. Upload is working great. Is this setup moderately update friendly? Right now its not a problem because I will actually do the setup several times just to familiarize myself with it. Am planning to re-roll the OS again anyway because I can get it much more lean I think.

                      Also plan to incorporate your “Nginx and PHP-FPM Configuration and Optimizing Tips and Tricks” as part of the set-up too. Many thanks again.

                      Reply
                      • Excellent! You are welcome! :)

                        This is actually very easy setup, when you get used to it. And it’s very easy to remove or add new sites and you can run easily very nice amount of low traffic sites with one Linode 1024 server.

                        And I agree that you should check Nginx and PHP-FPM Configuration and Optimizing Tips and Tricks if you want to get the most out of your Linode VPS. ;)

    9. hi, i followed all your steps in setting up in Apache, however when i try to access the site.. it will gave me Error 504 Gateway timeout. thank you for posting this tutorial by the way :)

      Reply
      • Hi nappy,

        Do you try to access WordPress site on localhost or remote host?

        Reply
    10. Hello, JR:

      I must thank you for this tutorial. It helped me greatly. I have set up wordpress (chinese language version) with mysql, nginx, php-fpm on my CentOS 6.3 system, but finally, I got stuck at this point:
      When I upload a theme file, it forces me to input ftp connecting info, including hostname, ftp username and ftp password.

      I guess this must be an old problem, and maybe only need a little trick. I tried a ton of ways, including the Q&A above and others from google, but this problem has not been solved yet. I even disabled the SELinux, and reboot the OS, but it still does not work, so I enabled it again. It has cost me the last night, and even the whole day today, so I have to ask for help.

      This is the info of my wordpress installation environment:

      1.permission of wordpress directory:

      # ll /srv/www/
      total 4
      drwxr-xr-x. 4 nginx nginx 4096 Oct 31 21:35 wordpress

      2.I changed the rights to 777 for wp-content directory (and its subs), so it looks like this:

      drwxrwxrwx. 6 nginx nginx 4096 Nov 1 17:50 wp-content

      3.The content of wp-config.php:

      define('DB_NAME', 'wordpress_blog');
      define('DB_USER', 'wordpress123');
      define('DB_PASSWORD', 'some_good_password_for_wordpress222');
      define('DB_HOST', 'localhost');
      define('DB_CHARSET', 'utf8');
      define('DB_COLLATE', '');
      define('AUTH_KEY', '0GGgF}D9c7=hc]H:U8[>!f?IcB+E?}k>gkY&@flMU{lsh8a`1TkB-]z[/xp-m1W>');
      define('SECURE_AUTH_KEY', 'b|:SS>[(`u+!{tBSFFDCxBm,`=?03uQJfI9/8vpU:JS_/i$+4=4;KOr}6(s)63ad');
      define('LOGGED_IN_KEY', '[email protected](^W(r_Y%p-+IU_XRp.V#u]kJB66)h0qRTJ&E1+f:@aLkUg}|[A5NgI|./|z;^k');
      define('NONCE_KEY', 'tDE[?Z5mf^STlV`@6OaVaOl>Lqs#s G3OLb`-r1,gt#o|^r|Bi;r0OSh-x|0.356');
      define('AUTH_SALT', '[email protected]$A;};.:j&yk<hM([email protected]#:;vBb)-?5^cOP_S}h=Xn<NfG0W??qR~V/`');
      define('SECURE_AUTH_SALT', 'wZ9UEeMhi2+.BR tOr+C{?5p*I-Vm.;]Nti6yL$B4=1`A-N875WIC2FXT{R4frb7');
      define('LOGGED_IN_SALT', 'IBzozt 6ZjqS#:id|w|D(@s,chldzTCZmK [email protected]_aW');
      $table_prefix = 'wp_';
      define('WPLANG', 'zh_CN');
      define('wp_DEBUG', true);
      /* Added by myself */
      define(“FS_METHOD”, “direct”);
      define(“FS_CHMOD_DIR”, 0777);
      define(“FS_CHMOD_FILE”, 0777);
      if ( !defined('ABSPATH') )
      define('ABSPATH', dirname(__FILE__) . '/');
      require_once(ABSPATH . 'wp-settings.php');

      4.The config info of nginx:

      # cat /etc/nginx/nginx.conf

      user nginx;
      worker_processes 1;

      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;

      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 65;

      #gzip on;

      include /etc/nginx/conf.d/*.conf;

      ## Load virtual host conf files. ##
      include /etc/nginx/sites-enabled/*;
      }

      5.The config info of php-fpm:

      # cat /etc/php-fpm.d/www.conf
      ; Start a new pool named 'www'.
      [www]

      ; The address on which to accept FastCGI requests.
      ; Valid syntaxes are:
      ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
      ; a specific port;
      ; 'port' - to listen on a TCP socket to all addresses on a
      ; specific port;
      ; '/path/to/unix/socket' - to listen on a unix socket.
      ; Note: This value is mandatory.
      listen = 127.0.0.1:9000

      ; Set listen(2) backlog. A value of '-1' means unlimited.
      ; Default Value: -1
      ;listen.backlog = -1

      ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
      ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
      ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
      ; must be separated by a comma. If this value is left blank, connections will be
      ; accepted from any ip address.
      ; Default Value: any
      ;listen.allowed_clients = 127.0.0.1

      ; Set permissions for unix socket, if one is used. In Linux, read/write
      ; permissions must be set in order to allow connections from a web server. Many
      ; BSD-derived systems allow connections regardless of permissions.
      ; Default Values: user and group are set as the running user
      ; mode is set to 0666
      ;listen.owner = nobody
      ;listen.group = nobody
      ;listen.mode = 0666

      ; Unix user/group of processes
      ; Note: The user is mandatory. If the group is not set, the default user's group
      ; will be used.
      ; RPM: apache Choosed to be able to access some dir as httpd
      user = apache
      ; RPM: Keep a group allowed to write in log dir.
      group = apache

      ; Choose how the process manager will control the number of child processes.
      ; Possible Values:
      ; static - a fixed number (pm.max_children) of child processes;
      ; dynamic - the number of child processes are set dynamically based on the
      ; following directives:
      ; pm.max_children - the maximum number of children that can
      ; be alive at the same time.
      ; pm.start_servers - the number of children created on startup.
      ; pm.min_spare_servers - the minimum number of children in 'idle'
      ; state (waiting to process). If the number
      ; of 'idle' processes is less than this
      ; number then some children will be created.
      ; pm.max_spare_servers - the maximum number of children in 'idle'
      ; state (waiting to process). If the number
      ; of 'idle' processes is greater than this
      ; number then some children will be killed.
      ; Note: This value is mandatory.
      pm = dynamic

      ; The number of child processes to be created when pm is set to 'static' and the
      ; maximum number of child processes to be created when pm is set to 'dynamic'.
      ; This value sets the limit on the number of simultaneous requests that will be
      ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
      ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
      ; CGI.
      ; Note: Used when pm is set to either 'static' or 'dynamic'
      ; Note: This value is mandatory.
      pm.max_children = 50

      ; The number of child processes created on startup.
      ; Note: Used only when pm is set to 'dynamic'
      ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
      pm.start_servers = 5

      ; The desired minimum number of idle server processes.
      ; Note: Used only when pm is set to 'dynamic'
      ; Note: Mandatory when pm is set to 'dynamic'
      pm.min_spare_servers = 5

      ; The desired maximum number of idle server processes.
      ; Note: Used only when pm is set to 'dynamic'
      ; Note: Mandatory when pm is set to 'dynamic'
      pm.max_spare_servers = 35

      ; The number of requests each child process should execute before respawning.
      ; This can be useful to work around memory leaks in 3rd party libraries. For
      ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
      ; Default Value: 0
      ;pm.max_requests = 500

      ; The URI to view the FPM status page. If this value is not set, no URI will be
      ; recognized as a status page. By default, the status page shows the following
      ; information:
      ; accepted conn - the number of request accepted by the pool;
      ; pool - the name of the pool;
      ; process manager - static or dynamic;
      ; idle processes - the number of idle processes;
      ; active processes - the number of active processes;
      ; total processes - the number of idle + active processes.
      ; The values of 'idle processes', 'active processes' and 'total processes' are
      ; updated each second. The value of 'accepted conn' is updated in real time.
      ; Example output:
      ; accepted conn: 12073
      ; pool: www
      ; process manager: static
      ; idle processes: 35
      ; active processes: 65
      ; total processes: 100
      ; By default the status page output is formatted as text/plain. Passing either
      ; 'html' or 'json' as a query string will return the corresponding output
      ; syntax. Example:
      ; http://www.foo.bar/status
      ; http://www.foo.bar/status?json
      ; http://www.foo.bar/status?html
      ; Note: The value must start with a leading slash (/). The value can be
      ; anything, but it may not be a good idea to use the .php extension or it
      ; may conflict with a real PHP file.
      ; Default Value: not set
      ;pm.status_path = /status

      ; The ping URI to call the monitoring page of FPM. If this value is not set, no
      ; URI will be recognized as a ping page. This could be used to test from outside
      ; that FPM is alive and responding, or to
      ; - create a graph of FPM availability (rrd or such);
      ; - remove a server from a group if it is not responding (load balancing);
      ; - trigger alerts for the operating team (24/7).
      ; Note: The value must start with a leading slash (/). The value can be
      ; anything, but it may not be a good idea to use the .php extension or it
      ; may conflict with a real PHP file.
      ; Default Value: not set
      ;ping.path = /ping

      ; This directive may be used to customize the response of a ping request. The
      ; response is formatted as text/plain with a 200 response code.
      ; Default Value: pong
      ;ping.response = pong

      ; The timeout for serving a single request after which the worker process will
      ; be killed. This option should be used when the 'max_execution_time' ini option
      ; does not stop script execution for some reason. A value of '0' means 'off'.
      ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
      ; Default Value: 0
      ;request_terminate_timeout = 0

      ; The timeout for serving a single request after which a PHP backtrace will be
      ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
      ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
      ; Default Value: 0
      ;request_slowlog_timeout = 0

      ; The log file for slow requests
      ; Default Value: not set
      ; Note: slowlog is mandatory if request_slowlog_timeout is set
      slowlog = /var/log/php-fpm/www-slow.log

      ; Set open file descriptor rlimit.
      ; Default Value: system defined value
      ;rlimit_files = 1024

      ; Set max core size rlimit.
      ; Possible Values: 'unlimited' or an integer greater or equal to 0
      ; Default Value: system defined value
      ;rlimit_core = 0

      ; Chroot to this directory at the start. This value must be defined as an
      ; absolute path. When this value is not set, chroot is not used.
      ; Note: chrooting is a great security feature and should be used whenever
      ; possible. However, all PHP paths will be relative to the chroot
      ; (error_log, sessions.save_path, ...).
      ; Default Value: not set
      ;chroot =

      ; Chdir to this directory at the start. This value must be an absolute path.
      ; Default Value: current directory or / when chroot
      ;chdir = /var/www

      ; Redirect worker stdout and stderr into main error log. If not set, stdout and
      ; stderr will be redirected to /dev/null according to FastCGI specs.
      ; Default Value: no
      ;catch_workers_output = yes

      ; Limits the extensions of the main script FPM will allow to parse. This can
      ; prevent configuration mistakes on the web server side. You should only limit
      ; FPM to .php extensions to prevent malicious users to use other extensions to
      ; exectute php code.
      ; Note: set an empty value to allow all extensions.
      ; Default Value: .php
      ;security.limit_extensions = .php .php3 .php4 .php5

      ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
      ; the current environment.
      ; Default Value: clean env
      ;env[HOSTNAME] = $HOSTNAME
      ;env[PATH] = /usr/local/bin:/usr/bin:/bin
      ;env[TMP] = /tmp
      ;env[TMPDIR] = /tmp
      ;env[TEMP] = /tmp

      ; Additional php.ini defines, specific to this pool of workers. These settings
      ; overwrite the values previously defined in the php.ini. The directives are the
      ; same as the PHP SAPI:
      ; php_value/php_flag - you can set classic ini defines which can
      ; be overwritten from PHP call 'ini_set'.
      ; php_admin_value/php_admin_flag - these directives won't be overwritten by
      ; PHP call 'ini_set'
      ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

      ; Defining 'extension' will load the corresponding shared extension from
      ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
      ; overwrite previously defined php.ini values, but will append the new value
      ; instead.

      ; Default Value: nothing is defined by default except the values in php.ini and
      ; specified at startup with the -d argument
      ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]
      ;php_flag[display_errors] = off
      php_admin_value[error_log] = /var/log/php-fpm/www-error.log
      php_admin_flag[log_errors] = on
      ;php_admin_value[memory_limit] = 128M

      ; Set session path to a directory owned by process user
      php_value[session.save_handler] = files
      php_value[session.save_path] = /var/lib/php/session

      6.Other info:

      # uname -a
      Linux 1.2 2.6.32-279.11.1.el6.i686 #1 SMP Tue Oct 16 14:40:53 UTC 2012 i686 i686 i386 GNU/Linux
      # lsb_release -a
      LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
      Distributor ID: CentOS
      Description: CentOS release 6.3 (Final)
      Release: 6.3
      Codename: Final

      I wonder whether all the info is enought?

      Many thanks…

      Reply
      • Hello Jack,

        Thank you for this information. It’s totally enough. :) And you have almost everything right places, but based on this information, it looks like problem is permissions on your wordpress directory.

        You have two option change wordpress directory permissions to apache:apache or alternatively change php-fpm run as nginx user and nginx group.

        I recommend you to change permissions to apache and then you don’t have problems with sessions etc. So do following as root:

        
        chown -R apache:apache /srv/www/wordpress
        

        And try again.

        If you want change php-fpm user and group to nginx then modify /etc/php-fpm.d/www.conf, like:

        
        ; Unix user/group of processes
        ; Note: The user is mandatory. If the group is not set, the default users group
        ; will be used.
        ; RPM: apache Choosed to be able to access some dir as httpd
        user = nginx
        ; RPM: Keep a group allowed to write in log dir.
        group = nginx
        

        Restart php-fpm and try again.

        Reply
        • Hi, JR
          Thousands of thanks to you!

          I tried the first way, and it worked very well. Then I rolled back it, and tried the second way, it worked also well.

          In fact, I had tried the second way before, but I didn’t restart php-fpm, so I know now this is just what the problem is.

          But I still have a question:
          Why didn’t you use apache:apache in your tutorial instead of nginx:nginx, or tell people to change php-fpm user and group to nginx by modifying /etc/php-fpm.d/www.conf?

          I guess you must have a just cause, so what’s that?

          Many thanks again.

          Reply
          • Hi again Jack,

            You are very welcome! Nice to hear that you got it working! :)

            And about your question…this is totally my mistake on this guide and it’s fixed now. I had earlier part about modifying php-fpm pool conf, but I removed it, because using nginx user/group might cause some another problems example with sessions and I obviously forgot change permissions accordingly. Sorry for inconvenience caused by this mistake. I have to yet test this guide once again on clean installed system. :)

            Reply
            • Hi, JR

              It’s my great pleaser to hear that my question helped you to improve this tutorial, so it will help people more smoothly.

              And, I also learned a lot from your answer.
              It’s very kind of you, thank you indeed!

              Reply
              • Your question was excellent! :) Now I tested nginx part again and uploads should work now smoothly.

                You are very welcome!

                Reply
    11. Hi JR,

      First of all thank you for the blog, it’s been a great help already.

      I’m not installing wordpress but having followed your guide exactly (apart from changing to my own domain names) for installing NGINX and PHP-FPM on a clean CentOS 5.8 VPS I thought this comment thread might have an answer.

      I’m installing the Simple Machines Forum and it needs FTP access for initial configuration and for adding modules.

      All I need is read/write access to the /srv/www directory as an ftp user with VSFTPD while preserving all the nginx file ownership and still running nginx as the nginx user.

      Do you know of the simplest way I can do this?

      Thank you in advance,

      David

      Reply
      • Hi David,

        You probably have same problem what I discuss with Jack before. I accidentally forgot change nginx user/group to apache and it cause this style problems with WordPress. And I use also SMF 2 on IF !1 0 forums and I can install modules without ftp when I have proper permissions.

        So what I recommend you to test, is simple change your SMF installation directory user / group to apache, like:

        
        chown -R apache:apache /srv/www/your_smf_installation
        

        Then try use SMF Package Manager. Is it working then?

        Reply
        • Wow, I can’t believe it was such a simple problem. I was up until 4am the other night trying to fix it.

          Thank you very much for the help, greatly appreciated!

          Reply
          • You are very welcome! Nice to hear that you got it working. :)

            Reply
    12. Hi, I have had an error, the browse can’t the database, the mistake:

      /** MySQL hostname */
      define(‘DB_HOST’, ‘localhost’);

      my solution:

      /** MySQL hostname */
      define(‘DB_HOST’, ‘127.0.0.1’);

      Reply
      • Hi christian,

        Normally localhost points to 127.0.0.1.

        What is your output if you try following:

        
        host localhost
        
        Reply
    13. Hey JR,

      Awesome tutorial. And thanks for having such an extensive comment/feedback from!

      I have a question about url rewrites. I’ve looked on google but only got more confused. Currently I want my url to go from:

      url/portfolio-item/blah

      to:

      url/#!blah

      At the moment, I have


      location /portfolio-item/ {
      rewrite ^/portfolio-item/(.*)$ /$1 break;
      }

      Looking through the documentation, I’m not quite sure what (.*) means, nor am I clear on the diference between “last” and “break”. If I knew them, I probably could do more.

      Any help to shed some light on this would be awesome. Thanks!

      Reply
      • Hi Chris,

        Actually this looks ok, but are you sure that you want rewrite to url/#!blah?

        (.*) means everything here

        last – completes processing of current rewrite directives and restarts the process (including rewriting) with a search for a match on the URI from all available locations.
        break – completes processing of current rewrite directives and non-rewrite processing continues within the current location block only.
        redirect – returns temporary redirect with code 302; it is used if the substituting line begins with http://
        permanent – returns permanent redirect with code 301
        More info from Nginx HttpRewriteModule.

        Reply
    14. I set up a wordpress site using this guide and worked great for a centos 6.4, php, apache, mysql cluster setup. One thing that I’m not sure how to get to work is the /server-status page. I un-commented it from the httpd.conf file and when trying to browse to it I get wordpress 404 page. Does anyone have any ideas on how to get it to work?

      Thanks,
      Corey

      Reply
      • Hi Corey,

        Nice to hear that you get all up and running.

        Could you post config what you use to enable /server-status page?

        Do you get anything related to this in your error_log?

        Reply
        • I simply uncommented the /etc/httpd/conf/httpd.conf lines for this”

          SetHandler server-status
          Order deny,allow
          Deny from all
          Allow from .example.com

          However my wordpress.conf in /etc/httpd/conf.d/ folder looks like this:

          AllowOverride All
          Options FollowSymLinks

          DocumentRoot /usr/share/wordpress/
          ServerName example.com
          ErrorLog /var/log/httpd/wordpress-error-log
          CustomLog /var/log/httpd/wordpress-acces-log common

          example.com is our actual internal domain and external domain in the configs above. changed for security.

          Reply
          • I just see the access logs showing the 404.

            Reply
          • fixed html tags, sorry:
            httpd.conf

            SetHandler server-status
            Order deny,allow
            Deny from all
            Allow from .teamfreeze.com

            wordpress.conf

            AllowOverride All
            Options FollowSymLinks

            DocumentRoot /usr/share/wordpress/
            ServerName nativex.com
            ErrorLog /var/log/httpd/wordpress-error-log
            CustomLog /var/log/httpd/wordpress-acces-log common

            Reply
            • ok, really feel like a noob now.

              but httpd.conf file those settings are with location tags and wordpress.conf file those setting are for directory tags then virualhost *:80 tags.

              Reply
              • Thanks, you can post this config to http://pastebin.com

                But yes problem is probably following, try to use something like following in your wordpress installation .htaccess file:

                
                # BEGIN WordPress
                
                RewriteEngine On
                RewriteBase /
                RewriteRule ^index\.php$ - [L]
                RewriteCond %{REQUEST_URI} !=/server-status
                RewriteCond %{REQUEST_FILENAME} !-f
                RewriteCond %{REQUEST_FILENAME} !-d
                RewriteRule . /index.php [L]
                
                # END WordPress
                

                Most important line here is following:

                
                RewriteCond %{REQUEST_URI} !=/server-status
                
                Reply
                • Thanks very much that worked great. I always forget about the .htaccess file.

                  Reply
                  • You are welcome! Excellent to hear that you got it working! :)

                    Reply
    15. I really love your site, and have used it for everything since installing fedora 18. However installing WordPress wasnt as easy as I thought. Your tutorial is very thorough,however, If you specify in step “4.2 Set wordpress pointing to localhost (or some other host)”
      that the host file must match our host name would be better. My host was automaticlly set as [email protected] and when i changed that to wordpress in my host file, it broke my apache. I have since fixed the issue, but it took some time googleing to figure out what went wrong.

      Reply
1 2 3 4

Leave a Reply to Fractioncalc Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close