Skip to content

Instantly share code, notes, and snippets.

@jakwuh
Last active April 26, 2016 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakwuh/dc28c18ad37d0979134e to your computer and use it in GitHub Desktop.
Save jakwuh/dc28c18ad37d0979134e to your computer and use it in GitHub Desktop.
LAMP server configuration
# reset root password
sudo su
service mysql stop
/usr/sbin/mysqld --skip-grant-tables --skip-networking
mysql
FLUSH PRIVILEGES;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
/etc/init.d/mysql stop
/etc/init.d/mysql start
# create user for database
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';
FLUSH PRIVILEGES;
sudo su
apt-get install nodejs
apt-get install npm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash # install nvm
source ~/.profile # if source not available then reboot
nvm install 5.9.0
sudo su
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php7.0 php7.0-mysql php7.0-mbstring php7.0-intl php7.0-xml php7.0-zip # this will replace old php packages with new
# apt-get install php7.0-dev # lots of mods
apt-get install libapache2-mod-php7.0 # will remove libapache2-mod-php5
# enable extensions as needed
a2enmod rewrite
service apache2 restart
cd tmp
git clone https://github.com/phpredis/phpredis.git
cd phpredis
git checkout php7
phpize
./configure
make && make install
cd ..
rm -rf phpredis
echo "extension=redis.so" > /etc/php/7.0/mods-available/redis.ini
ln -sf /etc/php/7.0/mods-available/redis.ini /etc/php/7.0/fpm/conf.d/20-redis.ini
ln -sf /etc/php/7.0/mods-available/redis.ini /etc/php/7.0/cli/conf.d/20-redis.ini
ln -sf /etc/php/7.0/mods-available/redis.ini /etc/php/7.0/apache2/conf.d/20-redis.ini
service apache2 restart
apt-get install supervisor
# /etc/supervisor/conf.d/<your_config_here>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment