OS

2022.02.14 16:30

컴파일한 apache 서비스 등록

  • 비아웹 오래 전 2022.02.14 16:30 인기
  • 4,561
    0

컴파일로 설치한 apache 서비스 운영을 보통

[root@viaweb ~]# /usr/local/apache/bin/apachectl start

위의 형식으로 진행합니다.

서비스 자동 시작 등을 위해 rc.local 에 넣어두시죠.

컴파일된 apache 를 간단하게 서비스 등록 하는 방법입니다.

먼저 해당 apachectl 파일을 /etc/init.d/ 아래로 복사합니다.

[root@viaweb bin]# cp apachectl /etc/init.d/httpd

해당 파일을 vi 로 편집하시면 됩니다.

#!/bin/sh #아래 chkocnfig 추가 # chkconfig:-9292 # Licensed to the Apache Software Foundation(ASF) under one or more

서비스 등록 및 자동 시작

[root@viaweb init.d]# chkconfig --add httpd [root@viaweb init.d]# chkconfig --level 345 httpd on

서비스 테스트

[root@viaweb init.d]# service httpd Usage:/usr/local/apache/bin/httpd [-D name][-d directory][-f file]
[-C"directive"][-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v][-V][-h][-l][-L][-t][-T][-S] Options:
-D name : define a name for use in<IfDefine name> directives -d directory : specify an alternate initial ServerRoot -f file : specify an alternate ServerConfigFile -C"directive" : process directive before reading config files -c "directive" : process directive after reading config files -e level : show startup errors oflevel(see LogLevel)
-E file : log startup errors to file -v : show version number -V : show compile settings -h : list available command line options(this page)
-l : list compiled in modules -L : list available configuration directives -t -DDUMP_VHOSTS : show parsed settings(currently only vhost settings)
-S : a synonym for -t -DDUMP_VHOSTS
-t -DDUMP_MODULES : show all loaded modules -M : a synonym for -t -DDUMP_MODULES
-t : run syntax check for config files -T : start without DocumentRoot(s) check

감사합니다.

서버호스팅 비아웹

 

  • 공유링크 복사