`
hillmover
  • 浏览: 34444 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论

Installaction - Httpd

阅读更多

# Install apache

> groupadd apache

> useradd -g apache apache

> ./configure --prefix=/usr/local/apache2 --enable-mods-shared=most --enable-so --enable-ssl --enable-rewrite

> make && make install

> cd /usr/local/apache2

> cp bin/apachectl /etc/rc.d/init.d/httpd

> vi /etc/rc.d/init.d/httpd

# chkconfig: 2345 70 30
# description: Apache is a World Wide Web server.  It is used to serve \
#              HTML files and CGI.
# processname: httpd 

...

case $ARGV in
start|stop|restart|graceful)
    $HTTPD -k $ARGV -DSSL
    ERROR=$?
    ;;

> /sbin/chkconfig --add httpd

> chown -R root .

> chgrp -R apache .

> chown -R apache error logs

> vi conf/httpd.conf

<DocumentRoot "" ...

User apache

Group apache

...

 

# Customize the ssl

> cd /tmp
> mkdir ssl
> openssl req -new -out ssl/server.csr

Enter PEM pass phrase: abc123
Verifying - Enter PEM pass phrase: abc123
Country Name (2 letter code) [GB]: ALL PRESS ENTER TO SKIP FROM HERE


> openssl rsa -in privkey.pem -out ssl/server.key


Enter pass phrase for privkey.pem: abc123


> openssl x509 -in ssl/server.csr -out ssl/server.crt -req -signkey ssl/server.key -days 365
> mkdir /usr/local/apache2/conf/ssl.crt
> mkdir /usr/local/apache2/conf/ssl.key
> cp ssl/server.crt /usr/local/apache2/conf/ssl.crt
> cp ssl/server.key /usr/local/apache2/conf/ssl.key
> rm -rf privkey.pem ssl

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics