Pre-Req :
You need a user who isn't root who can run Sudo, if needed use the following:
adduser wordpress && passwd wordpress && gpasswd -a wordpress wheel
Then Install LAMP
yum install -y httpd mariadb-server mariadb php php-mysql sudo systemctl start httpd.service sudo systemctl enable httpd.service sudo systemctl start mariadb sudo mysql_secure_installation sudo systemctl enable mariadb.service sudo systemctl restart httpd.service
Create MySQL DB:
mysql -u root -p CREATE DATABASE [DB_NAME]; CREATE USER [DB_USERNAME]@localhost IDENTIFIED BY '[DB_PASSWD]'; GRANT ALL PRIVILEGES ON [DB_NAME].* TO [DB_USERNAME]@localhost; FLUSH PRIVILEGES; exit;
Now install via :
sudo yum install -y php-gd wget cd ~ wget http://wordpress.org/latest.tar.gz tar xzvf latest.tar.gz cd ~/wordpress sudo cp wp-config-sample.php wp-config.php sudo chown root:root * -R sudo nano wp-config.php && sudo service httpd restart
wp-config.php:
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', '[DB_NAME]'); /** MySQL database username */ define('DB_USER', '[DB_USERNAME]'); /** MySQL database password */ define('DB_PASSWORD', '[DB_PASSWD]');
Now just move the Directory to whever you want apache to serve it from. I like to move it high up my file tree and symlink into apache. But you could just
mv * /var/www/html/
1 Comment
Anonymous