Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and configuration of httpd-2.2 version

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

I. installation and configuration of httpd-2.2 version

1. Install httpd-2.2.3

# yun-y install httpd

two。 View the files generated by the httpd installation

# rpm-ql httpd | less

3. Start the service

# service httpd start

4. Boot automatically starts the service

# chkconfig-add httpd

# chkconfig-- level 345 httpd on

5. Set up a test page

# cd / var/www/html

# vim index.html

Configuration file for 6.httpd service

# cd / etc/httpd/conf/

# cp httpd.conf httpd.conf.bak

7. Edit configuration file

# vim httpd.conf

ServerTokens Major

KeepAlive On

8. Modify the site root directory

DocumentRoot "/ web/html"

Options none

AllowOverride None

Order deny,allow

Deny from 192.168.0.1 172.16.100.177

9. Check whether the configuration file is syntactically correct

# httpd-t

Using a plain text browser under 10.linux

# elinks http://ip

11. Restrict user access to the website

AllowOverride AuthConfig

AuthType Basic

AuthName "Restricted Files"

AuthUserFile "/ etc/httpd/conf/htpasswd"

Require valid-user or Require user hadoop

twelve。 Create a qualified user file

# htpasswd-c-m / etc/httpd/conf/htpasswd hadoop

# htpasswd-m / etc/httpd/conf/htpasswd tom

13. Restart the service

# service httpd restart

14. Test whether the setting is successful on the computer browser (limit the user)

15. Restrict access based on group

AllowOverride AuthConfig

AuthType Basic

AuthName "Restricted Files"

AuthUserFile "/ etc/httpd/conf/htpasswd"

AuthGroupFile "/ etc/httpd/conf/htgroup"

Require group myusers

16. Create a user group file

# vim / etc/httpd/conf/htgroup

Myusers: hadoop tom

17. Restart the service

# service httpd restart

18.htpasswd command deletes a user

# htpasswd-D hadoop

19. Configuration of virtual host

First of all, note the central host DocumentRoot.

20. Create a virtual machine configuration file in the / etc/httpd/conf.d/ directory

# vim / etc/httpd/conf.d/virtual.conf

NameVirtualHost 172.16.100.1:80

Httpd.key) / / generate key

# openssl req-new-key httpd.key-out httpd.csr / / generate a certificate issuance request

Hostname = ServerName

# scp http.csr 172.16.100.10:/tmp / / copy the certificate issuance request to the server

twenty-nine。 On the 172.16.100.10 host

# openssl ca-in / tmp/httpd.csr-out / tmp/httpd.crt-daya 3650 / / generate a certificate

# cat / etc/pki/CA/serial / / indicates that 02 is successful

thirty。 Copy the certificate to the client host (172.16.100.1)

# scp 172.16.100.10/tmp/httpd.crt. / copy the certificate to the client host

thirty-one。 Delete all files in the tmp directory

# vim rm-rf. / *

thirty-two。 Edit / etc/httpd/conf.d/ssl.conf file (172.16.100.1)

# vim / etc/httpd/conf.d/ssl.conf

ServerName www.luochen.com

DocumentRoot "/ web/www/luochen"

SSLCertificateFile / etc/httpd/ssl/httpd.crt

SSLCertificateKeyFile / etc/httpd/ssl/httpd.key

thirty-three。 Restart the httpd server

# service httpd restart

thirty-four。 Copy the certificate of CA to the windows host

/ etc/pki/CA/cacert.pem / / at 172.16.100.10

thirty-five。 Rename the certificate on the Windows host

Cacert.pem cacert.crt

thirty-six。 Double-click to install the certificate

thirty-seven。 Finally, the browser uses https protocol to access and verify.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report