달력

9

« 2024/9 »

  • 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
2016. 10. 19. 09:55

워드프레스 설치하면서 삽질한거 아팥쥐2016. 10. 19. 09:55

스쿨호스팅 가상서버호스팅 https://www.phps.kr/

리눅스 2.6.32

Apache/2.2.15 – MySQL 5.7.10 – PHP 5.6.17

APM은 yum 으로 설치. 내 꼴리는대로 설치~


1. wordpress 디렉토리가 707 인지 확인.

설치하면서 wp-config.php 파일하고 .htaccess 파일을 맹그는데 퍼미션 안정해주면 안된다.

지가 알아서 해주겠지만 wp-content 디렉토리도 문제 발생시 확인.


2. 워드프레스의 한글고유주소 404에러 문제

redirect 는 .htaccess로 해결된듯 한데 계속 문제

검색해보니 .htaccess 파일에 mod_url이 필요하다네

httpd.conf 보니 mod_url 모듈이 없네.


3. http://kldp.net/modurl/ 에서 다운

혹시 모르니 계속 진행중인주소 https://github.com/joungkyun/mod_url


mod_url 을 다운받아서 컴파일 할랬더니 whereis apxs 없네...


4. httpd-devel 설치 

shell> yum -y install httpd-devel

/usr/sbin 에 apxs 설치됨.


5. shell> apxs -i -c mod_url.c

컴파일하니 

어쩌구 저쩌구 하면서 mod_url.so 파일이 맹글어짐.

/usr/lib64/httpd/modules/mod_url.so


6. httpd.conf 편집.

shell> iv /etc/httpd/conf/httpd.conf

LoadModule 잔뜩 나오는곳 아랫쪽에


LoadModule redurl_module modules/mod_url.so
모듈추가 저장 후 나옴

7. 아파치재시작
shell>  /etc/rc.d/httpd restart

8. 그래도 안된다...

9. 빡쳐서 또 검색.. 찾다 보니 아파치 설정이 의심 스러움.
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
로 자랑스럽게 되어 있음.

<Directory />
    Options FollowSymLinks
    AllowOverride FileInfo
</Directory>
로 변경.

10. 잘된다.
검색에서 찾은 .htaccess 파일에 추가해주는
<IfModule mod_url.c>
CheckURL On
ServerEncoding UTF-8
ClientEncoding EUC-KR
</IfModule>
이런거 써주면 500 에러난다 -_-;;

이 서버 이상해...

크롬이랑 불여우는 주소가 한글로 제대로 되는데 익스플로러계열은 여전히 url인코딩 주소로 된다.


다른 외국호스팅 사이트에 설치하다보니
mod_url 문제가 아니라 AllowOverride None 때문에 rewrite가 안되서 그런거 같다.



삽질 끝.



:
Posted by 비개인오후
아파치 가상호스트 설정에서 변경해준다.

# songjuha main web test -
<VirtualHost *:80>
        ServerAdmin webmaster@songjuha.com
        DocumentRoot /home/songjuha/www_root/
        ServerName test.songjuha.com
        ErrorLog /dev/null
        CustomLog /dev/null common
</VirtualHost>

########################################### 이게 블로그용 설정
# blogmeme
<VirtualHost *:80>
        ServerAdmin webmaster@songjuha.com
        DocumentRoot /home/songjuha/bloghome/
        ServerName blog.songjuha.com
     RewriteEngine On
     RewriteLog /dev/null
     RewriteCond %{REQUEST_URI} !^/blogmeme$
     RewriteRule ^/([^\.]+)$ /home/songjuha/bloghome/myblog.php?id=$1
        ErrorLog /dev/null
        CustomLog /dev/null common
</VirtualHost>

RewriteEngine On # RewriteEngine을 쓴다는 것이다.

RewriteLog /dev/null # 로그는 안쓴다.

RewriteCond %{REQUEST_URI} !^/blogmeme$
블로그밈 이라는 블로그프로그램을 사용해서 blogmeme라는 디렉토리 안에 넣어두었다.
루트에 풀어도 되는데 루트에 풀면 실질적블로그용 주소까지 몽땅 리다이렉트 해버리는 문제가 있어서..
이건 존재하는 blogmeme 라는 디렉토리는 제외시키고 적용시킨다는 소리겠지.
다른 경로에 설치하고 그 이름을 써도된다.


RewriteRule ^/([^\.]+)$ /home/songjuha/bloghome/myblog.php?id=$1

([^\.]+)$
그룹으로 묶은거다. 보통 [a-zA-Z0-9]+ 이렇게 하는데 이러면 한글은 안된다.
그래서 콤마(.)만 제외시키는 정규식으로 한것이다.
([^\.]+) 이렇게 지정한 그룹의 값이 $1 으로 입력되어서 myblog.php에서 id를 받아 알아서 처리해주면 된다.


:
Posted by 비개인오후
2009. 12. 8. 14:50

.htaccess 자동 작성해주는 사이트 아팥쥐2009. 12. 8. 14:50

http://www.htaccesseditor.com/kr

:
Posted by 비개인오후
Apache Rewrite Engine
Rewrite를 사용할 수 없습니다.
다음 항목을 확인하십시오.  rewrite 모듈을 사용하지 않습니다. 만약 rewrite 모듈 설정을 올바르게 했는데도 모듈 사용 여부의 검사에 문제가 있는 경우 rewrite 모듈을 사용하지 않음을 선택하시고 이 부분을 건너 뛰시기 바랍니다. 지금 설정하지 않아도 설치 이후에 관리 패널의 서비스설정-서버 에서 rewrite 관련 설정을 할 수 있습니다.
웹서버 설정에 mod_rewrite의 로딩이 포함되어야 합니다.
예: LoadModule rewrite_module modules/mod_rewrite.so
웹서버 설정의 이 디렉토리에 대한 Options 항목에 FollowSymLinks가 포함되거나 All이어야 합니다.
예: Options FollowSymLinks 영 화
예: Options All
웹서버 설정의 이 디렉토리에 대한 AllowOverride 항목에 FileInfo가 포함되거나 All이어야 합니다.
예: AllowOverride FileInfo
예: AllowOverride All
위 2와 3의 문제는 아래 내용을 웹서버 설정에 포함시켜 해결할 수 있습니다.

<Directory "/home/cyber74/web/blogcube">
  Options FollowSymLinks
  AllowOverride FileInfo
</Directory>
:
Posted by 비개인오후
2009. 10. 30. 12:10

아파치 httpd.conf 현재 기본설정 아팥쥐2009. 10. 30. 12:10

각 항목 설명이야 찾아보면 나오고

이건 메모리 2G 하루에 만오천명 정도 오는 서버다.

10~11시, 2~4시 사이에 접속이 몰리는 상황.

 

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

너무 적으면 파일업로드 하다말고 에러 나오고 가끔 찐다되는 경우는 이 시간동안 멍해지고...

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 1000

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 2

  2초 : 변경 이걸 최대한 줄여준다 ㅋㅋㅋㅋ

안그러면 지일 끝내고 타임아웃 시간까지 노는 놈들이 많아진다.

#
# Server-pool size regulation.  Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).
#
# It does this by periodically checking how many servers are waiting
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
# spares die off.  The default values are probably OK for most sites.
#
MinSpareServers 20
MaxSpareServers 40

애네는 별 다른 -_-;;

#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 20

#
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...
#
MaxClients 840

  이걸 적당하게 해줘야 한다. 메모리 봐가면서 너무 적으면 클릭하고 조금 있다 나타는 버벅거림, 너무 높으면 메모리가 부족해서 서버가 나죽네 한다 
#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.  The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources.  On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For these platforms, set to something like 10000
# or so; a setting of 0 means unlimited.
#
# NOTE: This value does not include keepalive requests after the initial
#       request per connection. For example, if a child process handles
#       an initial request and 10 subsequent "keptalive" requests, it
#       would only count as 1 request towards this limit.
#
MaxRequestsPerChild 1000

 

:
Posted by 비개인오후

아파치는 1.3x고 소스설치해서 /usr/apache 에 설치되어 있다

#/home/myhome/backups/errors/는 로그파일이 일별로 기록될 경로다. 적용할거면 꼴리는대로 적용.

 

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog "|/usr/local/sbin/cronolog --symlink=/usr/apache/logs/error_log /home/myhome/backups/errors/%Y%m%d.log"

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here.  Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
# For access_log diet 2004.12.23 ADD...
SetEnvIf Request_URI .(gif|jpg|png|ida|js|css) nolog=junk
SetEnvIf Request_URI "/default\.ida" nolog=CodeRed
SetEnvIf Request_URI (cmd\.exe|root\.exe) nolog=nimda

SetEnvIf Request_URI "chk_smk" nolog=ksm
#SetEnvIf Request_URI "show\.php" nolog=iconcal

# Defined 2004.12.23 LogFormat Change
CustomLog "|/usr/local/sbin/cronolog --symlink=/usr/apache/logs/access_log /home/myhome/backups/logs/%Y%m%d.log" combined env=!nolog
#TransferLog "|/usr/local/sbin/cronolog --symlink=/usr/apache/logs/access_log /home/myhome/backups/logs/%Y%m%d.log"

#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#
#CustomLog /usr/apache/logs/referer_log referer
#CustomLog /usr/apache/logs/agent_log agent

#
# If you prefer a single logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog /usr/apache/logs/access_log combined

#

:
Posted by 비개인오후