Skip to content

Instantly share code, notes, and snippets.

@barmatz
Created November 11, 2016 12:45
Show Gist options
  • Select an option

  • Save barmatz/107a8cf08a9b2914742f9eee0867e894 to your computer and use it in GitHub Desktop.

Select an option

Save barmatz/107a8cf08a9b2914742f9eee0867e894 to your computer and use it in GitHub Desktop.
#!/bin/bash
# verify membership in the www group
groups
# change the group overship
sudo chown -R root:www /var/www
# change the directory premissions
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} \;
# recursively change the file permissions
find /var/www -type f -exec sudo chmod 0664 {} \;
# create a simple PHP file
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
# start the MySQL server
sudo service mysqld start
# run mysql_secure_installation
sudo mysql_secure_installation
# stop the MySQL server
sudo service mysqld stop
# start the MySQL server at every boot
sudo chkconfig mysqld on
# enable eextra packages for enterprise linux
sudo yum-config-manager --enable epel
# install phpMyAdmin
sudo yum install -y phpMyAdmin
# restart the Apache web server
sudo service httpd restart
# restart the MySQL server
sudo service mysqld restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment