Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hakopako
Last active August 29, 2015 13:56
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 hakopako/8880581 to your computer and use it in GitHub Desktop.
Save hakopako/8880581 to your computer and use it in GitHub Desktop.
【初めはrootしかいないのでをユーザに追加】
login: root
Password:
# yum update
# adduser USERNAME
# passwd USERNAME
Changing password for user USERNAME
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
————————————————————————
【ssh設定】
vi /etc/ssh/sshd_config
Port 22 #コメントアウトとってポート番号設定
PermitRootLogin no #コメントアウトとって yesをnoにする
————————————————————————
【SSHの再起動】
/etc/init.d/sshd restart
これでターミナルからssh使える
user@IPアドレス
pw設定したやつ
————————————————————————
【sudoにユーザ追加】
# visudo
root ALL=(ALL) ALL
USERNAME ALL=(ALL) ALL  ←追記
これで追記したユーザはsudo権限使用可能になる
————————————————————————
【remiを追加】
# sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
————————————————————————
# sudo vi /etc/yum.repos.d/remi.repo
[remi]
name=Les RPM de remi pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror
enabled=1 #これを 0 -> 1へ
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
# yum repolist
でremiが入っていることを確認
————————————————————————
【apacheをインストール・設定】
# sudo yum -y install httpd httpd-devel
# sudo vi /etc/httpd/conf/httpd.conf
ServerTokens OS を
ServerTokens Prod にする
#ServerName www.example.com:80 を
ServerName localhost:80 にする
DocumentRoot "/var/www/html" を
DocumentRoot "/var/www" にする
ServerSignature ON を
ServerSignature OFF にする
————————————————————————
【サービスの有効化】
sudo chkconfig httpd on
————————————————————————
【mysqlのインストール】
sudo yum -y install mysql-server
————————————————————————
【phpのインストール】
sudo yum -y install php
sudo yum -y install php-mbstring php-mysql
————————————————————————
【iptables設定】
sudo vi /etc/sysconfig/iptables
適宜編集
————————————————————————
【apache再起動】
sudo apachectl start
————————————————————————
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment