티스토리 뷰
Ubuntu 에서 Apache, Mysql, PHP 를 간단하게 셋팅하는 방법입니다.
1. Apache2 설치하기
$ apt-get update $ apt-get install apache2
이제 ip를 학인 후 주소창에 ip를 써주시고 아래와 같은 창을 볼수 있으시면 정상적으로 설치 된것을 의미 합니다.
2. Mysql 설치 및 셋팅하기
$ sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
혹시 Mysql 관련 보안 설정이 필요 하신분은 아래의 스크립트를 실행하여 보시기 바랍니다. 알아 두셔야 할 점은 기본설치시 아래의 보안 사항들은 거의 기본적으로 적용되어 있습니다.
$ sudo mysql_install_db $ sudo /usr/bin/mysql_secure_installation By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y #익명의 사용자를 삭제 하시겠습니까? ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y root 의 원격 로그인을 막겠습니까? ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y test 데이터베이스를 제거하시겠습니까? - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y 테이블 권한을 다시 로드 하시겠습니까? ... Success! Cleaning up...
3. PHP 설치하기
전의 과정과 마찬가지로 apt-get 을 이용하여 간단하게 설치합니다.
$ sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
PHP 를 적용하기 위해 아래와 같이 dir.conf 를 수정합니다.
$ sudo vim /etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c> DirectoryIndex index.php index.html index.cgi index.pl index.php index.xhtml index.htm </IfModule> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
3.1 PHP 모듈 설정 ( 필요하다면 )
PHP 의 모듈은 아래와 같이 apt-cache search 를 통하여 검색이 가능합니다.
$ apt-cache search php5-모듈명 또한 아래와 같은 명령으로 설치가 가능합니다. $ apt-get install php5-모듈명
4. 셋팅 테스트해보기
apache2 설치시 default 설정을 수정해서 아래와 같은 php 파일을 만들어 줍니다.
$vim /var/www/html/phpinfo.php
그리고 아래와 같은 코드를 입력하여 줍니다.
<?php phpinfo(); ?>
그리고 이전에 테스트 했던것과 같은 페이지로 이동하여 phpinfo.php 를 입력해주시면 아래와 같이 php 정보가 보이는 페이지를 만드신 것을 확인 하실 수 있습니다.
'Dev WEB > WAS Tips' 카테고리의 다른 글
Let's encrypt 를 이용하여 Nginx 서버에서 무료 HTTPS 지원하기 (0) | 2016.02.19 |
---|---|
NginX 웹페이지에 비밀번호 ( 보안 ) 설정하기 (0) | 2015.04.30 |
Ubuntu 에서 NginX + PHP-FPM 연동하기 (0) | 2015.03.08 |
Ubuntu 14.04 에 Jetty 9 설치하기 (0) | 2015.03.02 |
Ubuntu 에서 NginX + PHP 설치 ( 연동 ) 하기 (0) | 2015.03.02 |
댓글
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 게임 개발
- 게임
- 웹 개발자
- php
- SNS
- 서버
- 웹
- 서버 개발
- cocos2d-x
- 인터넷
- it
- Tutorialbook
- Database
- 우분투
- Nodejs
- Laravel
- 웹 서버
- ubuntu
- JavaScript
- 튜토리얼북
- html
- 개발
- 맥
- 에러
- mac
- 개발자
- 설치
- 데이터베이스
- Developer
- 웹 개발
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함