안드로이드에 우분투, apm 구축하기 기록 | install ubuntu on android and install apache…
본문
이 내용은 'termux 일기'일 뿐입니다. 실제로는 정상적인 과정이 아닙니다. 정상적인 과정은 https://dsclub.kr/code/765 를 참고해주세요.
•Termux 최신버전 apk 설치
•Termux 실행
•[code]pkg install apt[/code]
- y (y만 입력, 앞으로 나오는 - y는 전부 y만)
• [code]apt update[/code]
- y
• [code]apt upgrade[/code]
- y
- n
- n
- n (6번 구간에서 뭐 물으면 계속 n입력)
• [code]apt install proot[/code]
- y
• [code]apt install proot-distro[/code]
- y
• 우분투의 가장 최신버전 중 lts버전 설치
[code]proot-distro install ubuntu-lts[/code]
• [code]proot-distro login ubuntu-lts[/code]
*그냥 기본 우분투를 설치했다면 proot-distro login ubuntu를 하면 된다.
• [code]apt update[/code]
- y
• [code]apt upgrade[/code]
- y
• [code]apt install vim[/code]
-y
만약 타임존 설정 나오면 알아서 잘 읽고 숫자 눌러서 진행하길 바란다 :)
• [code]apt install sudo[/code]
- y
ssh를 설치
[code]apt install openssh-server[/code]
15. 우분투 유저 추가
[code]adduser 유저이름[/code]
-엔터 이후 사용할 비밀번호 입력
-이름, 전화번호, 업무용 전화번호, 집 전화번호, 기타 를 물으면 전부 엔터를 입력한다.
16. [code]vi /etc/sudoers[/code]
- "root ALL=(ALL:ALL) ALL" 형태를 찾아서 그 아래에
유저이름 ALL=(ALL:ALL) ALL을 입력해라, 파일 내에서 위의 줄( "root ALL=(ALL:ALL) ALL")를 복사해서 수정하는 것을 권장한다.
- esc 버튼을 눌러 편집 중단하기, :wq!를 눌러 강제 저장 후 종료하기
17. 유저계정으로 로그인 하기
[code]su 유저이름[/code]
18. ssh 설정
[code]sudo vi /etc/ssh/sshd_config[/code]
- 19번 과정에서 생성한 유저계정의 비밀번호 입력
- #Port 22라고 되있는 부분을 Port 22로 변경(주석 해제)하기
- Port 22를 원하는 포트번호 4자리로 변경하기
ex) Port 2357
- #PasswordAuthenticatoin yes라고 되어있는 부분을
PasswordAuthenticatoin yes로 변경(주석 해제)하기
- esc 버튼을 눌러 편집 중단하기, :wq!를 눌러 강제 저장 후 종료하기
20. systemctl 설치하기
[code]sudo apt install systemctl[/code]
[code]sudo apt install systemd[/code]
21. ssh 서비스 시작
[code]sudo systemctl status ssh[/code]
*실행 안될 경우 sudo service ssh start 사용
22. 화면을 내려 설정 상태바를 열어 Acduire wakelock를 클릭하여 Release wakelock으로 변경
참고자료
-- ssh 설치 및 설정 끝 --
23. sudo(root)권한 사용
[code]sudo su[/code]
24. root로 이동
[code]cd[/code]
25.
Apache2 설치
[code]sudo apt install apache2 -y[/code]
26. Apache2의 포트 번호 변경
[code]vi /etc/apache2/ports.conf[/code]
- Listen 80을 Listen 8080으로 변경
- Listen 443을 Listen 4433으로 변경
- esc 버튼을 눌러 편집 중단하기, :wq!를 눌러 강제 저장 후 종료하기
27. Apache2 재시작
[code]systemctl restart apache2[/code]
27. Apache2 서버(핸드폰) 재부팅 시 자동으로 시작하게 설정
[code]systemctl enable apache2[/code]
29. Apache2의 웹폴더 /html에 777권한 부여
[code]chmod 777 -R /var/www/html[/code]
*파일을 수정 및 추가하려면 777권한 또는 755권한 정도가 부여 되어야 나중에 sftp로 접속했을 때 파일을 수정 및 추가할 수 있다.
30. net-tools 설치
[code]apt install net-tools -y[/code]
서버(핸드폰의) 내부ip를 확인하려면 거의 필수이다. (물론 공유기에서 확인하는 방법도 있다.)
-- Apache2 설치 및 설정 끝 --
31. 시스템 업데이트
[code]sudo apt update[/code]
32. Software Properties Common 설치
[code]sudo apt install software-properties-common -y[/code]
33. 뭔지 잘 모르겠음(그렇지만 필수이다.)
[code]sudo add-apt-repository ppa:ondrej/php -y[/code]
34. 다시 시스템 업데이트
[code[sudo apt update[/code]
35. php7.4 설치
[code]sudo apt install php7.4 -y[/code]
36. 데이터베이스와 연동하기 위한 확장 설치
[code]sudo apt install php7.4-common php7.4-cli php7.4-fpm php7.4-opcache php7.4-gd php7.4-mysql php7.4-curl php7.4-intl php7.4-xsl php7.4-mbstring php7.4-zip php7.4-bcmath php7.4-iconv php7.4-soap -y[/code]
37. 아파치 재시작
[code]systemctl restart apache2[/code]
-- php7.4 설치 밀 설정 끝 --
38. MariaDB 설치
[code]sudo apt install mariadb-server -y[/code]
39. 아파치 재시작
[code]systemctl restart apache2[/code]
-- mariadb 설치 끝 --
그누보드를 설치하고 싶다면?
https://dsclub.kr/bbs/board.php?bo_table=code&wr_id=21&sfl=wr_subject&stx=php&sop=and&page=1
참고하기
*그누보드란?
한국형 CMS(게시판, 회원, 포인트, 쇼핑몰 등의 시스템이 기본 탑제된 일종의 커뮤니티 생성 프로그램)이며, 국내에서 가장 많이 쓰이는 PHP기반 CMS이다.
계속 최신 업데이트(성능 개선, 취약점 등등)이 이루어지고 있으며 커스텀이 쉽고, 스킨 - 테미 -플러그인까지 다양한 일종의 부가 프로그램 또는 커스텀한 것을 https://sir.kr 에서 공유하며 간편하게 적용할 수 있다.
tak2님의 댓글
tak2 아이피 (192.♡.0.1) 작성일
Get:282 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-iconv-lite all 0.6.3-2 [167 kB]
Get:283 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-lodash-packages all 4.17.21+dfsg+~cs8.31.198.20210220-5 [166 kB]
Get:284 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-stealthy-require all 1.1.1-5 [7,176 B]
Get:285 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-punycode all 2.1.1-5 [9,902 B]
Get:286 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-psl all 1.8.0+ds-6 [39.6 kB]
Get:287 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-universalify all 2.0.0-3 [4,266 B]
Get:288 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-tough-cookie all 4.0.0-2 [31.7 kB]
Get:289 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-webidl-conversions all 7.0.0~1.1.0+~cs15.1.20180823-2 [27.5 kB]
Get:290 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-commander all 9.0.0-2 [48.0 kB]
Get:291 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-mute-stream all 0.0.8+~0.0.1-1 [6,448 B]
Get:292 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-read all 1.0.7-3 [5,478 B]
Get:293 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-ws all 8.5.0+~cs13.3.3-2 [49.5 kB]
Get:294 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-jsdom all 19.0.0+~cs90.11.27-1 [446 kB]
Get:295 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-fetch all 2.6.7+~2.5.12-1 [27.1 kB]
Get:296 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-coveralls all 3.1.1-1 [14.2 kB]
Get:297 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-mimic-response all 3.1.0-7 [5,430 B]
Get:298 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-decompress-response all 6.0.0-2 [4,656 B]
Get:299 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-diff all 5.0.0~dfsg+~5.0.1-3 [77.4 kB]
Get:300 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-err-code all 2.0.3+dfsg-3 [4,918 B]
Get:301 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-time-stamp all 2.2.0-1 [5,984 B]
Get:302 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-fancy-log all 1.3.3+~cs1.3.1-2 [8,102 B]
Get:303 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-signal-exit all 3.0.6+~3.0.1-1 [7,000 B]
Get:304 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-foreground-child all 2.0.0-3 [5,542 B]
Get:305 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-function-bind all 1.1.1+repacked+~1.0.3-1 [5,244 B]
Get:306 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-has-unicode all 2.0.1-4 [3,948 B]
Get:307 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-ansi-styles all 4.3.0+~4.2.0-1 [8,968 B]
Get:308 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-slice-ansi all 5.0.0+~cs9.0.0-4 [8,044 B]
Get:309 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-string-width all 4.2.3+~cs13.2.3-1 [11.4 kB]
Get:310 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-wide-align all 1.1.3-4 [4,228 B]
Get:311 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-gauge all 4.0.2-1 [16.3 kB]
Get:312 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-end-of-stream all 1.4.4+~1.4.1-1 [5,340 B]
Get:313 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-pump all 3.0.0-5 [5,160 B]
Get:314 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-get-stream all 6.0.1-1 [7,324 B]
Get:315 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-lowercase-keys all 2.0.0-2 [3,754 B]
Get:316 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-json-buffer all 3.0.1-1 [3,812 B]
Get:317 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-p-cancelable all 2.1.1-1 [7,358 B]
Get:318 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-quick-lru all 5.1.1-1 [5,532 B]
Get:319 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-got all 11.8.3+~cs58.7.37-1 [122 kB]
Get:320 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-has-flag all 4.0.0-2 [4,228 B]
Get:321 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-hosted-git-info all 4.0.2-1 [9,006 B]
Get:322 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-ip all 1.1.5+~1.1.0-1 [8,140 B]
Get:323 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-ip-regex all 4.3.0+~4.1.1-1 [5,254 B]
Get:324 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-is-typedarray all 1.0.0-4 [2,072 B]
Get:325 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-isexe all 2.0.0+~2.0.1-4 [6,102 B]
Get:326 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-json-parse-better-errors all 1.0.2+~cs3.3.1-1 [7,328 B]
Get:327 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-encoding all 0.1.13-2 [4,366 B]
Get:328 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-jsonparse all 1.3.1-10 [8,060 B]
Get:329 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-minipass all 3.1.6+~cs8.7.18-1 [32.9 kB]
Get:330 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-npm-bundled all 1.1.2-1 [6,228 B]
Get:331 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-osenv all 0.1.5+~0.1.0-1 [5,896 B]
Get:332 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-validate-npm-package-name all 3.0.0-4 [5,058 B]
Get:333 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-npm-package-arg all 8.1.5-1 [8,132 B]
Get:334 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-object-assign all 4.1.1-6 [4,754 B]
Get:335 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 xdg-utils all 1.1.3-4.1ubuntu3~22.04.1 [61.9 kB]
Get:336 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-opener all 1.5.2+~1.4.0-1 [6,000 B]
Get:337 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-retry all 0.13.1+~0.12.1-1 [11.5 kB]
Get:338 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-promise-retry all 2.0.1-2 [5,010 B]
Get:339 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-promzard all 0.3.0-2 [6,888 B]
Get:340 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-set-blocking all 2.0.0-2 [3,766 B]
Get:341 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-slash all 3.0.0-2 [3,922 B]
Get:342 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 libjs-source-map all 0.7.0++dfsg2+really.0.6.1-9 [93.9 kB]
Get:343 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-source-map all 0.7.0++dfsg2+really.0.6.1-9 [33.6 kB]
Get:344 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-source-map-support all 0.5.21+ds+~0.5.4-1 [14.2 kB]
Get:345 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-spdx-license-ids all 3.0.11-1 [7,306 B]
Get:346 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-spdx-exceptions all 2.3.0-2 [3,978 B]
Get:347 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-spdx-expression-parse all 3.0.1+~3.0.1-1 [7,658 B]
Get:348 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-spdx-correct all 3.1.1-2 [5,476 B]
Get:349 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-stack-utils all 2.0.5+~2.0.1-1 [9,368 B]
Get:350 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-supports-color all 8.1.1+~8.1.1-1 [7,048 B]
Get:351 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-tap-parser all 7.0.0+ds1-6 [19.4 kB]
Get:352 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-tap-mocha-reporter all 3.0.7+ds-2 [39.2 kB]
Get:353 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-text-table all 0.2.0-4 [4,762 B]
Get:354 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-tmatch all 5.0.0-4 [6,002 B]
Get:355 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-typedarray-to-buffer all 4.0.0-2 [2,242 B]
Get:356 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-validate-npm-package-license all 3.0.4-2 [4,252 B]
Get:357 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-whatwg-fetch all 3.6.2-5 [15.0 kB]
Get:358 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-write-file-atomic all 3.0.3+~3.0.2-1 [7,690 B]
Get:359 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 tilix-common all 1.9.4-2build1 [281 kB]
Get:360 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 tilix arm64 1.9.4-2build1 [643 kB]
Get:361 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libglvnd0 arm64 1.4.0-1 [61.0 kB]
Get:362 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libglx0 arm64 1.4.0-1 [37.1 kB]
Get:363 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libgl1 arm64 1.4.0-1 [114 kB]
Get:364 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 x11-utils arm64 7.7+5build2 [205 kB]
Get:365 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 x11-xserver-utils arm64 7.7+9build1 [167 kB]
Get:366 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libauthen-sasl-perl all 2.1600-1.1 [43.1 kB]
Get:367 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-abbrev all 1.1.1+~1.1.2-1 [5,784 B]
Get:368 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-archy all 1.0.0-4 [4,728 B]
Get:369 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-chalk all 4.1.2-1 [15.9 kB]
Get:370 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-cli-table all 0.3.11+~cs0.13.3-1 [23.2 kB]
Get:371 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-depd all 2.0.0-2 [10.5 kB]
Get:372 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-nopt all 5.0.0-2 [11.3 kB]
Get:373 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-npmlog all 6.0.1+~4.1.4-1 [9,968 B]
Get:374 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-tar all 6.1.11+ds1+~cs6.0.6-1 [38.8 kB]
Get:375 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-which all 2.0.2+~cs1.3.2-2 [7,374 B]
Get:376 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-gyp all 8.4.1-1 [34.7 kB]
Get:377 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 node-ini all 2.0.1-1 [6,528 B]
.2) ...
Setting up libgtk-3-0:arm64 (3.24.33-1ubuntu2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
Setting up libgtk-3-bin (3.24.33-1ubuntu2) ...
Setting up libvte-2.91-0:arm64 (0.68.0-1) ...
Setting up libvted-3-0:arm64 (3.10.0-1ubuntu1) ...
Setting up at-spi2-core (2.44.0-3) ...
Setting up libgtkd-3-0:arm64 (3.10.0-1ubuntu1) ...
Setting up tilix (1.9.4-2build1) ...
update-alternatives: using /usr/bin/tilix.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in auto mode
Processing triggers for libgdk-pixbuf-2.0-0:arm64 (2.42.8+dfsg-1ubuntu0.2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
root@localhost:~# systemctl restart apache2
bash: /usr/bin/systemctl: No such file or directory
root@localhost:~# systemctl restart apache2
bash: /usr/bin/systemctl: No such file or directory
root@localhost:~# systemctl restart apache2
bash: /usr/bin/systemctl: No such file or directory
root@localhost:~# sudo systemctl restart apache2
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
root@localhost:~# apache2 -v
Server version: Apache/2.4.52 (Ubuntu)
Server built: 2023-10-26T13:44:44
root@localhost:~# sudo service apache2 restart
* Restarting Apache httpd web server apache2 /usr/sbin/apache2ctl: 99: ulimit: error setting limit (Operation not permitted)
Setting ulimit failed. See README.Debian for more information.
2kat님의 댓글
2kat 아이피 (222.♡.250.95) 작성일👍