Build WEB website service (1)

Building WEB website services
1. Apache
1. The development and role of
apache 1) The development of Apache Apache
joined the open source
linux in 1995 and released
apache to ASF's apache and opportunity management in 1994
2) The role of apache
Open source website server
2. The advantages of apache And version
1) Advantages of apache
Open source: Free
Modular design: Flexible installation
Support cross-platform: Windows and Linux platforms can be used
Support multiple web languages: html, jsp, php, perl, python
Strong stability and strong security: Update Fast speed, less system resource usage, reliable
2) Apache version
1.0: 1.0 supports http protocol 1.0 poor security
2.0: 2.0 supports https protocol or http protocol, strong security
3. apache
1) Configure apache
[root@centos01 hppt-2.2.17 ]# ./configure --prefix=/usr/local/httpd --enable-so–enable-chrset-lite --enable-rewrite --enable-cgi
Insert picture description here
2) Compile and install apache
[root@centos01 hppt-2.2.17 ]#make && make install to
Insert picture description here
see if the installation is complete
Insert picture description here

3) Optimize the apache command
[root@centos01 hppt-2.2.17]#ln -s /usr/local/httpd/binapachectl /usr/local/bin/
Insert picture description here
4) Generate the apache service control file and optimize the httpd command
[root@centos01 httpd -2.2.17]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
[root@centos01 httpd-2.2.17]# chmod +x /etc/init.d/httpd
[root@ centos01 httpd-2.2.17]# ln -s /etc/init.d/httpd /usr/local/bin/

Insert picture description here
Check the apache configuration file
Insert picture description here

5) Modify the apache service control file to set the service control
[root@centos01 ~]# vim /etc/init.d/httpd
#!/bin/sh
#chkconfig:35 85 30
#Description:apache Server
Insert picture description here
Insert picture description here
6) Check the apache configuration file
[ root@centos01 ~]# apachectl -t
[root@centos01 ~]# httpd -t
7) Add system service settings to automatically start the service at boot
[root@centos01 ~]# chkconfig --add httpd
[root@centos01 ~]# chkconfig- -level 35 httpd on
Insert picture description here
8) Start the service
[root@centos01 ~]# systemctl start httpd
Insert picture description here
9) Listen to port 80
[root@centos01 ~]# netstat -anptu | grep 80
Insert picture description here
2. apache directory file and configuration file
1, apache directory configuration File
1) Main file
/usr/local/httpd/conf/httpd.conf
2) Manage apache service command
/usr/local/httpd/bin/
3) Save apache success or failure log directory
/usr/local/httpd/logs /
4) The default root directory of the apache website
/usr/local/httpd/htdocs/
2. Common configuration parameters of the apache main configuration file
1) The default listening port of apache is
Listen 80
2) The location of the default installation of the apache service is
serverroot
3) The default management of the apache service Account and group
User daemon
Froup daemon
4) The root directory of the apache default website
DocumentRoot
5) The site root directory area configuration file
<Directory"/user/local/httpd/htdocs">
6) The apache error and correct log
Errorlog
Customlog
7) Website Home
Directorylndex
8) Configure apache to support virtual host
lnclude conf/extra/httpd-vhosts.conf
9) Website domain name
ServerName
3. Modify apache’s default website root directory and homepage file
1) Create website root directory
[root@centos01 ~]# mkdir /var/www
Insert picture description here
2) Set the website homepage
[root@centos01 ~]#echo “www.benet.com”> /var/www/123.html
Insert picture description here
3) Modify the apache main configuration file to load the new website root directory and website homepage
[root@centos01 ~]#vim /usr /local/httpd/conf/httpd.conf
132 <Dirctroy “/var/www/”>
167 Directorylndex index.html 123.html
106 DocumentRoot “/var/www”
Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/Chengsen2002/article/details/108717162