프로그램 사용/apache2016. 12. 29. 10:16

공인 인증하려면 비싸니까(년 3만원 이상)

개인이 쓰거나 개발용이라면 사설인증서 만들어서 써도 된다네?(openssl)


[링크 : http://stackoverflow.com/questions/2336678/login-without-https-how-to-secure]

[링크 : https://opentutorials.org/course/228/4894]

[링크 : http://tuwlab.com/ece/8616] <<



개인정보 가지면 무조건 HTTPS를 의무화한 법안으로 인해

일단은 무조건 해봐야 할 듯?


+

라즈베리 밀고 다시 해봐야하나.

그냥 기본적으로 거의 다 되어 있고

http://localhost 대신

https://localhost로 하면 된다.


http://로 접속한걸 https:// 로 자동 리다이렉션 하는 법 없나..

<VirtualHost *:80>

        # The ServerName directive sets the request scheme, hostname and port that

        # the server uses to identify itself. This is used when creating

        # redirection URLs. In the context of virtual hosts, the ServerName

        # specifies what hostname must appear in the request's Host: header to

        # match this virtual host. For the default virtual host (this file) this

        # value is not decisive as it is used as a last resort host regardless.

        # However, you must set it for any further virtual host explicitly.

        #ServerName www.example.com


        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/html


        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,

        # error, crit, alert, emerg.

        # It is also possible to configure the loglevel for particular

        # modules, e.g.

        #LogLevel info ssl:warn


        ErrorLog ${APACHE_LOG_DIR}/error.log

        CustomLog ${APACHE_LOG_DIR}/access.log combined


        # For most configuration files from conf-available/, which are

        # enabled or disabled at a global level, it is possible to

        # include a line for only one particular virtual host. For example the

        # following line enables the CGI configuration for this host only

        # after it has been globally disabled with "a2disconf".

        #Include conf-available/serve-cgi-bin.conf


        Redirect / https://raspberrypi/

</VirtualHost> 

[링크 : http://stackoverflow.com/.../how-to-redirect-all-http-requests-to-https/21798882#21798882]


mod_rewrite로 하는법이라는데 왜 안되지..

[링크 : https://wiki.apache.org/httpd/RewriteHTTPToHTTPS]



+

16.11.25일자 라즈베리 배포판으로는 아래의 과정만 하면 설정완료!

ssl 관련 설정은 해당 모듈만 활성화 시켜주는 되는 듯

$ sudo apt-get install apache2 mysql-server mysql-client-5.5 php5 php5-mysql php5-gd openssl


$ cd /etc/apache2/sites-available/

$ sudo vi 000-default.conf

redirect / https://raspberrypi/

$ sudo a2enmod ssl

$ sudo a2ensite default-ssl

$ sudo service apache2 restart 


+2017.01.05

경고 뜨는게 싫고, 다른데서 매번 사용확인해주는게 귀찮아서라도 하나 해야 할 듯 -_-

[링크 : https://www.xetown.com/slope/135905]

[링크 : https://blog.elpo.net/get-free-ssl-certificate/]


Posted by 구차니
프로그램 사용/apache2014. 11. 24. 16:37
Ubuntu 14.10 LTS ? 같은데

기본설정상 우분투에서 아파치의 htdocs는 /var/www 이지만
이 녀석을 다른 곳에서 사용하기 위해서는 다른 파일을 수정해야 한다.

/etc/apache2/apache2.conf <<
/etc/apache2/sites-enabled/000-default


기존의 2.2.22 (10.04 LTS) 에서는 site-enabled/000-default에 설정하면 되었으나
2.4.7 부터는 설정이 바뀌어서 apache2.conf 에서
허용되는 경로 부터 바꾸어 주어야 하는 듯 하다.

아래는 index.html의 도움말. 역시 써놓은건 잘 읽어야해 -_-

Document Roots

By default, Ubuntu does not allow access through the web browser to any file apart of those located in/var/wwwpublic_html directories (when enabled) and /usr/share (for web applications). If your site is using a web document root located elsewhere (such as in /srv) you may need to whitelist your document root directory in /etc/apache2/apache2.conf.

The default Ubuntu document root is /var/www/html. You can make your own virtual hosts under /var/www. This is different to previous releases which provides better security out of the box. 
Posted by 구차니
프로그램 사용/apache2014. 10. 10. 11:31
ab는 아파치에서 제공하는 벤치마킹 툴로 우분투에서 아래의 패키지로 제공된다.
 $ sudo apt-get install apache2-utils

특이한건...
 $ ab http://localhost
는 안되고
 
 $ ab http://localhost/
 $ ab http://localhost/index.html
은 된다 -_-

[링크 : http://stackoverflow.com/.../apache-ab-will-not-work-ab-invalid-url-when-testing-python-cyclone]

-c 를 천단위로 할 수는 없는 듯 하다.
(1020을 넘어서니 socket: Too many open files(24) 에러를 발생한다)
-c concurrency
    Number of multiple requests to perform at a time. Default is one request at a time.

-n requests
    Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results. 

[링크 : http://linux.die.net/man/1/ab

Posted by 구차니
수정하려니 기본적으로 AllowOverride 라서 건드리지 않고 시도함.
$ sudo vi /etc/apache2/sites-available/default
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory> 

귀찮으니(!) 일단 파일 퍼미션은 패스하고, 내가 하려는 폴더인 /var/www/gnuboard4 에서 
.htaccess 파일을 생성하고 아래의 내용을 넣어준다.
$ cat .htaccess
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /var/www/gnuboard4/.pw
Require user test 

htpasswd 유틸을 이용해서 .pw 파일을 -c(create) 해주고 test 계정을 추가한다.
$ sudo htpasswd -c .pw test
New password:
Re-type new password:
Adding password for user test 

localhost/gnuboard4 로 접속하려고 하면 아래와 같은 메시지가 뜬다.
서버 메시지에는 .htaccess에서 AuthName에 기재한 내용이 뜨게 된다.


+
아무래도 암호 파일은 동일한 디렉토리에 두면 안될듯(목록 보고 암호 빼갈테니)
가장 좋은건 별도의 암호 디렉토리에 저장하고 이 디렉토리는 웹서버 루트외의 곳으로 지정해야 할 듯하다.
물론 로그인 이전에는 .pw에 접근할수 없지만, 로그인 후에는 .pw 파일이 버젓히 보이게 된다 -_-

[링크 : http://opentime.tistory.com/33]
[링크 : http://www.cyberciti.biz/faq/howto-setup-apache-password-protect-directory-with-htaccess-file/

'프로그램 사용 > apache' 카테고리의 다른 글

apache2 2.4.7 문서 경로 수정하기  (0) 2014.11.24
ab - apache HTTP server benchmarking tool  (0) 2014.10.10
500 internal server error - mediawiki 이전시  (0) 2011.12.18
apache - url rewrite  (2) 2011.04.26
webDAV  (0) 2010.11.19
Posted by 구차니
프로그램 사용/apache2011. 12. 18. 11:00
다른 pc에서 amp(Apache Mysql PHP)를 설치하고 mediawiki를 이전하는데
/var/log/access.log 에서는 단순히 500 오류만 발생하고
/var/log/error.log 에는 아무런 것도 표시 안되는 현상이 발생 -_-

phpinfo() 를 호출하는 간단한 php 소스는 문제없이 읽어 들이길래
흐음... 고심을 하다가 이런저런 쇼를 하다보니
php5-mysql 이녀석을 설치 안했다는걸 발견 -_-

설치하고 나니 문제없이 실행된다 

결론: apm(amp) 서버 설치시
        apache2 php5 php5-mysql mysql-server 이정도 패키지는 설치해주자 

'프로그램 사용 > apache' 카테고리의 다른 글

ab - apache HTTP server benchmarking tool  (0) 2014.10.10
apache 특정 디렉토리만 인증하기  (0) 2013.04.09
apache - url rewrite  (2) 2011.04.26
webDAV  (0) 2010.11.19
SVG DOM API  (2) 2010.01.11
Posted by 구차니
프로그램 사용/apache2011. 4. 26. 10:32
일반적으로 아파치 설정으로는 유저별 홈페이지 주소가
domain.com/~userid 식으로 구성이 되는데
userid.domain.com 식으로 하기 위한 방법이 url rewrite 라고 한다.

[링크 : http://www.superuser.co.kr/apache/rewrite_Module/Apache_rewrite_Module.htm]
[링크 : http://httpd.apache.org/docs/2.0/misc/rewriteguide.html]

'프로그램 사용 > apache' 카테고리의 다른 글

ab - apache HTTP server benchmarking tool  (0) 2014.10.10
apache 특정 디렉토리만 인증하기  (0) 2013.04.09
500 internal server error - mediawiki 이전시  (0) 2011.12.18
webDAV  (0) 2010.11.19
SVG DOM API  (2) 2010.01.11
Posted by 구차니
프로그램 사용/apache2010. 11. 19. 23:05
svn 로그인을 리눅스 계정과 연결하기 위해 이것저것 하다보니,
webDAV 라는 녀석이 나오길래 검색 고고싱

간단하게 요약하자면,
HTTP는 웹서비스를 위한 읽기기능만을 지닌 웹서버에 쓰기기능을 추가해준다.

Web-based Distributed Authoring and Versioning (WebDAV)

The most important features of the WebDAV protocol include:
  • locking ("overwrite prevention")
  • properties (creation, removal, and querying of information about author, modified date et cetera);
  • name space management (ability to copy and move Web pages within a server's namespace)
  • collections (creation, removal, and listing of resources)

[링크 : http://en.wikipedia.org/wiki/WebDAV]

WebDAV[웹답]상의 공동 저작활동을 지원하기 위한 IETF 표준으로서, 멀리 떨어져 있는 사용자들 간에 인터넷을 통해 파일을 공동 편집하고 관리할 수 있도록 해주는 일련의 HTTP 확장이다.

[링크 : http://www.terms.co.kr/WebDAV.htm]

What is WebDAV?
    Briefly: WebDAV stands for "Web-based Distributed Authoring and Versioning". It is a set of extensions to the HTTP protocol which allows users to collaboratively edit and manage files on remote web servers.


[링크 : http://www.webdav.org/]


'프로그램 사용 > apache' 카테고리의 다른 글

ab - apache HTTP server benchmarking tool  (0) 2014.10.10
apache 특정 디렉토리만 인증하기  (0) 2013.04.09
500 internal server error - mediawiki 이전시  (0) 2011.12.18
apache - url rewrite  (2) 2011.04.26
SVG DOM API  (2) 2010.01.11
Posted by 구차니
프로그램 사용/apache2010. 1. 11. 12:18
아파치에서 하는 xml graphic 프로젝트로
xml의 내용을 svg 포맷으로 변환하여 이미지로 출력하는듯 하다.
(머.. 웹서버 깔고 귀차니즘.. 확인안함)

사족 : 저~~얼대 웹브라우저에 탭을 하나 차지하고 있기에 이걸 없애려고 글쓴거라고 할수 없다고는 못함.

[링크 : http://xmlgraphics.apache.org/batik/using/dom-api.html]

'프로그램 사용 > apache' 카테고리의 다른 글

ab - apache HTTP server benchmarking tool  (0) 2014.10.10
apache 특정 디렉토리만 인증하기  (0) 2013.04.09
500 internal server error - mediawiki 이전시  (0) 2011.12.18
apache - url rewrite  (2) 2011.04.26
webDAV  (0) 2010.11.19
Posted by 구차니