Skip to content

Instantly share code, notes, and snippets.

@lorne-luo
Last active November 9, 2017 21:46
Show Gist options
  • Save lorne-luo/723c68a6833e4ceca81d3f99fc3c6be4 to your computer and use it in GitHub Desktop.
Save lorne-luo/723c68a6833e4ceca81d3f99fc3c6be4 to your computer and use it in GitHub Desktop.
Setup Centos Server
sudo timedatectl set-timezone Australia/Sydney
sudo yum -y update
sudo yum -y install gcc gcc-c++ kernel-devel libxml++-devel libxml2-devel python-devel libxslt-devel libffi-devel openssl-devel mysql-devel
sudo yun -y install ImageMagick-devel libcurl-devel wget zip git bash-completion bash-completion-extras curl enchant
ssh-keygen -t rsa -b 4096 -C "[email protected]"
cat ~/.ssh/id_rsa.pub
sudo vi /etc/sysconfig/network
sudo echo 'HOSTNAME=luotao.net' >> /etc/sysconfig/network
hostname luotao.net
cd /root && git clone [email protected]:lorne-luo/bash-config.git && cd bash-config/ && git checkout centos
sudo pip install --upgrade pip && sudo pip install virtualenv
curl -L https://iterm2.com/misc/install_shell_integration.sh | bash
ln -s $(pwd)/bash/bash_profile ~/.bash_profile
ln -s $(pwd)/bash/bashrc ~/.bashrc
ln -s $(pwd)/bash/inputrc ~/.inputrc
ln -s $(pwd)/git/gitconfig ~/.gitconfig
ln -s $(pwd)/git/gitignore ~/.gitignore
ln -s $(pwd)/git/git-completion.bash ~/.git-completion.bash
ln -s $(pwd)/ssh/config ~/.ssh/config
cd /opt && git clone [email protected]:taoluo/ozsales.git
cd /opt/ozsales && virtualenv env && source ./env/bin/activate
useradd luotao
chown -R luotao /opt/ozsales
pip install -r deploy/requirements.pip
mkdir -p /etc/supervisor/ && mkdir -p /etc/supervisor/supervisor.d/
echo_supervisord_conf > /etc/supervisor/supervisord.conf
echo '[include]' >> /etc/supervisor/supervisord.conf
echo 'files=/etc/supervisor/supervisor.d/*.conf' >> /etc/supervisor/supervisord.conf
ln -s /opt/ozsales/deploy/supervisord_ozsales.conf /etc/supervisor/supervisor.d/ozsales.conf
ln -s /opt/ozsales/deploy/nginx_supervisord.conf /usr/local/nginx/conf/vhost/supervisord.conf
ln -s /opt/ozsales/deploy/nginx_ozsale_uwsgi.conf /usr/local/nginx/conf/vhost/ozsales.conf
mkdir -p /var/log/supervisor/
service nginx restart
cd /home && wget -c http://soft.vpser.net/lnmp/lnmp1.4-full.tar.gz
tar zxf lnmp1.4-full.tar.gz && cd lnmp1.4-full && ./install.sh lnmp
# install mysql timezone difinition
cd /usr/local/mysql/bin/
./mysql_tzinfo_to_sql /usr/share/zoneinfo/ > zone.sql
mysql -uroot -p mysql < zone.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment