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

    Deploying WordPress on CentOS 7 LAMP

    IT Discussion
    linux centos centos 7 lamp wordpress
    3
    11
    2.3k
    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.
    • scottalanmillerS
      scottalanmiller
      last edited by

      WordPress is the most popular content management system for web hosting. We will do a simple install starting with a Basic LAMP Install on CentOS 7. From there....

      Download WordPress

      yum -y install wget; cd /var/www/html; wget https://wordpress.org/latest.tar.gz
      

      Extract WordPress

      tar -xzvf latest.tar.gz 
      

      Create a MariaDB Database for WordPress

      You can use whatever method that you like for this. I do this by hand using this procedure: https://mangolassi.it/topic/10583/simple-database-creation-on-mariadb-or-mysql

      Set Up the Configuration File

      cd wordpress/
      cp wp-config-sample.php wp-config.php
      vi wp-config.php
      

      At this point you need to edit the configuration file with the database info that you chose (database name, user name and password) from the database step. If you used the ones in my example, your configuration file would look like this (note that only a small portion of the file is shown):

      /** The name of the database for WordPress */
      define('DB_NAME', 'wp_demo');
      
      /** MySQL database username */
      define('DB_USER', 'demouser');
      
      /** MySQL database password */
      define('DB_PASSWORD', 'mypasswordsecret');
      
      /** MySQL hostname */
      define('DB_HOST', 'localhost');
      

      Leave most of the file untouched.

      Using the Web Installation Wizard to Complete

      Simple point your web browser to: http://yourserveripaddress/wordpress/wp-admin/install.php and the WordPress system will walk you through the rest of the installation process.

      0_1472930092865_Screenshot from 2016-09-03 15-13-25.png

      0_1472930101570_Screenshot from 2016-09-03 15-13-50.png

      0_1472930113652_Screenshot from 2016-09-03 15-14-05.png

      0_1472930121754_Screenshot from 2016-09-03 15-14-31.png

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

        In the above example, we deployed into the standard Apache root directory at /var/www/html and used the directory wordpress. This is fine in some cases, but is very generic and odd for most use cases. If your server will be serving out only one site and you want it to be this one, you will likely want to change where Apache looks for its default site. In some cases you will want to make HTTPS headers point to different folders for different names. These are pretty easy modifications but better suited to more Apache-focused articles.

        To deploy more WordPress here or to change the name of the folder that you navigate to in order to see your WP install, you can simple rename the wordpress folder. For example, if your site was about tropical fish you might do this...

        mv /var/www/html/wordpress /var/www/html/ilovetropfish
        

        And then you could navigate to http://myserveripaddress/ilovetropfish/ to see your site.

        Likewise, you could install wordpress many times following the same procedure as above but simply naming each folder something unique in order to have many sites hosted on the same Apache server.

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

          This is a much better way: http://wp-cli.org/

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

            @aaronstuder said in Deploying WordPress on CentOS 7 LAMP:

            This is a much better way: http://wp-cli.org/

            I don't see info about installing WP using that tool, only managing it.

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

              I wrote this 2 years ago when @scottalanmiller posted his LEMP challenge thing.

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

              I should update it for SSL and post it here.

              A 1 Reply Last reply Reply Quote 3
              • A
                Alex Sage @JaredBusch
                last edited by

                @JaredBusch said in Deploying WordPress on CentOS 7 LAMP:

                I wrote this 2 years ago when @scottalanmiller posted his LEMP challenge thing.

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

                I should update it for SSL and post it here.

                Please do! 🙂

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

                  @scottalanmiller http://wp-cli.org/commands/core/

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

                    @aaronstuder said in Deploying WordPress on CentOS 7 LAMP:

                    @scottalanmiller http://wp-cli.org/commands/core/

                    Oh cool, thanks.

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

                      @scottalanmiller Do you have a guide on securing CentOS 7?

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

                        @aaronstuder said in Deploying WordPress on CentOS 7 LAMP:

                        @scottalanmiller Do you have a guide on securing CentOS 7?

                        NOt yet, will likely be part of my series, eventually.

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

                          @scottalanmiller Add virualhosts to the list too 😉

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post