ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    The WordPress on CentOS LEMP Challenge

    Scheduled Pinned Locked Moved IT Discussion
    wordpresslemplinuxrhelnginxcentos
    60 Posts 14 Posters 18.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JaredBuschJ
      JaredBusch
      last edited by

      My friend's website http://wolf-peak.com is up and running on WordPress on CentOS7.

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        How To Forge has details now too...

        http://www.howtoforge.com/how-to-install-nginx-with-php-and-mysql-lemp-stack-on-centos-7

        1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch
          last edited by

          Here is my process for Apache on CentOS7 minimal

          # install packages needed to run wordpress
          yum -y install httpd;
          yum -y install mariadb mariadb-server;
          yum -y install php php-mysql wget nano;
          systemctl enable httpd.service;
          systemctl enable mariadb.service;
          setenforce permissive;
          systemctl start mariadb;
          firewall-cmd --zone=public --add-port=http/tcp;
          firewall-cmd --zone=public --add-port=http/tcp --permanent;
          systemctl reload firewalld;
          systemctl start httpd;
          
          # create database and user for this website/domain
          echo "CREATE DATABASE wp_yourdomain;" | mysql;
          echo "CREATE USER 'wp_yourdomain'@'localhost' IDENTIFIED BY 'somerandompassword';" | mysql;
          echo "GRANT ALL PRIVILEGES ON *.* TO 'wp_yourdomain'@'localhost';" | mysql;
          echo "FLUSH PRIVILEGES;" | mysql;
          
          # download wordpress
          cd /opt;
          wget https://wordpress.org/latest.tar.gz;
          tar -xzvf latest.tar.gz;
          chown -R apache:apache /opt/wordpress/;
          
          # copy the wordpress directory to the domain folder desired
          cp -R /opt/wordpress/ /opt/yourdomain/
          
          # create the wp-config.php file and set the database information
          cp /opt/yourdomain/wp-config-sample.php /opt/yourdomain/wp-config.php;
          sed -i -e 's/database_name_here/wp_yourdomain/' /opt/yourdomain/wp-config.php;
          sed -i -e 's/username_here/wp_yourdomain/' /opt/yourdomain/wp-config.php;
          sed -i -e 's/password_here/somerandompassword/' /opt/yourdomain/wp-config.php;
          
          # go to https://api.wordpress.org/secret-key/1.1/salt/ and copy paste a unique salt into your wp-config.php file
          # no idea how to use sed to find/replace this. This data goes at the end of the wp-config.php file.
          define('AUTH_KEY',         'P/u!4L<`Ia+2e=^w&KBgDs[f)r:vcM~=ylK-E:Hq|B`HGv%cZtAN*Toy@b],6g!b');
          define('SECURE_AUTH_KEY',  'qJV7.|d>:N$61J*_<wyX +K<P(Xz_TId+uJQ+3V/~h_L8}k_l4t,i[^Ss^3}(1j*');
          define('LOGGED_IN_KEY',    'dfJ;0JEt?u&r[T%Vn|@|y3AXx&CO~bjmfy{9gIPi2i|ouwmv99*(a`-i(*F}L{g+');
          define('NONCE_KEY',        'Qy{%n+h,rt66ILfR[;xO2kCMrjMY&vppiU X+cq*OXeS44hyP.At3K3Eb3r~zOH-');
          define('AUTH_SALT',        '3qH|kzJYd.*JmV%()x8yyl1a;^SC3}]D}7koA%|W*z(GRA/wF=p!(9xT~;+0A>>D');
          define('SECURE_AUTH_SALT', '1$LIVd(W 3X~.L$Or YbUtUBL%&}JNxF6o`tw.WVJ3b|v]Ik3c0afEy0j =D2R5<');
          define('LOGGED_IN_SALT',   '[-Rf2*n&U]D&KWZ 5IR{63D^$g~oGq</!Pi(&8kEQ*J2Ui?cHo!h4(1~<Qj?g ah');
          define('NONCE_SALT',       'xRL!G|/Xe&f|WfCp(v(6H.?-OwY2uxp^HJYYhMWx8KJca0s<J_2%E[cr:ZZ9t`1k');
          
          # edit the apache config to change the default document root to point to your wordpress folder
          # by default it is located: /etc/httpd/conf/httpd.conf
          # Change the following two lines
          DocumentRoot "/opt/yourdomain"		# was "/var/www/html"
          <Directory "/opt/yourdomain">		# was "/var/www/html"
          
          # If you are going to have multiple domains pointing to this server eventually,
          # you need to create a virtual host entry in apache config
          # by default it is located: /etc/httpd/conf/httpd.conf
          # just need to be at the end of the file.
          # you will have one of these for each domain name pointing to this host.
          <VirtualHost *:80>
          	ServerAdmin email@yourdomain.com
          	DirectoryIndex index.php index.html index.htm
          	DocumentRoot /opt/yourdomain
          	ServerName yourdomain.com
          	ServerAlias *.yourdomain.com
          	LogLevel warn
          	ErrorLog logs/yourdomain-error_log
          	CustomLog logs/yourdomain-access_log common
          		<Directory />
          			Require all granted
          			Options Indexes FollowSymLinks Includes ExecCGI
          			AllowOverride All
          			Order allow,deny
          			Allow from all
          		</Directory>
          </VirtualHost>
          
          # restart the webserver then browse to your site.
          systemctl reload httpd;
          
          1 Reply Last reply Reply Quote 1
          • JaredBuschJ
            JaredBusch
            last edited by

            I guess I could load wordpress onto jaredbusch.com and post this there.

            no idea what i want to do with that domain. just bought it because it was available.

            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller
              last edited by

              I mostly use mine for email.

              thanksajdotcomT 1 Reply Last reply Reply Quote 0
              • thanksajdotcomT
                thanksajdotcom @scottalanmiller
                last edited by

                @scottalanmiller said:

                I mostly use mine for email.

                No you don't. You use your gmail for everything, including NTG STUFF! Case and point: storage locker.

                scottalanmillerS 1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller @thanksajdotcom
                  last edited by

                  @ajstringham I'm not sure what you are trying to say.

                  thanksajdotcomT 1 Reply Last reply Reply Quote 0
                  • thanksajdotcomT
                    thanksajdotcom @scottalanmiller
                    last edited by

                    @scottalanmiller said:

                    @ajstringham I'm not sure what you are trying to say.

                    The storage locker, for NTG Lab stuff, that you had here in Texas...you put a ton of different things as your Gmail when you should use your NTG email. I had a very interesting convo with @Minion-Queen once on it...

                    1 Reply Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller
                      last edited by

                      I only use Gmail when I need to make non-NTG accounts. I don't even read my Gmail, it's the spam account. It often exists in odd places because of companies having really bad account management where we felt it was dangerous to use the company account. I'm actually very careful about it.

                      thanksajdotcomT 1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User
                        last edited by

                        I never use a personal email for work use... Unless of course my former boss decides he thinks he needs to use it.

                        1 Reply Last reply Reply Quote 0
                        • thanksajdotcomT
                          thanksajdotcom @scottalanmiller
                          last edited by

                          @scottalanmiller said:

                          I only use Gmail when I need to make non-NTG accounts. I don't even read my Gmail, it's the spam account. It often exists in odd places because of companies having really bad account management where we felt it was dangerous to use the company account. I'm actually very careful about it.

                          Not what I've heard.

                          scottalanmillerS 1 Reply Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller @thanksajdotcom
                            last edited by

                            @ajstringham said:

                            @scottalanmiller said:

                            I only use Gmail when I need to make non-NTG accounts. I don't even read my Gmail, it's the spam account. It often exists in odd places because of companies having really bad account management where we felt it was dangerous to use the company account. I'm actually very careful about it.

                            Not what I've heard.

                            Uh huh?

                            1 Reply Last reply Reply Quote 0
                            • JaredBuschJ
                              JaredBusch
                              last edited by

                              Here we go. i setup wordpress on jarebusch.com using the process above and i've put the latest version there.

                              We'll see how bad the comments spam up with no protection plugin in place. I have it set to all comments be moderated. I am curious to see how fast it gets spammy.

                              http://jaredbusch.com/2014/08/11/how-to-install-wordpress-on-centos-7-minimal/

                              1 Reply Last reply Reply Quote 1
                              • scottalanmillerS
                                scottalanmiller
                                last edited by

                                The site loads very quickly.

                                JaredBuschJ 1 Reply Last reply Reply Quote 0
                                • JaredBuschJ
                                  JaredBusch @scottalanmiller
                                  last edited by

                                  @scottalanmiller said:

                                  The site loads very quickly.

                                  It is a clean CentOS 7 minimal install running in Server 2012 R2 With the Hyper-V role.
                                  It is located in a data center in St. Louis.

                                  There are umm 5 sites all running Wordpress on the VM. Said sites setup in the process of creating that guide.

                                  1 Reply Last reply Reply Quote 0
                                  • scottalanmillerS
                                    scottalanmiller
                                    last edited by

                                    Xmodulo now has a nice guide for actually doing LEMP on CentOS that is meant for real people, not just people looking to do a one liner challenge 🙂

                                    How to Install LEMP Stack on CentOS via Xmodulo

                                    1 Reply Last reply Reply Quote 0
                                    • mlnewsM
                                      mlnews
                                      last edited by

                                      Long time follow up: http://www.unixmen.com/vpssim-a-script-to-deploy-lemp-stack-automatically-in-centos/

                                      1 Reply Last reply Reply Quote 1
                                      • scottalanmillerS
                                        scottalanmiller
                                        last edited by

                                        The original post on my own blog was lost and is not only in the Internet Archive, so copying it here...


                                        From May 14th, 2014:

                                        We all know that installing WordPress on LAMP is super simple. A challenge was issued on Spiceworks to demonstrate how WordPress on LEMP (Nginx rather than Apache) could be easy on CentOS. So that challenge could not go unmet. So the goal here is to install, quickly and hopefully easily, WordPress on LEMP.

                                        Assumption: Starting with CentOS 6.5 “Minimal” accepting all defaults. To make things easy, we will just log in as root (the password is set during the initial install.)

                                        First, we won’t even assume that networking is working. Out of the box, CentOS Minimal leaves the network off. And we will assume that you don’t want to edit any files. So just run this command:

                                        sed -i -e 's/no/yes/' /etc/sysconfig/network-scripts/ifcfg-eth0
                                        service network restart
                                        ifconfig eth0 | grep "inet addr" | cut -d":" -f2 | cut -d" " -f1

                                        That second line will provide you your IP address so that you can SSH into the box. Yup, I’m making it that simple. So, assuming we’ve now been able to use SSH to connect to the box we should now be easily able to copy and paste everything from here on out.

                                        yum -y install wget; cd /tmp; wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm; rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm; yum -y install nginx; chkconfig nginx on; rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm; yum -y install mysql mysql-server; rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm; chkconfig mysqld on; setenforce permissive; yum -y –enablerepo=remi install php-fpm php-mysql; sed -i -e s/apache/nginx/g /etc/php-fpm.d/www.conf; chkconfig php-fpm on; cd /opt; wget https://wordpress.org/latest.tar.gz; tar -xzvf latest.tar.gz; service mysqld start; echo “CREATE DATABASE wp” | mysql; echo “CREATE USER ‘wpuser’@’localhost’ IDENTIFIED BY ‘password';” | mysql; echo “GRANT ALL PRIVILEGES ON *.* TO ‘wpuser’@’localhost';” | mysql; echo “FLUSH PRIVILEGES;” | chown -R nginx:nginx /opt/wordpress/; iptables -I INPUT 1 -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT; iptables-save > /etc/sysconfig/iptables; service iptables reload; service php-fpm start; sed -i -e s’/index  index.html index.htm/index  index.php index.html/’ /etc/nginx/conf.d/default.conf; sed -i -e s’/\/usr\/share\/nginx\/html/\/opt\/wordpress/’ /etc/nginx/conf.d/default.conf; sed -i -e 0,/#loca/{s’/#loca/loca/’} /etc/nginx/conf.d/default.conf; sed -i -e s’/#    root           html/     root      \/opt\/wordpress/’ /etc/nginx/conf.d/default.conf; sed -i -e s’/#    fastcgi_pass/    fastcgi_pass/’ /etc/nginx/conf.d/default.conf; sed -i -e s’/#    fastcgi_index/    fastcgi_index/’ /etc/nginx/conf.d/default.conf; sed -i -e s’/#    fastcgi_param  SCRIPT_FILENAME  \/scripts$fastcgi/    fastcgi_param  SCRIPT_FILENAME  \/opt\/wordpress$fastcgi/’ /etc/nginx/conf.d/default.conf; sed -i -e s’/#    include        fastcgi_params/    include        fastcgi_params/’ /etc/nginx/conf.d/default.conf; echo ‘}’ >> /etc/nginx/conf.d/default.conf; service nginx restart; echo “All Done, You Can Log In Now”
                                        

                                        And that is it. Just point your web browser to the same address that we looked up with the ifconfig command at the beginning and you should see WordPress awaiting your input to step you through the last bits of the setup. Just give it the database name, database username and password that we set in the script and you are done, my friend.

                                        1 Reply Last reply Reply Quote 0
                                        • A
                                          Alex Sage
                                          last edited by

                                          You should add WP-cli support.

                                          1 Reply Last reply Reply Quote 0
                                          • travisdh1T
                                            travisdh1 @JaredBusch
                                            last edited by

                                            @JaredBusch said in The WordPress on CentOS LEMP Challenge:

                                            Going to try this with a net CentOS 7 minimal install. I turned on networking at install and it was a good thing. The ifconfig script is not there in a minimal install. need to use "ip a sh" to see the config now. I haven't looked at the man for ip yet. I assume a is all and sh is show.

                                            Also, reading through the script, if I use httpd instead of nginx I assume I do not need this command.
                                            sed -i -e s/apache/nginx/g /etc/php-fpm.d/www.conf

                                            and this command would be switched to httpd
                                            chkconfig nginx on

                                            They've replaced ifconfig with ip. I'm forcing myself to use ip till I get used to it and I can always fall back on ifconfig, or in the case of CentOS, just entering settings in /etc/sysconfig/network-scripts/interface file.

                                            stacksofplatesS 1 Reply Last reply Reply Quote 2
                                            • 1
                                            • 2
                                            • 3
                                            • 3 / 3
                                            • First post
                                              Last post