Start with @JaredBusch guide to install Fedora 25 minimal.
The following are based upon @JaredBusch CentOS install.
Assuming you're using a VM somewhere other than local on your machine, you'll want to use putty or Bitvise or some other SSH client so you can copy paste into the session.
note: those used to using php-mysql there is a change. php-mysql was deprecated, now you use php-pdo_mysql
dnf -y install httpd mariadb mariadb-server php php-pdo_mysql php-xml php-gd wget nano
policycoreutils-python;
systemctl enable httpd.service;
systemctl enable mariadb.service;
setenforce permissive;
systemctl start mariadb;
firewall-cmd --zone=public --add-port=http/tcp --permanent;
systemctl reload firewalld;
systemctl start httpd;
Download and unpack WordPress
cd /var/www/html;
wget https://wordpress.org/latest.tar.gz;
tar -xzvf latest.tar.gz;
Change the settings below to things specific to your install.
NOTE: because of exit characters in certain shells, and the fact that these passwords can only be used on the local machine, it's advisable to only use alphanumeric characters for the passwords below - it will make your life easier
#Create a database for wordpress and a user to access it.
mysql -e "CREATE DATABASE wp_yourdomain_db;"
mysql -e "CREATE USER 'wp_user_yourdomain'@'localhost' IDENTIFIED BY 'somerandompassword';"
mysql -e "GRANT ALL PRIVILEGES ON wp_yourdomain.* TO 'wp_yourdomain'@'localhost';"
mysql -e "FLUSH PRIVILEGES;"
#Secure mariadb. These commands do what mysql_secure_installation does interactively
mysql -e "UPDATE mysql.user SET Password=PASSWORD('somesecurepassword') WHERE User='root';"
mysql -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
mysql -e "DELETE FROM mysql.user WHERE User='';"
mysql -e "DROP DATABASE test;"
mysql -e "FLUSH PRIVILEGES;"
Make a copy of the wordpress directory into the folder for this instance of WordPress
note - yourdomain is replaced by whatever you want to reference this instance as
cp -R /var/www/html/wordpress/ /var/www/html/yourdomain/
chown -R apache:apache /var/www/html/yourdomain/;
Create a wp-config.php from the sample file, then update it with your specific settings. You are changing wp_yourdomain_db
, wp_user_yourdomain
, and somerandompassword
to match the ones you create above.
cp /var/www/html/yourdomain/wp-config-sample.php /var/www/html/yourdomain/wp-config.php;
sed -i -e 's/database_name_here/wp_yourdomain_db/' /var/www/html/yourdomain/wp-config.php;
sed -i -e 's/username_here/wp_user_yourdomain/' /var/www/html/yourdomain/wp-config.php;
sed -i -e 's/password_here/somerandompassword/' /var/www/html/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.
This is what is in the default file.
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');
- If you are only going to run the one website on this server, you can edit the apache config
- to change the default document root to point to your wordpress folder
- list itemby default it is located: /etc/httpd/conf/httpd.conf
- Change the following two lines
DocumentRoot "/var/www/html/yourdomain" # was "/var/www/html"
<Directory "/var/www/html/yourdomain"> # was "/var/www/html"
restart the webserver then browse to your site.
systemctl reload httpd;