Skip to content

Instantly share code, notes, and snippets.

@alexei
Last active March 27, 2021 19:38
Show Gist options
  • Select an option

  • Save alexei/7d600c366960af152885 to your computer and use it in GitHub Desktop.

Select an option

Save alexei/7d600c366960af152885 to your computer and use it in GitHub Desktop.

Revisions

  1. alexei revised this gist Jul 31, 2015. 2 changed files with 10 additions and 6 deletions.
    6 changes: 5 additions & 1 deletion 6.PHP.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,6 @@
    sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
    sudo vim /etc/apache2/mods-enabled/dir.conf # Set DirectoryIndex to index.php
    sudo vim /etc/apache2/mods-enabled/dir.conf
    # DirectoryIndex to index.php
    sudo vim /etc/apache2/apache2.conf
    # ServerSignature Off
    # ServerTokens Prod
    10 changes: 5 additions & 5 deletions 8. MySQL Users.sql
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    CREATE USER 'test'@'%' IDENTIFIED BY '***';
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, FILE, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE VIEW, EVENT, TRIGGER, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON *.* TO 'test'@'%' IDENTIFIED BY '***' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
    CREATE DATABASE IF NOT EXISTS `test`;
    GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'%';
    GRANT ALL PRIVILEGES ON `test\_%`.* TO 'test'@'%';
    CREATE USER '%USERNAME%'@'localhost' IDENTIFIED BY '%PASSWORD%';
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, FILE, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE VIEW, EVENT, TRIGGER, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON *.* TO '%USERNAME%'@'localhost' IDENTIFIED BY '%PASSWORD%' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
    CREATE DATABASE IF NOT EXISTS `%DATABASE%`;
    GRANT ALL PRIVILEGES ON `%DATABASE%`.* TO '%USERNAME%'@'localhost';
    GRANT ALL PRIVILEGES ON `%DATABASE%\_localhost`.* TO '%USERNAME%'@'localhost';
  2. alexei revised this gist Jul 9, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 7.System Users.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    sudo adduser --system --shell /bin/bash USER
    sudo groupadd GROUP
    sudo useradd -g GROUP USER
    sudo usermod -g GROUP USER
    sudo passwd USER
  3. alexei revised this gist Jul 9, 2015. 2 changed files with 5 additions and 0 deletions.
    File renamed without changes.
    5 changes: 5 additions & 0 deletions 8. MySQL Users.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    CREATE USER 'test'@'%' IDENTIFIED BY '***';
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, FILE, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE VIEW, EVENT, TRIGGER, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON *.* TO 'test'@'%' IDENTIFIED BY '***' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
    CREATE DATABASE IF NOT EXISTS `test`;
    GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'%';
    GRANT ALL PRIVILEGES ON `test\_%`.* TO 'test'@'%';
  4. alexei revised this gist Jul 9, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions 7.Users.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    sudo adduser --system --shell /bin/bash USER
    sudo groupadd GROUP
    sudo useradd -g GROUP USER
    sudo passwd USER
  5. alexei revised this gist Jul 9, 2015. 4 changed files with 8 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 3 Utils.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    sudo apt-get install htop
    sudo apt-get install git
    1 change: 1 addition & 0 deletions 4.Apache.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    sudo apt-get install apache2
    3 changes: 3 additions & 0 deletions 5.MySQL.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
    sudo mysql_install_db
    sudo /usr/bin/mysql_secure_installation
    2 changes: 2 additions & 0 deletions 6.PHP.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
    sudo vim /etc/apache2/mods-enabled/dir.conf # Set DirectoryIndex to index.php
  6. alexei revised this gist Jul 9, 2015. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  7. alexei renamed this gist Jul 9, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. alexei renamed this gist Jul 9, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  9. alexei revised this gist Jul 9, 2015. 2 changed files with 4 additions and 0 deletions.
    1 change: 1 addition & 0 deletions 0.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Setup LAMP server
    3 changes: 3 additions & 0 deletions 2.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    sudo apt-get autoclean
    sudo apt-get clean
    sudo apt-get autoremove
  10. alexei created this gist Jul 9, 2015.
    2 changes: 2 additions & 0 deletions 1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    sudo apt-get update
    sudo apt-get upgrade