LoginSignup
0
0

More than 5 years have passed since last update.

ubuntuサーバー構築

Last updated at Posted at 2017-11-13

構築

ユーザー

  • hoge ALL=NOPASSWD: ALL
  • 上記の設定だと初回がパスワード入力とされて、%sudo ALL=(ALL:ALL) NOPASSWD:ALL を追加すれば上手くいった。
  • パスワード入力セッション無限設定 (Defaults env_reset, timestamp_timeout=-1)
  • サービス操作
  • メモリー使用状況調査

ps alx | awk '{printf ("%d\t%s\n", $8,$13)}'
ps alx | awk '{printf ("%d\t%s\n", $8,$13)}' | sort -nr | head -10

ssh追加

ansibleインストール

最新のansibleをインストールする

sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible

LAMP環境のインストール手順

ansible準備

/etc/ansible/hosts に
localhost ansible_connection=local

Jenkinsインストール

$ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
$ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
$ sudo apt-get update
$ sudo apt-get install jenkins

  • JenkinsのTimezoneを変更

jeinkins管理 > script console > System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'Asia/Tokyo')

Virtualbox周りの設定

-unknown filesystem type vboxsf virtualbox 共有フォルダー設定
centosの場合は Guest Additionsインストール方法

うまくいかない場合:インストールモジュール足りない無い可能性

yum install bzip2 gcc make perl kernel-devel

/etc/rc.localに mount -t vboxsf -o uid=1000,gid=1000,dmode=0777,fmode=0777 folder_name /var/www/html/を追加する

  • phpデバッグ設定

[xdebug]
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=0
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp"
xdebug.max_nesting_level=1000
xdebug.idekey="phpstorm"
xdebug.remote_handler=dbgp

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0