Deploying WordPress on CentOS 7 LAMP
-
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.
-
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.
-
This is a much better way: http://wp-cli.org/
-
@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.
-
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.
-
@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!
-
-
-
@scottalanmiller Do you have a guide on securing CentOS 7?
-
@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.
-
@scottalanmiller Add virualhosts to the list too