2015. 9. 2. 22:21

잡설

항상 마이크로소프트의 제품군들만 사용해오다 보니 리눅스를 다루는 것은 가슴속 한켠엔 '어려운 것'으로 자리잡고 있었다. 지금이라도 이렇게 시간이 될 때 한가지 한가지 해보고 정리를 해다가 보면 '어려운 것' 에서 '해볼만 한 것'으로 바뀌지 않을까 싶다.


Install FTP

# sudo apt-get install vsftpd


Create User for FTP

$ sudo -i # root 변경

# 예) useradd -d {home directly} -u {user id}

useradd -d /opt/lampp/htdocs/wordpress/wp-content/themes/ -u themes #  FTP접속 시 '/home/cooldragon'가 홈디렉토리

$ passwd themes # 비밀번호 설정

Enter new UNIX password: 

Retype new UNIX password: 

$chmod 777 themes/ # 계정에 대한 쓰기 읽기 권한이 없다면 권한을 부여


FTP Configuration

$ vi /etc/vsftpd.conf

# Allow anonymous FTP? (Disabled by default)

anonymous_enable=NO


# Uncomment this to allow local users to log in.

local_enable=YES


# Uncomment this to enable any form of FTP write command.

write_enable=YES


# Default umask for local users is 077. You may wish to change this to 022,

# if your users expect that (022 is used by most other ftpd's)

local_umask=0

$ service vsftpd restart


Access Test

Now you can drag file and drop it into the directory.


후기

사실 FTP를 설치한 이유가 wordpress에서 Themes을 다운로드 FTP를 통하여 자동 업데이트 되도록 하기 위함이었는데.. virtualbox로 생성한 거라 내부IP와 상관이 있는것인지.. 모르겠지만 계속 실패가 났다. 결국 ftp client로 접속하여 다운로드 받은 파일을 드래그&드랍으로 파일을 붙여 넣었다.

깊이 없는 리눅스 겉핥기와 같은 나의 수준이 문제겠지.... 방법이 뭔가요?

Posted by CoolDragon
2015. 8. 31. 01:16

1. Install PostgreSql

$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

$ sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main 9.4" >> pgdg.list

$ sudo cp pgdg.list /etc/apt/sources.list.d/pgdg.list

$ sudo apt-get update

$ sudo apt-get -y install postgresql-9.4 postgresql-client-9.4


2. Set password for Postgresql

$ sudo -u postgres psql postgres

postgres=# \password postgres

Enter new password: 

Enter it again: 

postgres=# \q


3. Allow aceess remote

$ sudo vi /etc/postgresql/9.4/main/pg_hba.conf

...

# IPv4 local connections:

host    all             all             127.0.0.1/32            md5

host    all             all             192.168.1.0/24          md5   # Add 

...

$ sudo vi /etc/postgresql/9.4/main/postgresql.conf

listen_addresses = '*' # replace "*" with "localhost"

port = 5432

$ sudo service postgresql restart


4. Open Port on firewall

$ sudo ufw allow 5432


5. Test

pgAdmin Download








Reference

http://www.unixmen.com/install-postgresql-9-4-phppgadmin-ubuntu-14-10/

http://askubuntu.com/questions/233064/why-am-i-getting-command-deb-not-found


Posted by CoolDragon
2015. 8. 27. 18:02


$ sudo dpkg -i "YourDebPackage.deb"


Posted by CoolDragon
2015. 8. 27. 07:00

#Download Vagrant latest version(2015.08.26)

$ wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.4_x86_64.deb


# Install Vagrant

$ sudo dpkg -i vagrant_1.7.4_x86_64.deb


#version check

$ vagrant --version

Vagrant 1.7.4


#VirtualBox install

$ sudo apt-get install virtualbox


# Install ubuntu 14.04 on Virtualbox using vagrant

You can find vagrant box on the following: http://www.vagrantbox.es/

ex) $ vagrant box add {title} {url}


$ vagrant box add ubuntu14.04 https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box


# After initialization, Vagrantfile is created and the information in the file configuration can set up OS automatically

$ vagrant init ubuntu14.04


# Execute OS

$ vagrant up


# Shutdown OS

$ vagrant halt or vagrant suspend


# Delete OS

$ vagrant destroy


# Apply provisioning

$ vagrant provision


# Access server

$ vagrant ssh


# Setting Vagrant provisioning





Posted by CoolDragon
2015. 7. 17. 04:47

1. firewall (refer to https://help.ubuntu.com/lts/serverguide/firewall.html)

   > sudo ufw enable

   > sudo ufw allow 22


2. netstat

   > sudo netstat -plant | grep ssh


3. install ssh (http://cooldragon.tistory.com/139)

  > sudo apt-get install openssh-server


connection test from other terminal)

> ssh account@IP

> ssh cooldragon@192.168.56.102

Posted by CoolDragon
2014. 4. 11. 00:45

Set Network

- first of all, you should check mac address

  - Adaptor 1 :  NAT

  - Adaptor 2 :  Host Dedicated Adaptor


[Install Ubuntu]

- set static IP

$ sudo vi /etc/network/interfaces

  auto lo

  iface lo inet loopback


  auto eth0 # NAT 

  iface eth0 inet dhcp


  auto eth1 # Host Dedicated Adaptor

  iface eth1 inet static

        address 192.168.56.102   # you can find the basic IP(192.168.56.1) in network tab, VirtualBox preference

        netmask 255.255.255.0


$ sudo /etc/init.d/networking restart

#새로 추가된 IP에 매칭된 이더넷카드 실행을 해준다.

$ sudo ifdown eth0

$ sudo ifdown eth1

$ sudo ifup eth0

sudo ifup eth1


$ nslookup www.daum.net

  ※ if you can't well, please see this link

     (http://forum.falinux.com/zbxe/index.php?document_srl=532721&mid=lecture_tip)

     $ vi /etc/udev/rules.d/70-persistent-net.rules

     $ sudo rm /etc/udev/rules.d/70-persistent-net.rules




더 설명이 좋은 링크: https://gist.github.com/wacko/5577187

Posted by CoolDragon