CentOS apache server configuration and management methods under (Linux) Share

Apache server under CentOS (Linux) Configuration management methods to share with a friend in need can refer to.  A, WEB server and the Apache 
1, Web server with the URL 
2, Apache history 
3 supplement 
http://www.netcraft.com/ can view the apache server market share 
and must be noted that ngnix, is in a strong growth rise time, and a great feeling in the world to compete apache, really Houshengkewei ~~~ 
two, apache server management command 
1, command starts: Service httpd start / STOP / restart / reload / condrestart / Status / configtest / Use the graceful / Help 
2 the script starts: /etc/init.d/httpd start / STOP / ..... 
3, is set at startup: ntsysv + spacebar 
three, Apache server directories and files 
1, WEB site directory 
/ var / www Apache site files directory 
/ var / www / html files stored WEB sITE WEB 
/ var / www / cgi-bin CGI program files 
/ var / www / html / manual Apache WEB server Manual 

2, the configuration file 
.htaccess based configuration file directory , .htaccess file contains access to it in the directory where the file control commands 
/etc/httpd/conf/httpd.conf Apache WEB server configuration file directory 

3, the startup script 
/etc/rc.d/init.d/httpd startup script WEB server daemon 
/etc/rc.d/rc3.d/ S85httpd the run-level directory (/etc/rc3.d) connected to the startup script directory /etc/rc.d/init.d 

4, the application file 
/ usr / sbin storage location Apache WEB server program files and applications 
/ usr / doc / placement Apache WEB server documentation 
/ var / log / http Apache log files to place 
four or more commands 
a view Apache installation information: apachectl -C 
2, to the Apache configuration file syntax checking: apachectl -t 
3, see Apache build configuration parameters: apachectl -V 
. 4, see the Apache compilation module: apachectl -l 
five, httpd.conf profile 
(a) basic configuration 
httpd.conf file contains the following three parts: 
1. set global environment : Apache server control portion (i.e., global environment variable) 
2. main server configuration: the default definitions of the key or command of service parameters, the default setting provides parameters for all virtual hosts 
3. Hosting settings: Web Hosting Set parameters 
which, no less than to write one line using the "\" newline, in addition to the parameter value of the option, all options commands are not case sensitive, "#" indicates a comment. 
Now, we come to learn the specific settings in httpd.conf: 
1. Disposed opposite the root directory path 
relative to the root directory where Apache typically store configuration files and log files, usually relative to the root directory is "/ etc / httpd", which typically contains subdirectories conf and logs, then you can use "ServerRoot "/ etc / httpd" "format settings. 
2. Setting Apache listening IP address and port number 
Apache default TCP 80 port to listen for client requests on all available IP address of the machine, you can use the Listen statements to listen for requests on a specified address and port. For example port 80 is provided only listen 192.168.0.94 server, you can make the appropriate settings in httpd.conf: Listen 192.168.0.94:80. If you need to change the port number to 8080, it can also be used to set "Listen 192.168.0.94:8080" and the like, baby naming nets but at this time to access the site through a web browser must also add the appropriate port number after the domain name address, for example, enter "http://192.168.0.94:8080" before they can be accessed. Note: my Linux virtual machine's IP is 192.168.0.94, windows of IP is 192.168.0.225 
3. Set up a network administrator's e-mail address 
when a client computer accesses a server error, the server usually returned to the client computer error page, in order to facilitate resolving errors, usually containing the administrator's e-mail address on this page, At this point you can be used ServerAdmin statement to set the administrator's e-mail address, such as "ServerAdmin [email protected]". 
4. Setting the server host name 
To facilitate the Apache server to identify their own information, you can use ServerName statement to set the host name of the server. In ServerName statement, if you have a domain name server domain name server to fill; if there is no domain name, then enter the IP address of the server. For example "ServerName 192.168.0.94:80".

Guess you like

Origin www.cnblogs.com/murongyuling/p/10966400.html