Skip to content

Instantly share code, notes, and snippets.

@outsideris
Last active December 16, 2015 13:59
Show Gist options
  • Save outsideris/5445843 to your computer and use it in GitHub Desktop.
Save outsideris/5445843 to your computer and use it in GitHub Desktop.
Ubuntu setting & troubleshutting
# 사용자 추가
$ sudo adduser USERNAME
# sudoers에 사용자 추가 ( outsider ALL=(ALL:ALL) ALL )
$ visudo -f /etc/sudoers
# 기본 우분투용 의존성설치
$ sudo apt-get install build-essential libssl-dev libev-dev
$ sudo apt-get install libpcre3 libpcre3-dev zlib1g zlib1g-dev
# add-apt-repository 사용
$ sudo apt-get install python-software-properties
# install git
$ sudo apt-get install git
# fix vim error (Sorry, the command is not available in this version)
sudo apt-get install vim-gui-common
# install etckeeper
$ sudo apt-get install etckeeper
# change VCS to git on /etc/etckeeper/etckeeper.conf
$ sudo etckeeper init
$ sudo etckeeper commit
# install MySQL (config file: /etc/mysql/my.cnf )
$ sudo apt-get install mysql-server
$ sudo service mysql restart
$ mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd');
# add user to mysql
$ mysql -u root -p
mysql> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'newpasswd';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost' WITH GRANT OPTION;
# create db
CREATE SCHEMA `tc18` DEFAULT CHARACTER SET utf8 ;
#install php5 with fpm
$ sudo apt-get install php5 php5-cli php5-mysql php5-fpm
# config /etc/php5/fpm/pool.d/www.conf
# listen = 127.0.0.1:9000 to listen = /var/run/php5-fpm.sock
$ sudo service php5-fpm start
# install nginx
# easy_install 설치
$ sudo apt-get install python-setuptools
#haproxy
$ wget http://haproxy.1wt.eu/download/1.5/src/devel/haproxy-1.5-dev18.tar.gz
$ tar xzvf haproxy-1.5-dev18.tar.gz
$ cd haproxy-1.5-dev18
$ make TARGET=linux26 USE_OPENSSL=1
$ make install
# 인터넷 연결 안되는 문제
#`/etc/resolvconf/resolv.conf.d/head`에 네임서버 추가.
#
# # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# nameserver 8.8.8.8
# nameserver 8.8.4.4
#
# `sudo service resolvconf restart`로 재시작하면 `/etc/resolv.conf`에 네임서버 들어감.
# mysql root가 원래는 빈값의 비밀번호인데 로그인 안될 경우
$ sudo service mysql stop
$ sudo mysqld --skip-grant-tables &
$ mysql -u root mysql
mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
mysql> FLUSH PRIVILEGES;
# kill mysqld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment