[Linux] Ubuntu PPTP VPN 설치
우분투 PPTP VPN 설치
1. pptpd 설치
$ sudo apt-get install pptpd |
2. PPTP VPN 에서 사용할 Private IP 대역 설정
$ vi /etc/pptpd.conf |
아래 내용을 추가
localip 10.0.10.1 remoteip 10.0.10.101-110 |
3. ms-dns 추가
$ vi /etc/ppp/pptpd-options |
아래의 DNS 이외에 현재 서버가 사용중인 DNS를 추가해도 무방
ms-dns 8.8.8.8 ms-dns 8.8.4.4 |
4. VPN으로 접속할 계정 추가
$ vi /etc/ppp/chap-secrets |
아래의 형식으로 [id], [password] 부분을 변경하여 추가
[id] pptpd [password] *
5. pptpd 리스타트
$ sudo service pptpd restart |
6. IP 포워딩 설정 활성화
$ vi /etc/sysctl.conf |
아래와 같이 설정 변경
net.ipv4.ip_forward=1 |
변경된 설정을 적용
$ sudo sysctl -p |
8. iptable 설정
$ sudo iptables -t nat -A POSTROUTING -s 10.0.10.0/24 -o eth0 -j MASQUERADE |
9. 방화벽 설정
서버에 방화벽이 존재하는 경우 1723포트를 열어준다.
[Linux] mysql 데이터 경로 변경하기
mysql 데이터 저장 경로 변경하기
/data/mysql 로 변경한다고 가정
- mysql 설정 파일을 변경한다.
vi /etc/mysql/my.cfg
datadir 부분을 찾아셔 다음과 같이 변경한다.
datadir = /data/mysql
- Apparmor access 변경
설정 파일을 변경한 후에 mysql 서비스를 실행하는 경우 로그에 다음과 같은 에러가 나올 경우
/etc/apparmor.d/usr.sbin.mysql 파일을 편집하여 해당 datadir 경로의 권한 추가해 준다.
110727 12:48:32 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110727 12:48:32 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110727 12:48:32 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
/data/mysql/ r,
/data/mysql/** rwk,
- ldata 경로 변경
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
> mysql_install_db –-user=mysql –ldata=/data/mysql
[Linux] Ubuntu 14.4 server install
Install Ubuntu Server
Select a language
English - English
Select your location
United States
Configure the keyboard
No
Configure the keyboard
English (US)
Configure the keyboard
English (US)
Configure the network
[hostname]
Set up users and passwords
Full name for the new user:
[display name]
Set up users and passwords
Username for your account:
[account name]
Set up users and passwords
Choose a password for the new user:
****
Set up users and passwords
Re-enter password to verify:
****
Set up users and passwords
Encrypt your home directory?
No
Configure the clock
Yes
Partition disks
Partitioning method:
Guided - use entire disk and set up LVM
Partition disks
Select disk to partition:
[select partition]
Partition disks
Write the changes
Yes
Partition disks
Amount of volume group to use for guided partitioning:
max
Partition disks
Write the changes to disks
Yes
Configure the package manager
Continue
Configuring tasksel
No automatic updates
Software selection
Continue
Install the GRUB boot loader on a hard disk
Yes
Finish the installation
Continue
[Linux] Ubuntu에서 php-oracle 작업 환경 셋업하기
1. install apache, mysql, php
sudo apt-get install tasksel
sudo tasksel install lamp-server
2. install oracle
apt-get install alien
alien -i oracle-xe-11.2.0-1.0.x86_64.rpm
3. edit TNS
vi /u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora
4. install php-pear
apt-get install php-pear php5-dev build-essential unzip libaio1
5. install oci
alien -i oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm
alien -i oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm
pecl install oci8
6. edit environment variable
echo ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe/ >> /etc/environment
7. edit php configuration
echo extension=oci8.so >> /etc/php5/apache2/php.ini
echo extension=oci8.so >> /etc/php5/cli/php.ini
8. edit apache2 envvars
vi /etc/apache2/envvars
# add this line
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
9. restart apache
sudo /etc/init.d/apache2 restart
or
sudo service apache2 restart
참고자료
https://help.ubuntu.com/community/ApacheMySQLPHP
https://help.ubuntu.com/community/PHPOracle
http://kogentadono.com/2011/11/02/installing-oci8-on-ubuntu/
[Linux] SWAP 메모리 추가하기
현재 사용중인 SWAP 메모리 확인
more /proc/swaps
SWAP 메모리로 사용할 파일 생성 (파일당 1GB)
cd /var/tmp
dd if=/dev/zero of=swapfile1 bs=1024 count=1048576
dd if=/dev/zero of=swapfile2 bs=1024 count=1048576
SWAP 영역으로 설정
/sbin/mkswap -c -v1 /var/tmp/swapfile1
/sbin/mkswap -c -v1 /var/tmp/swapfile2
SWAP 파일 사용시작
/sbin/swapon /var/tmp/swapfile1
/sbin/swapon /var/tmp/swapfile2
바뀐 SWAP 메모리 확인
more /proc/swaps