In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Install httpd server 1. Configure network card [root@Apache ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
2. Upload the source package, extract and install a. Here xftp uploaded to the root directory
b. Decompress [root@Apache ~]# tar -zxvf httpd-2.2.17.tar.gz -C /usr/src/ //extract to/usr/src/
c. Configure [root@Apache httpd-2.2.17]# ./ configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi //compile
Note:
--prefix: Specify the program installation directory
--enable-so: enables dynamic load module support to make it extensible; is the core module used to provide DSO support
--enable-rewrite: enables URL rewriting for website optimization and directory migration maintenance
--enable-charset-lite: Enables character set support for Web pages using various character set encodings
--enable-cgi: Enable CGI script program support to expand the application access capability of the website; usually executing CGI involves security issues, and any system can be called, so CGI is generally placed under a specific directory for execution.
d. Compile and install [root@Apache httpd-2.2.17]# make && make install //compile and install
3. Confirm installation results a. Confirm installation results [root@Apache ~]# ls /usr/local/httpd/ //View installation results
Note:
Service directory: /usr/local/httpd/
Main configuration file: /usr/local/httpd/conf/httpd.conf
Web directory: /usr/local/httpd/httdocs/
Service script: /usr/local/httpd/bin/apachectl
Executing program: /usr/local/httpd/bin/httpd
Access logs: /usr/local/httpd/logs/access_log
Error log: /usr/local/httpd/logs/error_log
b. Optimize execution path [root@Apache ~]# ln -s /usr/local/httpd/bin/* /usr/local/bin/ //Add httpd service [root@Apache ~]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd //Copy to service directory [root@Apache ~]# vim /etc/init.d/httpd //Edit service startup and other operation files
! [](https://s1.51cto.com/images/blog/201811/10/b97ff18bbea495dba733d2697f5cd58d.png? x-oss- process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)! []
[root@Apache ~]# chkconfig --add httpd //Add httpd as a system service [root@Apache ~]# chkconfig --list httpd //Check if 35 is powered on or not
4. Configure httpd file [root@Apache ~]# vim /usr/local/httpd/conf/httpd.conf //Edit profile
[root@Apache ~]# apachectl -t //Check if the configuration file is incorrect
5. Copy template, start service test [root@Apache httdocs]# mv index. html/usr/local/httpd/httdocs/
[root@Apache htdocs]# unzip Desktop.zip //extract in htdocs
[root@Apache ~]# /etc/init.d/httpd restart //Restart service [root@Apache ~]# netstat -utpln| grep httpd //check if httpd service is enabled
** Verify ** Real browser access server IP 192.168.10.11) Global configuration item "key value" "value" configuration format ServerRoot: service directory ServerAdmin: administrator Mailbox User: user identity of running service; default daemonGroup: group identity of running service; default daemonServerName: domain name of website server DocumentRoot: root directory of web page document Listen: IP address and port number of listening; default port 80 PidFile: file storing PID number of httpd process DirectoryIndex: Default index page file; default home file index.htmlErrorLog: location of error log file CustomLog: location of access log file; default typecommonLogLevel: level of logging, default is warTimeout: network connection timeout, default is 300 seconds KeepAlive: whether to keep connected, optional On or OffMaxKeepAliveRequests: maximum number of files requested per connection KeepAliveTimeout: timeout when to keep connected state Include: other configuration files to be included2) zone configuration items Restrict access to the root directory Options FollowSymLinks control options that allow symbolic links; whether to jump to the corresponding connection path when accessing symbolic links AllowOverride None Overriding configuration in implicit control files is not allowed; do you want to look for.htaccess files as configuration files Order deny,allow Order of application of access control policies; check forbidden settings first, all allowed if not forbidden Deny from all No one is allowed to visit this area.
Extension Because we are accessing IP here, we resolve IP and directly access domain name 1. Virtual machine modifies hosts file [root@Apache ~]# vim /etc/hosts //Edit hosts file
2. real machine modify hosts file path c-->Windows-->System32-->drivers-->etc-->hosts
Test the real machine visit domain name
Successful deployment of awstats analysis 1. Upload awstats software package and extract installation here or use xftp upload, do not do more introduction, refer to the above usage
2. Unzip [root@Apache ~]# tar -zxvf awstats-7.3.tar.gz //extract [root@Apache ~]# mv awstats-7.3 /usr/local/awstats //Move to specified directory and rename
3. Create configuration file [root@Apache ~]# cd /usr/local/awstats/tools/ //Go to [root@Apache tools]# chmod +x awstats_configure.pl //Give execution permission
4. Configure httpd profile information [root@Apache tools]# ./ awstats_configure.pl //Execute script specifies httpd main configuration file path
To set the log type, you need to set the log format of httpd server to "combined"(default is common)
Create a profile for the specified Web site
Specify the name of the configuration site
The httpd service will automatically restart next (provided that the/etc/init.d/httpd script exists). If you need to count other sites, run./again. awstats_configure.pl5. Modify the site statistics configuration file [root@Apache tools]# vim /etc/awstats/awstats.www.luof.com.conf //Edit profile LogFile="/usr/local/httpd/logs/access_log" DirData="/var/lib/awstats"[root@Apache tools]# mkdir /var/lib/awstats //Create a data repository [root@Apache tools]# chmod +x awstats_updateall.pl //give script execution permissions [root@Apache tools]# crontab -e //Create a scheduled task
[root@Apache tools]# /etc/init.d/crond start && chkconfig --level 35 crond on //Start and set it to boot. 6. Visit awstats analysis http://192.168.10.1/awstats/awstats.pl? config=www.luof.com
[root@Apache tools]# vim /usr/local/httpd/htdocs/awstats.html //create html file
Automatic adjustment of web pages to simplify access
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.