Rhel5.4 x64 install Apache HTTP server2.2.27 and create an Automatic startup Service
1. Use Yum to install GCC and make. For how to use yum, see create Yum source using CD
2, upload Apache HTTP Server, file name: httpd-2.2.27.tar3, install httpserver # mkdir-P/usr/apache2.2.27 #./Configure -- prefix =/usr/apache2.2.21 -- enable-so # Make
# Make install 4. Test start and stop # Cd/usr/apache2.2.27/bin #. /apachectl starthttpd: cocould not reliably determine the server's fully qualified domain name, using 10.10.165 for servername #. /apachectl stophttpd: cocould not reliably determine the server's fully qualified domain name, using 10.10.165 for servername5, add httpd to System Service (Source: < Http://blog.sina.com.cn/s/blog_6739945f0100zgpb.html
> )
If you want to include httpd in the service automatically started by the system, you can directly copy the above apachectl file to/etc/rc. d/init. d, and then add the link to the corresponding startup level such as 3, 5. The command is as follows:
CP/usr/local/apache2/bin/apachectl/etc/rc. d/init. d/httpd
Ln-S/etc/rc. d/init. d/httpd/etc/rc. d/rc3.d/s61httpd
The s61 of the linked file is the serial number at startup. When the init. d directory contains the httpd script, we can use the service command to start and close Apache. Run the following command in any path:
Service httpd START | stop | restart
No prompt information is entered in the script, but the command has been executed. The problem is that Apache can be started automatically but cannot be seen in the Linux service list, such as running the chkconfig -- LIST command of ntsysv or red hat. To add a service, it is generally implemented through chkconfig -- add XXX, but the script must have the relevant information. Otherwise, chkconfig will prompt that the xxx service does not support chkconfig. Therefore, first edit the httpd script and add the following comments to row 2nd:
# Chkconfig: 35 61 61
# Description: Apache
The three parameters in the first line indicate the running levels of httpd (3, 5), s61, and k61 ). Note: The second line of description must be written!
Save and run: chkconfig -- add httpd.
Add httpd to the service. The s61httpd link will appear in the rc3.d and rc5.d paths, and the k61httpd link will appear in other running-level paths.
Run chkconfig -- list to view the HTTPd service.
From Weizhi note (wiz)
Rhel5.4 x64 install Apache HTTP server2.2.27 and create an Automatic startup Service